Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a6556a8

Browse files
author
Zhang Jun Hao
committed
fix(freertos): disable other task before disable nmi
1 parent 89c81f7 commit a6556a8

File tree

1 file changed

+4
-2
lines changed
  • components/freertos/port/esp8266

1 file changed

+4
-2
lines changed

components/freertos/port/esp8266/port.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,10 @@ void IRAM_ATTR vPortETSIntrLock(void)
297297
if (NMIIrqIsOn == 0) {
298298
uint32_t regval = REG_READ(NMI_INT_ENABLE_REG);
299299

300+
vPortEnterCritical();
301+
300302
REG_WRITE(NMI_INT_ENABLE_REG, 0);
301303

302-
vPortEnterCritical();
303304
if (!ESP_NMI_IS_CLOSED()) {
304305
do {
305306
REG_WRITE(INT_ENA_WDEV, WDEV_TSF0_REACH_INT);
@@ -322,9 +323,10 @@ void IRAM_ATTR vPortETSIntrUnlock(void)
322323

323324
REG_WRITE(INT_ENA_WDEV, WDEV_INTEREST_EVENT);
324325
}
325-
vPortExitCritical();
326326

327327
REG_WRITE(NMI_INT_ENABLE_REG, regval);
328+
329+
vPortExitCritical();
328330
}
329331
}
330332

0 commit comments

Comments
 (0)