diff --git a/components/esp8266/include/esp8266/eagle_soc.h b/components/esp8266/include/esp8266/eagle_soc.h index 0a83c636..490ecab9 100644 --- a/components/esp8266/include/esp8266/eagle_soc.h +++ b/components/esp8266/include/esp8266/eagle_soc.h @@ -123,8 +123,6 @@ #define TM1_EDGE_INT_DISABLE() CLEAR_PERI_REG_MASK(EDGE_INT_ENABLE_REG, BIT1) //}} -#define INT_ENA_WDEV 0x3ff20c18 -#define WDEV_TSF0_REACH_INT (BIT(27)) //Watch dog reg {{ #define PERIPHS_WDT_BASEADDR 0x60000900 diff --git a/components/esp8266/include/rom/ets_sys.h b/components/esp8266/include/rom/ets_sys.h index 4a8505ef..d9057d0a 100644 --- a/components/esp8266/include/rom/ets_sys.h +++ b/components/esp8266/include/rom/ets_sys.h @@ -53,9 +53,39 @@ typedef enum { CANCEL, } STATUS; -void vPortETSIntrLock(void); +extern char NMIIrqIsOn; +extern uint32_t WDEV_INTEREST_EVENT; -void vPortETSIntrUnlock(void); +#define INT_ENA_WDEV 0x3ff20c18 +#define WDEV_TSF0_REACH_INT (BIT(27)) + +#define ETS_NMI_LOCK() \ + do { \ + do { \ + REG_WRITE(INT_ENA_WDEV, WDEV_TSF0_REACH_INT); \ + } while(REG_READ(INT_ENA_WDEV) != WDEV_TSF0_REACH_INT); \ + } 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(); \ + do { \ + REG_WRITE(INT_ENA_WDEV, WDEV_TSF0_REACH_INT); \ + } while(REG_READ(INT_ENA_WDEV) != WDEV_TSF0_REACH_INT); \ + } \ + } while(0) + +#define ETS_INTR_UNLOCK() do { \ + if (NMIIrqIsOn == 0) { \ + REG_WRITE(INT_ENA_WDEV, WDEV_INTEREST_EVENT); \ + vPortExitCritical(); \ + } \ + } while(0) #define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] #define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x" diff --git a/components/esp8266/lib/VERSION b/components/esp8266/lib/VERSION index 79814977..1c5cab17 100644 --- a/components/esp8266/lib/VERSION +++ b/components/esp8266/lib/VERSION @@ -1,7 +1,7 @@ gwen: - core: 381d974 - net80211: 381d974 - pp: 381d974 + core: 33a48e5 + net80211: 71f5b94 + pp: c32a629 wpa: 33a48e5 espnow: da96924 wps: da96924 diff --git a/components/esp8266/lib/libcore.a b/components/esp8266/lib/libcore.a index 39e282fa..29659cd9 100644 Binary files a/components/esp8266/lib/libcore.a and b/components/esp8266/lib/libcore.a differ diff --git a/components/esp8266/lib/libcore_dbg.a b/components/esp8266/lib/libcore_dbg.a index 1bf879cf..5a796588 100644 Binary files a/components/esp8266/lib/libcore_dbg.a and b/components/esp8266/lib/libcore_dbg.a differ diff --git a/components/esp8266/lib/libpp.a b/components/esp8266/lib/libpp.a index b6d3f40e..125fc5fb 100644 Binary files a/components/esp8266/lib/libpp.a and b/components/esp8266/lib/libpp.a differ diff --git a/components/esp8266/lib/libpp_dbg.a b/components/esp8266/lib/libpp_dbg.a index f97267f1..d22da73a 100644 Binary files a/components/esp8266/lib/libpp_dbg.a and b/components/esp8266/lib/libpp_dbg.a differ diff --git a/components/freertos/port/esp8266/port.c b/components/freertos/port/esp8266/port.c index 6e4e7091..0aced897 100644 --- a/components/freertos/port/esp8266/port.c +++ b/components/freertos/port/esp8266/port.c @@ -50,7 +50,7 @@ #define SET_STKREG(r,v) sp[(r) >> 2] = (uint32_t)(v) #define PORT_ASSERT(x) do { if (!(x)) {ets_printf("%s %u\n", "rtos_port", __LINE__); while(1){}; }} while (0) -extern uint8_t NMIIrqIsOn; +extern char NMIIrqIsOn; static int SWReq = 0; uint32_t cpu_sr; @@ -250,22 +250,12 @@ void show_critical_info(void) void IRAM_ATTR vPortETSIntrLock(void) { - if (NMIIrqIsOn == 0) { - vPortEnterCritical(); - do { - REG_WRITE(INT_ENA_WDEV, WDEV_TSF0_REACH_INT); - } while(REG_READ(INT_ENA_WDEV) != WDEV_TSF0_REACH_INT); - } + ETS_INTR_LOCK(); } void IRAM_ATTR vPortETSIntrUnlock(void) { - if (NMIIrqIsOn == 0) { - extern uint32_t WDEV_INTEREST_EVENT; - - REG_WRITE(INT_ENA_WDEV, WDEV_INTEREST_EVENT); - vPortExitCritical(); - } + ETS_INTR_UNLOCK(); } /*