FreeRTOSConfig.h

#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H

#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__)
    #include 
    #include "mxconstants.h" 
    extern uint32_t SystemCoreClock;
#endif

/*配置为1使用抢占式内核,配置为0使用时间片*/
#define configUSE_PREEMPTION                     1
/*配置为1使用空闲钩子,配置为0不使用*/
#define configUSE_IDLE_HOOK                      0
/*配置为1使用时间片钩子,配置为0不使用*/
#define configUSE_TICK_HOOK                      0
/*CPU系统时钟,CPU执行的频率*/
#define configCPU_CLOCK_HZ                       ( SystemCoreClock )     
/*1000表示RTOS一秒钟可以切换1000次任务,相当于每个时间片1ms*/
#define configTICK_RATE_HZ                       ((TickType_t)1000)  
/*应用程序任务中可用优先级数目*/       
#define configMAX_PRIORITIES                     ( 7 )
/*最小空闲堆栈*/
#define configMINIMAL_STACK_SIZE                 ((uint16_t)128)
/*内核可使用RAM大小*/
#define configTOTAL_HEAP_SIZE                    ((size_t)3072)
/*任务名称最大的长度,这个长度以字节为单位,包括最后的NULL结束字节*/
#define configMAX_TASK_NAME_LEN                  ( 16 )
/*设为1开启TRACE功能,设为0不使用,开启TRACE功能后,RAM占用量会增大--慎用*/
#define configUSE_TRACE_FACILITY                 1
/*设为1 portTickType 将被定义为无符号的16位整形类型,设为0,portTickType则定义为无符号的32位整型*/
#define configUSE_16_BIT_TICKS                   0
/*设为1 则程序中会包含mutex相关的代码,设为0则忽略相关代码*/
#define configUSE_MUTEXES                        1
/*队列注册表有两个作用,但都依赖于调试器的支持:1.给队列命名,调试时便于识别所在队列;2. 包含调试器需要的特定星系用来定位队列和信号量,如果调试器没有这两个功能,这个功能就没有用,还占RAM*/
#define configQUEUE_REGISTRY_SIZE                8

/* 设置为1,包含Co-routine definitions功能,编译时需包含croutine.c文件. */
#define configUSE_CO_ROUTINES                    0
/* Co-routine definitions功能可以使用的优先级数量*/
#define configMAX_CO_ROUTINE_PRIORITIES          ( 2 )

/* 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             0
#define INCLUDE_vTaskDelay                  1
#define INCLUDE_xTaskGetSchedulerState      1

/* Cortex-M specific definitions. */
#ifdef __NVIC_PRIO_BITS
 /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
 #define configPRIO_BITS         __NVIC_PRIO_BITS
#else
 #define configPRIO_BITS         4
#endif

/* The lowest interrupt priority that can be used in a call to a "set priority"
function. */
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY   15

/* 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.  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. */
/* USER CODE BEGIN 1 */   
#define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); for( ;; );} 
/* USER CODE END 1 */

/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
standard names. */
#define vPortSVCHandler    SVC_Handler
#define xPortPendSVHandler PendSV_Handler

/* IMPORTANT: This define MUST be commented when used with STM32Cube firmware, 
              to prevent overwriting SysTick_Handler defined within STM32Cube HAL */
/* #define xPortSysTickHandler SysTick_Handler */

/* USER CODE BEGIN Defines */             
/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */
/* USER CODE END Defines */ 

#endif /* FREERTOS_CONFIG_H */

你可能感兴趣的:(FreeRTOSConfig.h)