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

Skip to content

Commit e7b8e9f

Browse files
donghengdongheng
authored andcommitted
feat(system): Add global ISR swith
1 parent 556fe6b commit e7b8e9f

File tree

8 files changed

+21
-39
lines changed

8 files changed

+21
-39
lines changed

components/esp8266/include/esp8266/eagle_soc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@
123123
#define TM1_EDGE_INT_DISABLE() CLEAR_PERI_REG_MASK(EDGE_INT_ENABLE_REG, BIT1)
124124
//}}
125125

126+
#define INT_ENA_WDEV 0x3ff20c18
127+
#define WDEV_TSF0_REACH_INT (BIT(27))
126128

127129
//Watch dog reg {{
128130
#define PERIPHS_WDT_BASEADDR 0x60000900

components/esp8266/include/rom/ets_sys.h

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -53,39 +53,9 @@ typedef enum {
5353
CANCEL,
5454
} STATUS;
5555

56-
extern char NMIIrqIsOn;
57-
extern uint32_t WDEV_INTEREST_EVENT;
58-
59-
#define INT_ENA_WDEV 0x3ff20c18
60-
#define WDEV_TSF0_REACH_INT (BIT(27))
61-
62-
#define ETS_NMI_LOCK() \
63-
do { \
64-
do { \
65-
REG_WRITE(INT_ENA_WDEV, WDEV_TSF0_REACH_INT); \
66-
} while(REG_READ(INT_ENA_WDEV) != WDEV_TSF0_REACH_INT); \
67-
} while (0)
68-
69-
#define ETS_NMI_UNLOCK() \
70-
do { \
71-
REG_WRITE(INT_ENA_WDEV, WDEV_INTEREST_EVENT); \
72-
} while (0)
73-
74-
#define ETS_INTR_LOCK() do { \
75-
if (NMIIrqIsOn == 0) { \
76-
vPortEnterCritical(); \
77-
do { \
78-
REG_WRITE(INT_ENA_WDEV, WDEV_TSF0_REACH_INT); \
79-
} while(REG_READ(INT_ENA_WDEV) != WDEV_TSF0_REACH_INT); \
80-
} \
81-
} while(0)
82-
83-
#define ETS_INTR_UNLOCK() do { \
84-
if (NMIIrqIsOn == 0) { \
85-
REG_WRITE(INT_ENA_WDEV, WDEV_INTEREST_EVENT); \
86-
vPortExitCritical(); \
87-
} \
88-
} while(0)
56+
void vPortETSIntrLock(void);
57+
58+
void vPortETSIntrUnlock(void);
8959

9060
#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
9161
#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"

components/esp8266/lib/VERSION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
gwen:
2-
core: 33a48e5
3-
net80211: 71f5b94
4-
pp: c32a629
2+
core: 381d974
3+
net80211: 381d974
4+
pp: 381d974
55
wpa: 33a48e5
66
espnow: da96924
77
wps: da96924

components/esp8266/lib/libcore.a

-456 Bytes
Binary file not shown.
-456 Bytes
Binary file not shown.

components/esp8266/lib/libpp.a

-8.05 KB
Binary file not shown.

components/esp8266/lib/libpp_dbg.a

-8.07 KB
Binary file not shown.

components/freertos/port/esp8266/port.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
#define SET_STKREG(r,v) sp[(r) >> 2] = (uint32_t)(v)
5151
#define PORT_ASSERT(x) do { if (!(x)) {ets_printf("%s %u\n", "rtos_port", __LINE__); while(1){}; }} while (0)
5252

53-
extern char NMIIrqIsOn;
53+
extern uint8_t NMIIrqIsOn;
5454
static int SWReq = 0;
5555

5656
uint32_t cpu_sr;
@@ -250,12 +250,22 @@ void show_critical_info(void)
250250

251251
void IRAM_ATTR vPortETSIntrLock(void)
252252
{
253-
ETS_INTR_LOCK();
253+
if (NMIIrqIsOn == 0) {
254+
vPortEnterCritical();
255+
do {
256+
REG_WRITE(INT_ENA_WDEV, WDEV_TSF0_REACH_INT);
257+
} while(REG_READ(INT_ENA_WDEV) != WDEV_TSF0_REACH_INT);
258+
}
254259
}
255260

256261
void IRAM_ATTR vPortETSIntrUnlock(void)
257262
{
258-
ETS_INTR_UNLOCK();
263+
if (NMIIrqIsOn == 0) {
264+
extern uint32_t WDEV_INTEREST_EVENT;
265+
266+
REG_WRITE(INT_ENA_WDEV, WDEV_INTEREST_EVENT);
267+
vPortExitCritical();
268+
}
259269
}
260270

261271
/*

0 commit comments

Comments
 (0)