From 3d49a6b8463f25408864b494281cd49a8d204ffc Mon Sep 17 00:00:00 2001 From: XiongYu Date: Wed, 14 Nov 2018 01:58:28 +0000 Subject: [PATCH] bugfix(third_party): undefined reference to ETS_NMI_UNLOCK fixes: https://github.com/espressif/ESP8266_RTOS_SDK/issues/160 --- include/espressif/esp8266/ets_sys.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/espressif/esp8266/ets_sys.h b/include/espressif/esp8266/ets_sys.h index 28736eb6..e3a6ce2f 100644 --- a/include/espressif/esp8266/ets_sys.h +++ b/include/espressif/esp8266/ets_sys.h @@ -40,6 +40,21 @@ extern uint32 WDEV_INTEREST_EVENT; #define INT_ENA_WDEV 0x3ff20c18 #define WDEV_TSF0_REACH_INT (BIT(27)) +#define ETS_NMI_LOCK() \ + do { \ + char m = 10; \ + do { \ + REG_WRITE(INT_ENA_WDEV, 0); \ + m = 10; \ + for (; m > 0; m--) {} \ + REG_WRITE(INT_ENA_WDEV, WDEV_TSF0_REACH_INT); \ + } while(0); \ + } while (0) + #define ETS_NMI_UNLOCK() \ + do { \ + REG_WRITE(INT_ENA_WDEV, WDEV_INTEREST_EVENT); \ + } while (0) + #define ETS_INTR_LOCK() do { \ if (NMIIrqIsOn == 0) { \ vPortEnterCritical(); \