mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-07-15 00:21:26 +08:00
feat(freertos): Reduce close NMI time
This commit is contained in:
@ -51,13 +51,9 @@ extern uint32_t WDEV_INTEREST_EVENT;
|
||||
|
||||
#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(REG_READ(INT_ENA_WDEV) != WDEV_TSF0_REACH_INT); \
|
||||
} while (0)
|
||||
|
||||
#define ETS_NMI_UNLOCK() \
|
||||
@ -68,13 +64,9 @@ extern uint32_t WDEV_INTEREST_EVENT;
|
||||
#define ETS_INTR_LOCK() do { \
|
||||
if (NMIIrqIsOn == 0) { \
|
||||
vPortEnterCritical(); \
|
||||
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(REG_READ(INT_ENA_WDEV) != WDEV_TSF0_REACH_INT); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
gwen:
|
||||
core: f0128c3
|
||||
net80211: f0128c3
|
||||
pp: f0128c3
|
||||
wpa: f0128c3
|
||||
espnow: f0128c3
|
||||
wps: f0128c3
|
||||
core: 021ebb5
|
||||
net80211: 021ebb5
|
||||
pp: 021ebb5
|
||||
wpa: 021ebb5
|
||||
espnow: 021ebb5
|
||||
wps: 021ebb5
|
||||
|
||||
smartconfig: 2.8.1
|
||||
phy: 1055_8
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -88,7 +88,7 @@ typedef unsigned int INT32U;
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* Scheduler utilities. */
|
||||
extern void PendSV(char req);
|
||||
extern void PendSV(int req);
|
||||
//#define portYIELD() vPortYield()
|
||||
#define portYIELD() PendSV(1)
|
||||
|
||||
|
@ -50,8 +50,7 @@
|
||||
#define PORT_ASSERT(x) do { if (!(x)) {ets_printf("%s %u\n", "rtos_port", __LINE__); while(1){}; }} while (0)
|
||||
|
||||
extern char NMIIrqIsOn;
|
||||
static uint8_t HdlMacSig = 0;
|
||||
static uint8_t SWReq = 0;
|
||||
static int SWReq = 0;
|
||||
|
||||
unsigned cpu_sr;
|
||||
|
||||
@ -102,7 +101,7 @@ StackType_t *pxPortInitialiseStack(StackType_t *pxTopOfStack, pdTASK_CODE pxCode
|
||||
return (StackType_t *)sp;
|
||||
}
|
||||
|
||||
void IRAM_ATTR PendSV(char req)
|
||||
void IRAM_ATTR PendSV(int req)
|
||||
{
|
||||
if (req == 1) {
|
||||
vPortEnterCritical();
|
||||
@ -110,35 +109,18 @@ void IRAM_ATTR PendSV(char req)
|
||||
xthal_set_intset(1 << ETS_SOFT_INUM);
|
||||
vPortExitCritical();
|
||||
} else if (req == 2) {
|
||||
HdlMacSig = 1;
|
||||
xthal_set_intset(1 << ETS_SOFT_INUM);
|
||||
}
|
||||
}
|
||||
|
||||
void IRAM_ATTR HDL_MAC_SIG_IN_LV1_ISR(void)
|
||||
{
|
||||
PendSV(2);
|
||||
}
|
||||
|
||||
extern portBASE_TYPE MacIsrSigPostDefHdl(void);
|
||||
|
||||
void TASK_SW_ATTR SoftIsrHdl(void* arg)
|
||||
{
|
||||
ETS_NMI_LOCK();
|
||||
extern int MacIsrSigPostDefHdl(void);
|
||||
|
||||
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||
|
||||
if (HdlMacSig == 1) {
|
||||
HdlMacSig = 0;
|
||||
xHigherPriorityTaskWoken = MacIsrSigPostDefHdl();
|
||||
}
|
||||
|
||||
if (xHigherPriorityTaskWoken || (SWReq == 1)) {
|
||||
if (MacIsrSigPostDefHdl() || (SWReq == 1)) {
|
||||
_xt_timer_int1();
|
||||
SWReq = 0;
|
||||
}
|
||||
|
||||
ETS_NMI_UNLOCK();
|
||||
}
|
||||
|
||||
void esp_increase_tick_cnt(const TickType_t ticks)
|
||||
@ -243,7 +225,6 @@ void IRAM_ATTR vPortExitCritical(void)
|
||||
void show_critical_info(void)
|
||||
{
|
||||
ets_printf("ShowCritical:%u\n", uxCriticalNesting);
|
||||
ets_printf("HdlMacSig:%u\n", HdlMacSig);
|
||||
ets_printf("SWReq:%u\n", SWReq);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user