#ifndef FREERTOS_CONFIG_H #define FREERTOS_CONFIG_H #include "stdint.h" extern uint32_t SystemCoreClock; #if 1 #define configCPU_CLOCK_HZ ( ( unsigned long ) SystemCoreClock ) #define configTICK_RATE_HZ 1000 #define configUSE_PREEMPTION 1 #define configUSE_TIME_SLICING 1 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 #define configUSE_TICKLESS_IDLE 0 #define configMAX_PRIORITIES 32 #define configMINIMAL_STACK_SIZE 128 #define configMAX_TASK_NAME_LEN 16 #define configTICK_TYPE_WIDTH_IN_BITS TICK_TYPE_WIDTH_32_BITS #define configIDLE_SHOULD_YIELD 1 #define configTASK_NOTIFICATION_ARRAY_ENTRIES 1 #define configQUEUE_REGISTRY_SIZE 0 #define configENABLE_BACKWARD_COMPATIBILITY 1 #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0 #define configUSE_MINI_LIST_ITEM 0 #define configSTACK_DEPTH_TYPE size_t #define configMESSAGE_BUFFER_LENGTH_TYPE size_t //#define configHEAP_CLEAR_MEMORY_ON_FREE 1 //#define configSTATS_BUFFER_MAX_LENGTH 0xFFFF #define configUSE_NEWLIB_REENTRANT 0 #define configUSE_TIMERS 1 #define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) #define configTIMER_TASK_STACK_DEPTH (configMINIMAL_STACK_SIZE *2) #define configTIMER_QUEUE_LENGTH 5 //#define configUSE_EVENT_GROUPS 1 //#define configUSE_STREAM_BUFFERS 1 #define configSUPPORT_STATIC_ALLOCATION 1 #define configSUPPORT_DYNAMIC_ALLOCATION 1 #define configKERNEL_PROVIDED_STATIC_MEMORY 1 #define configTOTAL_HEAP_SIZE ((size_t)(80*1024)) #define configAPPLICATION_ALLOCATED_HEAP 0 #define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP 0 #define configENABLE_HEAP_PROTECTOR 0 #ifdef __NVIC_PRIO_BITS #define configPRIO_BITS __NVIC_PRIO_BITS #else #define configPRIO_BITS 4 #endif #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15 #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) ) #define configMAX_API_CALL_INTERRUPT_PRIORITY configMAX_SYSCALL_INTERRUPT_PRIORITY //#define configUSE_16_BIT_TICKS 0 #define configUSE_IDLE_HOOK 0 #define configUSE_TICK_HOOK 0 #define configUSE_MALLOC_FAILED_HOOK 0 #define configUSE_DAEMON_TASK_STARTUP_HOOK 0 //#define configUSE_SB_COMPLETED_CALLBACK 0 //#define configCHECK_FOR_STACK_OVERFLOW 0 #define configGENERATE_RUN_TIME_STATS 0 #if configGENERATE_RUN_TIME_STATS #include "./BSP/TIMER/btim.h" #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() ConfigureTimeForRunTimeStats() extern uint32_t FreeRTOSRunTimeTicks; #define portGET_RUN_TIME_COUNTER_VALUE() FreeRTOSRunTimeTicks #endif #define configUSE_TRACE_FACILITY 1 #define configUSE_STATS_FORMATTING_FUNCTIONS 1 #define configUSE_CO_ROUTINES 0 #define configMAX_CO_ROUTINE_PRIORITIES 2 #define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000U ) ) #define xPortPendSVHandler PendSV_Handler #define vPortSVCHandler SVC_Handler //#define xPortSysTickHandler SysTick_Handler #define vAssertCalled(char, int) #define configASSERT( x ) //#define configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS 0 #define configTOTAL_MPU_REGIONS 8 //#define configTEX_S_C_B_FLASH 0x07UL //#define configTEX_S_C_B_SRAM 0x07UL #define configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY 0 #define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 0 //#define configUSE_MPU_WRAPPERS_V1 0 //#define configPROTECTED_KERNEL_OBJECT_POOL_SIZE 10 //#define configSYSTEM_CALL_STACK_SIZE 128 //#define configENABLE_ACCESS_CONTROL_LIST 1 //#define configRUN_MULTIPLE_PRIORITIES 0 //#define configUSE_CORE_AFFINITY 0 //#define configTASK_DEFAULT_CORE_AFFINITY tskNO_AFFINITY //#define configUSE_TASK_PREEMPTION_DISABLE 0 //#define configUSE_PASSIVE_IDLE_HOOK 0 //#define configTIMER_SERVICE_TASK_CORE_AFFINITY tskNO_AFFINITY //#define secureconfigMAX_SECURE_CONTEXTS 5 //#define configKERNEL_PROVIDED_STATIC_MEMORY 1 //#define configENABLE_TRUSTZONE 1 //#define configRUN_FREERTOS_SECURE_ONLY 1 #define configENABLE_MPU 0 #define configENABLE_FPU 1 //#define configENABLE_MVE 1 //#define configCHECK_HANDLER_INSTALLATION 1 #define configUSE_TASK_NOTIFICATIONS 1 #define configUSE_MUTEXES 1 #define configUSE_RECURSIVE_MUTEXES 1 #define configUSE_COUNTING_SEMAPHORES 1 #define configUSE_QUEUE_SETS 1 //#define configUSE_APPLICATION_TASK_TAG 0 //#define configUSE_POSIX_ERRNO 0 #define INCLUDE_vTaskPrioritySet 1 #define INCLUDE_uxTaskPriorityGet 1 #define INCLUDE_vTaskDelete 1 #define INCLUDE_vTaskSuspend 1 #define INCLUDE_xTaskDelayUntil 1 #define INCLUDE_vTaskDelay 1 #define INCLUDE_xTaskGetSchedulerState 1 #define INCLUDE_xTaskGetCurrentTaskHandle 1 #define INCLUDE_uxTaskGetStackHighWaterMark 1 #define INCLUDE_xTaskGetIdleTaskHandle 1 #define INCLUDE_eTaskGetState 1 #define INCLUDE_xTimerPendFunctionCall 1 #define INCLUDE_xTaskAbortDelay 1 #define INCLUDE_xTaskGetHandle 1 #define INCLUDE_xTaskResumeFromISR 1 #else #define configUSE_PREEMPTION 1 #define configCPU_CLOCK_HZ ( SystemCoreClock ) #define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) #define configMAX_PRIORITIES ( 15 ) #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 ) #define configTOTAL_HEAP_SIZE ( ( size_t ) ( 15 * 1024 ) ) #define configMAX_TASK_NAME_LEN ( 16 ) #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 #define configUSE_MUTEXES 1 #define configUSE_RECURSIVE_MUTEXES 1 #define configUSE_COUNTING_SEMAPHORES 1 #define configQUEUE_REGISTRY_SIZE 8 #define configUSE_APPLICATION_TASK_TAG 0 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 /* hook function related definitions */ #define configUSE_IDLE_HOOK 0 #define configUSE_TICK_HOOK 0 #define configCHECK_FOR_STACK_OVERFLOW 0 #define configUSE_MALLOC_FAILED_HOOK 0 /* run time and task stats gathering related definitions */ #define configGENERATE_RUN_TIME_STATS 0 #define configUSE_TRACE_FACILITY 1 /* co-routine definitions */ #define configUSE_CO_ROUTINES 0 #define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* 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 ) /* set to 1 to include the API function, or 0 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 /* Cortex-M specific definitions */ #ifdef __NVIC_PRIO_BITS /* __NVIC_PRIO_BITS will be specified when CMSIS is being used. */ #define configPRIO_BITS __NVIC_PRIO_BITS #else #define configPRIO_BITS 4 /* 15 priority levels */ #endif /* the lowest interrupt priority that can be used in a call to a "set priority" function */ #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0xf /* 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 /* interrupt priorities used by the kernel port layer itself */ #define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) /* configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero */ #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( ;; ); } /* map the FreeRTOS port interrupt handlers to CMSIS standard names */ #define vPortSVCHandler SVC_Handler #define xPortPendSVHandler PendSV_Handler //#define xPortSysTickHandler SysTick_Handler #endif #endif /* FREERTOS_CONFIG_H */