fix freertos kernel compatibility
This commit is contained in:
+70
-74
@@ -13,92 +13,88 @@
|
||||
* See http://www.freertos.org/a00110.html.
|
||||
*----------------------------------------------------------*/
|
||||
|
||||
#define configUSE_PREEMPTION 1
|
||||
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
|
||||
#define configUSE_IDLE_HOOK 0
|
||||
#define configUSE_TICK_HOOK 0
|
||||
#define configCPU_CLOCK_HZ ((unsigned long)150000000) // RP2350 default clock is 150 MHz
|
||||
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
|
||||
#define configMAX_PRIORITIES 5
|
||||
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 256 )
|
||||
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 16 * 1024 ) )
|
||||
#define configMAX_TASK_NAME_LEN ( 16 )
|
||||
#define configUSE_TRACE_FACILITIES 0
|
||||
#define configUSE_16_BIT_TICKS 0
|
||||
#define configIDLE_SHOULD_YIELD 1
|
||||
#define configUSE_MUTEXES 1
|
||||
#define configQUEUE_REGISTRY_SIZE 8
|
||||
#define configCHECK_FOR_STACK_OVERFLOW 2
|
||||
#define configUSE_RECURSIVE_MUTEXES 1
|
||||
#define configUSE_MALLOC_FAILED_HOOK 0
|
||||
#define configUSE_APPLICATION_TASK_TAG 0
|
||||
#define configUSE_COUNTING_SEMAPHORES 1
|
||||
#define configGENERATE_RUN_TIME_STATS 0
|
||||
// Scheduler Configuration
|
||||
#define configUSE_PREEMPTION 1 // 1: Preemptive scheduler, 0: Cooperative scheduler
|
||||
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0 // Use optimized task selection if available
|
||||
#define configUSE_IDLE_HOOK 0 // 1: Use Idle hook function
|
||||
#define configUSE_TICK_HOOK 0 // 1: Use Tick hook function
|
||||
#define configIDLE_SHOULD_YIELD 1 // 1: Idle task yields to same priority tasks
|
||||
|
||||
#define configSUPPORT_DYNAMIC_ALLOCATION 1
|
||||
// System Clock Configuration
|
||||
#define configCPU_CLOCK_HZ ((unsigned long)150000000) // CPU frequency: 150 MHz for RP2350
|
||||
#define configTICK_RATE_HZ ((TickType_t)1000) // RTOS tick frequency (1000 Hz = 1ms tick)
|
||||
|
||||
#define configENABLE_FPU 0
|
||||
#define configENABLE_TRUSTZONE 0
|
||||
// Task Configuration
|
||||
#define configMAX_PRIORITIES 5 // Maximum number of priority levels
|
||||
#define configMINIMAL_STACK_SIZE ((unsigned short)256) // Minimum stack size in words
|
||||
#define configMAX_TASK_NAME_LEN (16) // Maximum length of task names
|
||||
|
||||
/* Co-routine definitions. */
|
||||
#define configUSE_CO_ROUTINES 0
|
||||
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
|
||||
// Memory Configuration
|
||||
#define configTOTAL_HEAP_SIZE ((size_t)(16 * 1024)) // Total RTOS heap size (16 KB)
|
||||
#define configSUPPORT_DYNAMIC_ALLOCATION 1 // 1: Enable dynamic memory allocation
|
||||
|
||||
/* Software timer definitions. */
|
||||
#define configUSE_TIMERS 1
|
||||
#define configTIMER_TASK_PRIORITY ( 2 )
|
||||
#define configTIMER_QUEUE_LENGTH 10
|
||||
#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 )
|
||||
// Synchronization Primitives
|
||||
#define configUSE_MUTEXES 1 // 1: Enable mutexes
|
||||
#define configUSE_RECURSIVE_MUTEXES 1 // 1: Enable recursive mutexes
|
||||
#define configUSE_COUNTING_SEMAPHORES 1 // 1: Enable counting semaphores
|
||||
#define configQUEUE_REGISTRY_SIZE 8 // Number of queues/semaphores that can be registered
|
||||
|
||||
#define configENABLE_MPU 0
|
||||
// Debugging and Diagnostics
|
||||
#define configUSE_TRACE_FACILITIES 0 // 1: Enable trace/debug facilities
|
||||
#define configCHECK_FOR_STACK_OVERFLOW 2 // Stack overflow checking method (0=off, 1=method1, 2=method2)
|
||||
#define configUSE_MALLOC_FAILED_HOOK 0 // 1: Use memory allocation failure hook
|
||||
#define configUSE_APPLICATION_TASK_TAG 0 // 1: Enable task tagging
|
||||
#define configGENERATE_RUN_TIME_STATS 0 // 1: Generate run-time statistics
|
||||
|
||||
/* Set the following definitions to 1 to include the API function, or zero
|
||||
to exclude the API function. */
|
||||
#define INCLUDE_vTaskPrioritySet 1
|
||||
#define INCLUDE_uxTaskPriorityGet 1
|
||||
#define INCLUDE_vTaskDelete 1
|
||||
#define INCLUDE_vTaskCleanUpResources 0
|
||||
#define INCLUDE_vTaskSuspend 1
|
||||
#define INCLUDE_vTaskDelayUntil 1
|
||||
#define INCLUDE_vTaskDelay 1
|
||||
#define INCLUDE_xTaskGetSchedulerState 1
|
||||
#define INCLUDE_xTaskGetCurrentTaskHandle 1
|
||||
#define INCLUDE_uxTaskGetStackHighWaterMark 0
|
||||
#define INCLUDE_xTaskGetIdleTaskHandle 0
|
||||
#define INCLUDE_eTaskGetState 0
|
||||
#define INCLUDE_xSemaphoreGetMutexHolder 0
|
||||
#define INCLUDE_xTimerPendFunctionCall 1
|
||||
#define INCLUDE_xQueueGetMutexHolder 0
|
||||
#define INCLUDE_xEventGroupSetBitFromISR 1
|
||||
#define INCLUDE_xTimerPendFunctionCall 1
|
||||
// Timer Configuration
|
||||
#define configUSE_TIMERS 1 // 1: Enable software timers
|
||||
#define configTIMER_TASK_PRIORITY (2) // Timer service task priority
|
||||
#define configTIMER_QUEUE_LENGTH 10 // Timer command queue length
|
||||
#define configTIMER_TASK_STACK_DEPTH (configMINIMAL_STACK_SIZE * 2) // Timer task stack size
|
||||
|
||||
/* Cortex-M specific definitions. */
|
||||
// Co-routine Configuration
|
||||
#define configUSE_CO_ROUTINES 0 // 1: Enable co-routines
|
||||
#define configMAX_CO_ROUTINE_PRIORITIES (2) // Maximum co-routine priorities
|
||||
|
||||
// Hardware Specific Configuration
|
||||
#define configENABLE_FPU 1 // 1: Enable Floating Point Unit
|
||||
#define configENABLE_TRUSTZONE 0 // 1: Enable TrustZone
|
||||
#define configENABLE_MPU 0 // 1: Enable Memory Protection Unit (defined twice in original)
|
||||
#define configRUN_FREERTOS_SECURE_ONLY 1 // 1: Run in secure mode only
|
||||
#define configUSE_16_BIT_TICKS 0 // 0: Use 32-bit ticks, 1: Use 16-bit ticks
|
||||
|
||||
// API Inclusion Configuration
|
||||
#define INCLUDE_vTaskPrioritySet 1 // Include task priority set API
|
||||
#define INCLUDE_uxTaskPriorityGet 1 // Include task priority get API
|
||||
#define INCLUDE_vTaskDelete 1 // Include task delete API
|
||||
#define INCLUDE_vTaskCleanUpResources 0 // Include task cleanup API
|
||||
#define INCLUDE_vTaskSuspend 1 // Include task suspend API
|
||||
#define INCLUDE_vTaskDelayUntil 1 // Include delay until API
|
||||
#define INCLUDE_vTaskDelay 1 // Include delay API
|
||||
#define INCLUDE_xTaskGetSchedulerState 1 // Include scheduler state API
|
||||
#define INCLUDE_xTaskGetCurrentTaskHandle 1 // Include current task handle API
|
||||
#define INCLUDE_uxTaskGetStackHighWaterMark 0 // Include stack high water mark API
|
||||
#define INCLUDE_xTaskGetIdleTaskHandle 0 // Include idle task handle API
|
||||
#define INCLUDE_eTaskGetState 0 // Include task state API
|
||||
#define INCLUDE_xSemaphoreGetMutexHolder 0 // Include mutex holder API
|
||||
#define INCLUDE_xTimerPendFunctionCall 1 // Include timer pend function call API (defined twice in original)
|
||||
#define INCLUDE_xQueueGetMutexHolder 0 // Include queue mutex holder API
|
||||
#define INCLUDE_xEventGroupSetBitFromISR 1 // Include event group set bit from ISR API
|
||||
|
||||
// Cortex-M Interrupt Configuration
|
||||
#ifdef __NVIC_PRIO_BITS
|
||||
/* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
|
||||
#define configPRIO_BITS __NVIC_PRIO_BITS
|
||||
#define configPRIO_BITS __NVIC_PRIO_BITS // Use CMSIS defined priority bits
|
||||
#else
|
||||
#define configPRIO_BITS 3 /* 7 priority levels */
|
||||
#define configPRIO_BITS 3 // 7 priority levels (default)
|
||||
#endif
|
||||
|
||||
/* The lowest interrupt priority that can be used in a call to a "set priority"
|
||||
function. */
|
||||
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0x7
|
||||
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0x7 // Lowest interrupt priority
|
||||
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 // Highest priority for FreeRTOS API calls
|
||||
|
||||
/* The highest interrupt priority that can be used by any interrupt service
|
||||
routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
|
||||
INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
|
||||
PRIORITY THAN THIS! (higher priorities are lower numeric values. */
|
||||
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5
|
||||
#define configKERNEL_INTERRUPT_PRIORITY (configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS))
|
||||
#define configMAX_SYSCALL_INTERRUPT_PRIORITY (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS))
|
||||
|
||||
/* Interrupt priorities used by the kernel port layer itself. These are generic
|
||||
to all Cortex-M ports, and do not rely on any particular library functions. */
|
||||
#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
|
||||
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
|
||||
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
|
||||
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
|
||||
|
||||
/* Normal assert() semantics without relying on the provision of an assert.h
|
||||
header file. */
|
||||
#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
|
||||
// Assertion Definition
|
||||
#define configASSERT(x) if((x) == 0) { taskDISABLE_INTERRUPTS(); for(;;); } // Basic assert implementation
|
||||
|
||||
#endif /* FREERTOS_CONFIG_H */
|
||||
Reference in New Issue
Block a user