revert part of #16179 for ESP8266

This commit is contained in:
Barbudor 2023-02-20 22:43:50 +01:00
parent 3ce011c2ce
commit b8e6126407
1 changed files with 8 additions and 0 deletions

View File

@ -411,6 +411,10 @@ void IRrecv::pause(void) {
params.rcvstate = kStopState; params.rcvstate = kStopState;
params.rawlen = 0; params.rawlen = 0;
params.overflow = false; params.overflow = false;
#if defined(ESP8266)
os_timer_disarm(&timer);
detachInterrupt(params.recvpin);
#endif
#if defined(ESP32) #if defined(ESP32)
gpio_intr_disable((gpio_num_t)params.recvpin); gpio_intr_disable((gpio_num_t)params.recvpin);
#endif // ESP32 #endif // ESP32
@ -424,6 +428,10 @@ void IRrecv::resume(void) {
params.rcvstate = kIdleState; params.rcvstate = kIdleState;
params.rawlen = 0; params.rawlen = 0;
params.overflow = false; params.overflow = false;
#if defined(ESP8266)
os_timer_setfn(&timer, reinterpret_cast<os_timer_func_t *>(read_timeout),NULL);
attachInterrupt(params.recvpin, gpio_intr, CHANGE);
#endif
#if defined(ESP32) #if defined(ESP32)
timerAlarmDisable(timer); timerAlarmDisable(timer);
gpio_intr_enable((gpio_num_t)params.recvpin); gpio_intr_enable((gpio_num_t)params.recvpin);