mirror of
https://github.com/espressif/esp-idf.git
synced 2025-12-15 19:34:03 +00:00
freertos: Replace portSET_INTERRUPT_MASK_FROM_ISR() call for SMP
The behavior of portSET_INTERRUPT_MASK_FROM_ISR() has changed in SMP FreeRTOS. It's previous behavior is now implemented in portDISABLE_INTERRUPTS() and portRESTORE_INTERRUPTS(). This commit replaces all portSET_INTERRUPT_MASK_FROM_ISR() and portCLEAR_INTERRUPT_MASK_FROM_ISR() calls with portDISABLE_INTERRUPTS() and portRESTORE_INTERRUPTS() respectively
This commit is contained in:
@@ -789,7 +789,11 @@ void esp_pm_impl_init(void)
|
||||
void esp_pm_impl_idle_hook(void)
|
||||
{
|
||||
int core_id = xPortGetCoreID();
|
||||
#if CONFIG_FREERTOS_SMP
|
||||
uint32_t state = portDISABLE_INTERRUPTS();
|
||||
#else
|
||||
uint32_t state = portSET_INTERRUPT_MASK_FROM_ISR();
|
||||
#endif
|
||||
if (!s_core_idle[core_id]
|
||||
#ifdef CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
&& !periph_should_skip_light_sleep()
|
||||
@@ -798,7 +802,11 @@ void esp_pm_impl_idle_hook(void)
|
||||
esp_pm_lock_release(s_rtos_lock_handle[core_id]);
|
||||
s_core_idle[core_id] = true;
|
||||
}
|
||||
#if CONFIG_FREERTOS_SMP
|
||||
portRESTORE_INTERRUPTS(state);
|
||||
#else
|
||||
portCLEAR_INTERRUPT_MASK_FROM_ISR(state);
|
||||
#endif
|
||||
ESP_PM_TRACE_ENTER(IDLE, core_id);
|
||||
}
|
||||
|
||||
@@ -809,7 +817,11 @@ void IRAM_ATTR esp_pm_impl_isr_hook(void)
|
||||
/* 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.
|
||||
*/
|
||||
#if CONFIG_FREERTOS_SMP
|
||||
uint32_t state = portDISABLE_INTERRUPTS();
|
||||
#else
|
||||
uint32_t state = portSET_INTERRUPT_MASK_FROM_ISR();
|
||||
#endif
|
||||
#if defined(CONFIG_FREERTOS_SYSTICK_USES_CCOUNT) && (portNUM_PROCESSORS == 2)
|
||||
if (s_need_update_ccompare[core_id]) {
|
||||
update_ccompare();
|
||||
@@ -820,7 +832,11 @@ void IRAM_ATTR esp_pm_impl_isr_hook(void)
|
||||
#else
|
||||
leave_idle();
|
||||
#endif // CONFIG_FREERTOS_SYSTICK_USES_CCOUNT && portNUM_PROCESSORS == 2
|
||||
#if CONFIG_FREERTOS_SMP
|
||||
portRESTORE_INTERRUPTS(state);
|
||||
#else
|
||||
portCLEAR_INTERRUPT_MASK_FROM_ISR(state);
|
||||
#endif
|
||||
ESP_PM_TRACE_EXIT(ISR_HOOK, core_id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user