mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/pm_isr_exit_lock' into 'master'
pm: prevent interrupt nesting during esp_pm_impl_isr_hook See merge request idf/esp-idf!4775
This commit is contained in:
commit
912c8e31fc
@ -458,6 +458,10 @@ void IRAM_ATTR esp_pm_impl_isr_hook()
|
|||||||
{
|
{
|
||||||
int core_id = xPortGetCoreID();
|
int core_id = xPortGetCoreID();
|
||||||
ESP_PM_TRACE_ENTER(ISR_HOOK, core_id);
|
ESP_PM_TRACE_ENTER(ISR_HOOK, core_id);
|
||||||
|
/* Prevent higher level interrupts (than the one this function was called from)
|
||||||
|
* from happening in this section, since they will also call into esp_pm_impl_isr_hook.
|
||||||
|
*/
|
||||||
|
uint32_t state = portENTER_CRITICAL_NESTED();
|
||||||
#if portNUM_PROCESSORS == 2
|
#if portNUM_PROCESSORS == 2
|
||||||
if (s_need_update_ccompare[core_id]) {
|
if (s_need_update_ccompare[core_id]) {
|
||||||
update_ccompare();
|
update_ccompare();
|
||||||
@ -468,6 +472,7 @@ void IRAM_ATTR esp_pm_impl_isr_hook()
|
|||||||
#else
|
#else
|
||||||
leave_idle();
|
leave_idle();
|
||||||
#endif // portNUM_PROCESSORS == 2
|
#endif // portNUM_PROCESSORS == 2
|
||||||
|
portEXIT_CRITICAL_NESTED(state);
|
||||||
ESP_PM_TRACE_EXIT(ISR_HOOK, core_id);
|
ESP_PM_TRACE_EXIT(ISR_HOOK, core_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user