Skip to content

Commit 4472df0

Browse files
Fix WDT resets in sample push/pop
est_wdt_(dis/en)able were being called instead of yield in the i2s_(read/write)_sample branches, but those calls don't actually reset the WDT. Replace with optimistic_yield(10ms).
1 parent d2af6fa commit 4472df0

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

cores/esp8266/core_esp8266_i2s.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@
2424
#include "osapi.h"
2525
#include "ets_sys.h"
2626

27+
2728
#include "i2s_reg.h"
2829
#include "i2s.h"
2930

30-
extern void ets_wdt_enable(void);
31-
extern void ets_wdt_disable(void);
32-
3331
#define SLC_BUF_CNT (8) // Number of buffers in the I2S circular buffer
3432
#define SLC_BUF_LEN (64) // Length of one buffer, in 32-bit words.
3533

@@ -303,8 +301,7 @@ static bool _i2s_write_sample(uint32_t sample, bool nb) {
303301
if (tx->slc_queue_len > 0){
304302
break;
305303
} else {
306-
ets_wdt_disable();
307-
ets_wdt_enable();
304+
optimistic_yield(10000);
308305
}
309306
}
310307
}
@@ -340,8 +337,7 @@ bool i2s_read_sample(uint32_t *left, uint32_t *right, bool blocking) {
340337
if (rx->slc_queue_len > 0){
341338
break;
342339
} else {
343-
ets_wdt_disable();
344-
ets_wdt_enable();
340+
optimistic_yield(10000);
345341
}
346342
}
347343
}

0 commit comments

Comments
 (0)