freertos: Refactor configuration files

This commit refactors the FreeRTOS configuration headers as follows:

- Layout is now similar to FreeRTOSConfig.h found in other upstream demos
- Separate out Vanilla FreeRTOS configurations and ESP-IDF additions
- Move/remove some irrelevant/unused macros and configurations
This commit is contained in:
Darian Leung
2022-02-08 16:38:09 +08:00
parent 51bfd280f8
commit 2cebfcf885
10 changed files with 314 additions and 273 deletions

View File

@@ -7,32 +7,25 @@
#ifndef FREERTOS_CONFIG_RISCV_H
#define FREERTOS_CONFIG_RISCV_H
// This file is included in the common FreeRTOSConfig.h.
//RISC-V Archiecture specific configuration. This file is included in the common FreeRTOSConfig.h.
#include "sdkconfig.h"
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
/* ------------------------------------------------- FreeRTOS Config ---------------------------------------------------
* - All Vanilla FreeRTOS configuration goes into this section
* ------------------------------------------------------------------------------------------------------------------ */
#ifndef __ASSEMBLER__
#include "esp_rom_sys.h"
#endif // __ASSEMBLER__
// ------------------ Scheduler Related --------------------
/* The maximum interrupt priority from which FreeRTOS.org API functions can
be called. Only API functions that end in ...FromISR() can be used within
interrupts. */
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 0
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
#define configMAX_API_CALL_INTERRUPT_PRIORITY 0
/* ------------------------------------------------ ESP-IDF Additions --------------------------------------------------
*
* ------------------------------------------------------------------------------------------------------------------ */
#ifndef configISR_STACK_SIZE
#define configISR_STACK_SIZE (CONFIG_FREERTOS_ISR_STACKSIZE)
#endif
#ifndef __ASSEMBLER__
#if CONFIG_APPTRACE_SV_ENABLE
extern int xPortSwitchFlag;
#define os_task_switch_is_pended(_cpu_) (xPortSwitchFlag)
#else
#define os_task_switch_is_pended(_cpu_) (false)
#endif
#define configISR_STACK_SIZE (CONFIG_FREERTOS_ISR_STACKSIZE)
#endif
#endif // FREERTOS_CONFIG_RISCV_H

View File

@@ -498,7 +498,22 @@ bool xPortcheckValidStackMem(const void *ptr);
#define portVALID_TCB_MEM(ptr) xPortCheckValidTCBMem(ptr)
#define portVALID_STACK_MEM(ptr) xPortcheckValidStackMem(ptr)
// --------------------- App-Trace -------------------------
#if CONFIG_APPTRACE_SV_ENABLE
extern int xPortSwitchFlag;
#define os_task_switch_is_pended(_cpu_) (xPortSwitchFlag)
#else
#define os_task_switch_is_pended(_cpu_) (false)
#endif
// --------------------- Debugging -------------------------
#if CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION
#define UNTESTED_FUNCTION() { esp_rom_printf("Untested FreeRTOS function %s\r\n", __FUNCTION__); configASSERT(false); } while(0)
#else
#define UNTESTED_FUNCTION()
#endif
/* ---------------------------------------------------- Deprecate ------------------------------------------------------
* - Pull in header containing deprecated macros here