mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-07 21:47:21 +00:00
fix(freertos): Use INTERRUPT_CURRENT_CORE_INT_THRESH_REG for esp32p4
This commit is contained in:
@@ -193,7 +193,7 @@ extern void vTaskExitCritical( void );
|
||||
|
||||
#define portSET_INTERRUPT_MASK_FROM_ISR() ({ \
|
||||
unsigned int cur_level; \
|
||||
cur_level = REG_READ(INTERRUPT_CORE0_CPU_INT_THRESH_REG); \
|
||||
cur_level = REG_READ(INTERRUPT_CURRENT_CORE_INT_THRESH_REG); \
|
||||
vTaskEnterCritical(); \
|
||||
cur_level; \
|
||||
})
|
||||
@@ -293,7 +293,16 @@ void vPortExitCritical(void);
|
||||
|
||||
static inline bool IRAM_ATTR xPortCanYield(void)
|
||||
{
|
||||
uint32_t threshold = REG_READ(INTERRUPT_CORE0_CPU_INT_THRESH_REG);
|
||||
uint32_t threshold = REG_READ(INTERRUPT_CURRENT_CORE_INT_THRESH_REG);
|
||||
#if SOC_INT_CLIC_SUPPORTED
|
||||
threshold = threshold >> (CLIC_CPU_INT_THRESH_S + (8 - NLBITS));
|
||||
|
||||
/* When CLIC is supported, the lowest interrupt threshold level is 0.
|
||||
* Therefore, an interrupt threshold level above 0 would mean that we
|
||||
* are either in a critical section or in an ISR.
|
||||
*/
|
||||
return (threshold == 0);
|
||||
#endif /* SOC_INT_CLIC_SUPPORTED */
|
||||
/* when enter critical code, FreeRTOS will mask threshold to RVHAL_EXCM_LEVEL
|
||||
* and exit critical code, will recover threshold value (1). so threshold <= 1
|
||||
* means not in critical code
|
||||
|
Reference in New Issue
Block a user