mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-25 01:37:22 +00:00
freertos: cleanup tick/idle hook functionality
If CONFIG_FREERTOS_LEGACY_HOOKS is kept enabled then defining idle/tick hooks will be applications responsibility as was the case earlier. Signed-off-by: Mahavir Jain <mahavir@espressif.com>
This commit is contained in:
@@ -59,11 +59,10 @@ void esp_vApplicationIdleHook()
|
||||
#ifdef CONFIG_PM_ENABLE
|
||||
esp_pm_impl_idle_hook();
|
||||
#endif
|
||||
}
|
||||
|
||||
extern void esp_vApplicationWaitiHook( void )
|
||||
{
|
||||
#ifndef CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
asm("waiti 0");
|
||||
#endif
|
||||
}
|
||||
|
||||
esp_err_t esp_register_freertos_idle_hook_for_cpu(esp_freertos_idle_cb_t new_idle_cb, UBaseType_t cpuid)
|
||||
|
@@ -455,7 +455,7 @@ void IRAM_ATTR esp_pm_impl_isr_hook()
|
||||
|
||||
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
|
||||
bool IRAM_ATTR vApplicationSleep( TickType_t xExpectedIdleTime )
|
||||
void IRAM_ATTR vApplicationSleep( TickType_t xExpectedIdleTime )
|
||||
{
|
||||
bool result = false;
|
||||
portENTER_CRITICAL(&s_switch_lock);
|
||||
@@ -499,7 +499,11 @@ bool IRAM_ATTR vApplicationSleep( TickType_t xExpectedIdleTime )
|
||||
}
|
||||
}
|
||||
portEXIT_CRITICAL(&s_switch_lock);
|
||||
return result;
|
||||
|
||||
/* Tick less idle was not successful, can block till next interrupt here */
|
||||
if (!result) {
|
||||
asm("waiti 0");
|
||||
}
|
||||
}
|
||||
#endif //CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
|
||||
|
Reference in New Issue
Block a user