Skip to content

Commit

Permalink
Merge branch 'bugfix/freertos_incorrect_xPortCanYield' into 'master'
Browse files Browse the repository at this point in the history
fix(freertos): Corrected xPortCanYield() for esp32p4

See merge request espressif/esp-idf!25679
  • Loading branch information
sudeep-mohanty committed Sep 4, 2023
2 parents 830acd0 + d9a3e3b commit 62ee413
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,12 @@ FORCE_INLINE_ATTR bool xPortCanYield(void)
uint32_t threshold = REG_READ(INTERRUPT_CORE0_CPU_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
Expand Down

0 comments on commit 62ee413

Please sign in to comment.