mirror of
https://github.com/esphome/esphome.git
synced 2024-12-25 23:14:54 +01:00
fix: Incorrect time delay conversion breaks remote_transmitter_esp8266.cpp (#1322)
* Incorrect time delay conversion breaks remote_transmitter_esp8266.cpp I'm unsure why the conversion from microseconds into whole millseconds and remaining microseconds is done using a value of 16383, rather than 1000. This breaks the "on", "off" times, as well as the repeat wait_time if the period is more than 16383 microseconds. I have confirmed behaviour with an oscilloscope. See https://community.home-assistant.io/t/infrared-remote-transmitter-not-working/232825 * Update esphome/core/helpers.cpp Co-authored-by: Guillermo Ruffino <glm.net@gmail.com> Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
This commit is contained in:
parent
5f619e6f01
commit
e50644edee
1 changed files with 2 additions and 2 deletions
|
@ -178,8 +178,8 @@ void delay_microseconds_accurate(uint32_t usec) {
|
|||
if (usec <= 16383UL) {
|
||||
delayMicroseconds(usec);
|
||||
} else {
|
||||
delay(usec / 16383UL);
|
||||
delayMicroseconds(usec % 16383UL);
|
||||
delay(usec / 1000UL);
|
||||
delayMicroseconds(usec % 1000UL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue