mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-08-05 22:11:04 +08:00
feat(freertos): Add configuration to speed up task switch
The global heap is 74332 bytes when connect to AP and get IP by DHCP.
This commit is contained in:
@ -127,5 +127,11 @@ NVIC value of 255. */
|
||||
/* add this to dump task stack information */
|
||||
#define configRECORD_STACK_HIGH_ADDRESS 1
|
||||
|
||||
#ifdef CONFIG_TASK_SWITCH_FASTER
|
||||
#define TASK_SW_ATTR IRAM_ATTR
|
||||
#else
|
||||
#define TASK_SW_ATTR
|
||||
#endif
|
||||
|
||||
#endif /* FREERTOS_CONFIG_H */
|
||||
|
||||
|
@ -59,8 +59,12 @@ vPortYield:
|
||||
|
||||
call0 _xt_int_enter
|
||||
call0 vPortEnterCritical
|
||||
#ifndef CONFIG_TASK_SWITCH_FASTER
|
||||
movi a0, vTaskSwitchContext
|
||||
callx0 a0
|
||||
callx0 a0
|
||||
#else
|
||||
call0 vTaskSwitchContext
|
||||
#endif
|
||||
call0 vPortExitCritical
|
||||
call0 _xt_int_exit
|
||||
|
||||
@ -239,8 +243,12 @@ _xt_timer_int:
|
||||
|
||||
/* Call the uCOS-II tick handler. */
|
||||
#ifdef __XTENSA_CALL0_ABI__ /* OSTimeTick() */
|
||||
#ifndef CONFIG_TASK_SWITCH_FASTER
|
||||
movi a0, xPortSysTickHandle
|
||||
callx0 a0
|
||||
#else
|
||||
call0 xPortSysTickHandle
|
||||
#endif
|
||||
#else
|
||||
call4 xTaskIncrementTick
|
||||
#endif
|
||||
@ -281,8 +289,12 @@ _xt_timer_int1:
|
||||
#endif
|
||||
|
||||
/* Call the uCOS-II tick handler. */
|
||||
#ifndef CONFIG_TASK_SWITCH_FASTER
|
||||
movi a0, vTaskSwitchContext
|
||||
callx0 a0
|
||||
#else
|
||||
call0 vTaskSwitchContext
|
||||
#endif
|
||||
|
||||
#ifdef __XTENSA_CALL0_ABI__
|
||||
/* Restore a2 and a3. */
|
||||
|
@ -118,7 +118,7 @@ void IRAM_ATTR HDL_MAC_SIG_IN_LV1_ISR(void)
|
||||
|
||||
extern portBASE_TYPE MacIsrSigPostDefHdl(void);
|
||||
|
||||
void SoftIsrHdl(void* arg)
|
||||
void TASK_SW_ATTR SoftIsrHdl(void* arg)
|
||||
{
|
||||
ETS_NMI_LOCK();
|
||||
|
||||
@ -137,7 +137,7 @@ void SoftIsrHdl(void* arg)
|
||||
ETS_NMI_UNLOCK();
|
||||
}
|
||||
|
||||
void xPortSysTickHandle(void)
|
||||
void TASK_SW_ATTR xPortSysTickHandle(void)
|
||||
{
|
||||
if (xTaskIncrementTick() != pdFALSE) {
|
||||
vTaskSwitchContext();
|
||||
@ -284,7 +284,7 @@ void _xt_isr_attach(uint8_t i, _xt_isr func, void* arg)
|
||||
isr[i].arg = arg;
|
||||
}
|
||||
|
||||
uint16_t _xt_isr_handler(uint16_t i)
|
||||
uint16_t TASK_SW_ATTR _xt_isr_handler(uint16_t i)
|
||||
{
|
||||
uint8_t index;
|
||||
|
||||
|
@ -927,8 +927,12 @@ _xt_user_entry1:
|
||||
s32i a1, a0, 0
|
||||
mov a1, a0
|
||||
|
||||
#ifndef CONFIG_TASK_SWITCH_FASTER
|
||||
movi a0, _xt_isr_handler
|
||||
callx0 a0
|
||||
#else
|
||||
call0 _xt_isr_handler
|
||||
#endif
|
||||
|
||||
movi a0, _chip_interrupt_tmp
|
||||
l32i a1, a0, 0
|
||||
|
Reference in New Issue
Block a user