mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
feat(freertos/smp): Update other IDF components to be compatible with FreeRTOS v11.0.1
This commit is contained in:
parent
83c686c744
commit
48a7f053d5
@ -223,9 +223,9 @@ else()
|
||||
endif()
|
||||
|
||||
# SMP FreeRTOS user provided minimal idle hook. This allows the user to provide
|
||||
# their own copy of vApplicationMinimalIdleHook()
|
||||
if(CONFIG_FREERTOS_USE_MINIMAL_IDLE_HOOK)
|
||||
list(APPEND link_options "-Wl,--wrap=vApplicationMinimalIdleHook")
|
||||
# their own copy of vApplicationPassiveIdleHook()
|
||||
if(CONFIG_FREERTOS_USE_PASSIVE_IDLE_HOOK)
|
||||
list(APPEND link_options "-Wl,--wrap=vApplicationPassiveIdleHook")
|
||||
endif()
|
||||
|
||||
# Placing jump tables in flash would cause issues with code that required
|
||||
|
@ -52,13 +52,13 @@ void esp_restart(void)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_FREERTOS_SMP
|
||||
#if ( ( CONFIG_FREERTOS_SMP ) && ( !CONFIG_FREERTOS_UNICORE ) )
|
||||
//Note: Scheduler suspension behavior changed in FreeRTOS SMP
|
||||
vTaskPreemptionDisable(NULL);
|
||||
#else
|
||||
// Disable scheduler on this core.
|
||||
vTaskSuspendAll();
|
||||
#endif // CONFIG_FREERTOS_SMP
|
||||
#endif // #if ( ( CONFIG_FREERTOS_SMP ) && ( !CONFIG_FREERTOS_UNICORE ) )
|
||||
|
||||
esp_restart_noos();
|
||||
}
|
||||
|
@ -60,13 +60,13 @@ static void do_deep_sleep_from_app_cpu(void)
|
||||
|
||||
xTaskCreatePinnedToCore(&deep_sleep_task, "ds", 2048, NULL, 5, NULL, 1);
|
||||
|
||||
#ifdef CONFIG_FREERTOS_SMP
|
||||
#if ( ( CONFIG_FREERTOS_SMP ) && ( !CONFIG_FREERTOS_UNICORE ) )
|
||||
//Note: Scheduler suspension behavior changed in FreeRTOS SMP
|
||||
vTaskPreemptionDisable(NULL);
|
||||
#else
|
||||
// keep running some non-IRAM code
|
||||
vTaskSuspendAll();
|
||||
#endif // CONFIG_FREERTOS_SMP
|
||||
#endif // #if ( ( CONFIG_FREERTOS_SMP ) && ( !CONFIG_FREERTOS_UNICORE ) )
|
||||
|
||||
while (true) {
|
||||
;
|
||||
|
@ -118,7 +118,7 @@ void spi_flash_op_unlock(void)
|
||||
void IRAM_ATTR spi_flash_op_block_func(void *arg)
|
||||
{
|
||||
// Disable scheduler on this CPU
|
||||
#ifdef CONFIG_FREERTOS_SMP
|
||||
#if ( ( CONFIG_FREERTOS_SMP ) && ( !CONFIG_FREERTOS_UNICORE ) )
|
||||
/*
|
||||
Note: FreeRTOS SMP has changed the behavior of scheduler suspension. But the vTaskPreemptionDisable() function should
|
||||
achieve the same affect as before (i.e., prevent the current task from being preempted).
|
||||
@ -126,7 +126,7 @@ void IRAM_ATTR spi_flash_op_block_func(void *arg)
|
||||
vTaskPreemptionDisable(NULL);
|
||||
#else
|
||||
vTaskSuspendAll();
|
||||
#endif // CONFIG_FREERTOS_SMP
|
||||
#endif // #if ( ( CONFIG_FREERTOS_SMP ) && ( !CONFIG_FREERTOS_UNICORE ) )
|
||||
// Restore interrupts that aren't located in IRAM
|
||||
esp_intr_noniram_disable();
|
||||
uint32_t cpuid = (uint32_t) arg;
|
||||
@ -142,13 +142,13 @@ void IRAM_ATTR spi_flash_op_block_func(void *arg)
|
||||
spi_flash_restore_cache(cpuid, s_flash_op_cache_state[cpuid]);
|
||||
// Restore interrupts that aren't located in IRAM
|
||||
esp_intr_noniram_enable();
|
||||
#ifdef CONFIG_FREERTOS_SMP
|
||||
#if ( ( CONFIG_FREERTOS_SMP ) && ( !CONFIG_FREERTOS_UNICORE ) )
|
||||
//Note: Scheduler suspension behavior changed in FreeRTOS SMP
|
||||
vTaskPreemptionEnable(NULL);
|
||||
#else
|
||||
// Re-enable scheduler
|
||||
xTaskResumeAll();
|
||||
#endif // CONFIG_FREERTOS_SMP
|
||||
#endif // #if ( ( CONFIG_FREERTOS_SMP ) && ( !CONFIG_FREERTOS_UNICORE ) )
|
||||
}
|
||||
|
||||
void IRAM_ATTR spi_flash_disable_interrupts_caches_and_other_cpu(void)
|
||||
@ -187,13 +187,13 @@ void IRAM_ATTR spi_flash_disable_interrupts_caches_and_other_cpu(void)
|
||||
// Busy loop and wait for spi_flash_op_block_func to disable cache
|
||||
// on the other CPU
|
||||
}
|
||||
#ifdef CONFIG_FREERTOS_SMP
|
||||
#if ( ( CONFIG_FREERTOS_SMP ) && ( !CONFIG_FREERTOS_UNICORE ) )
|
||||
//Note: Scheduler suspension behavior changed in FreeRTOS SMP
|
||||
vTaskPreemptionDisable(NULL);
|
||||
#else
|
||||
// Disable scheduler on the current CPU
|
||||
vTaskSuspendAll();
|
||||
#endif // CONFIG_FREERTOS_SMP
|
||||
#endif // #if ( ( CONFIG_FREERTOS_SMP ) && ( !CONFIG_FREERTOS_UNICORE ) )
|
||||
// Can now set the priority back to the normal one
|
||||
prvTaskPriorityRestore(&SavedPriority);
|
||||
// This is guaranteed to run on CPU <cpuid> because the other CPU is now
|
||||
@ -248,12 +248,12 @@ void IRAM_ATTR spi_flash_enable_interrupts_caches_and_other_cpu(void)
|
||||
// But esp_intr_noniram_enable has to be called on the same CPU which
|
||||
// called esp_intr_noniram_disable
|
||||
if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED) {
|
||||
#ifdef CONFIG_FREERTOS_SMP
|
||||
#if ( ( CONFIG_FREERTOS_SMP ) && ( !CONFIG_FREERTOS_UNICORE ) )
|
||||
//Note: Scheduler suspension behavior changed in FreeRTOS SMP
|
||||
vTaskPreemptionEnable(NULL);
|
||||
#else
|
||||
xTaskResumeAll();
|
||||
#endif // CONFIG_FREERTOS_SMP
|
||||
#endif // #if ( ( CONFIG_FREERTOS_SMP ) && ( !CONFIG_FREERTOS_UNICORE ) )
|
||||
}
|
||||
// Release API lock
|
||||
spi_flash_op_unlock();
|
||||
@ -290,26 +290,26 @@ void spi_flash_init_lock(void)
|
||||
|
||||
void spi_flash_op_lock(void)
|
||||
{
|
||||
#ifdef CONFIG_FREERTOS_SMP
|
||||
#if ( ( CONFIG_FREERTOS_SMP ) && ( !CONFIG_FREERTOS_UNICORE ) )
|
||||
if (xTaskGetSchedulerState() == taskSCHEDULER_RUNNING) {
|
||||
//Note: Scheduler suspension behavior changed in FreeRTOS SMP
|
||||
vTaskPreemptionDisable(NULL);
|
||||
}
|
||||
#else
|
||||
vTaskSuspendAll();
|
||||
#endif // CONFIG_FREERTOS_SMP
|
||||
#endif // #if ( ( CONFIG_FREERTOS_SMP ) && ( !CONFIG_FREERTOS_UNICORE ) )
|
||||
}
|
||||
|
||||
void spi_flash_op_unlock(void)
|
||||
{
|
||||
#ifdef CONFIG_FREERTOS_SMP
|
||||
#if ( ( CONFIG_FREERTOS_SMP ) && ( !CONFIG_FREERTOS_UNICORE ) )
|
||||
if (xTaskGetSchedulerState() == taskSCHEDULER_RUNNING) {
|
||||
//Note: Scheduler suspension behavior changed in FreeRTOS SMP
|
||||
vTaskPreemptionEnable(NULL);
|
||||
}
|
||||
#else
|
||||
xTaskResumeAll();
|
||||
#endif // CONFIG_FREERTOS_SMP
|
||||
#endif // #if ( ( CONFIG_FREERTOS_SMP ) && ( !CONFIG_FREERTOS_UNICORE ) )
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user