188 lines
12 KiB
C
188 lines
12 KiB
C
/*
|
||
FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd.
|
||
All rights reserved
|
||
|
||
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
|
||
|
||
This file is part of the FreeRTOS distribution.
|
||
|
||
FreeRTOS is free software; you can redistribute it and/or modify it under
|
||
the terms of the GNU General Public License (version 2) as published by the
|
||
Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
|
||
|
||
***************************************************************************
|
||
>>! NOTE: The modification to the GPL is included to allow you to !<<
|
||
>>! distribute a combined work that includes FreeRTOS without being !<<
|
||
>>! obliged to provide the source code for proprietary components !<<
|
||
>>! outside of the FreeRTOS kernel. !<<
|
||
***************************************************************************
|
||
|
||
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
|
||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||
FOR A PARTICULAR PURPOSE. Full license text is available on the following
|
||
link: http://www.freertos.org/a00114.html
|
||
|
||
***************************************************************************
|
||
* *
|
||
* FreeRTOS provides completely free yet professionally developed, *
|
||
* robust, strictly quality controlled, supported, and cross *
|
||
* platform software that is more than just the market leader, it *
|
||
* is the industry's de facto standard. *
|
||
* *
|
||
* Help yourself get started quickly while simultaneously helping *
|
||
* to support the FreeRTOS project by purchasing a FreeRTOS *
|
||
* tutorial book, reference manual, or both: *
|
||
* http://www.FreeRTOS.org/Documentation *
|
||
* *
|
||
***************************************************************************
|
||
|
||
http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
|
||
the FAQ page "My application does not run, what could be wrong?". Have you
|
||
defined configASSERT()?
|
||
|
||
http://www.FreeRTOS.org/support - In return for receiving this top quality
|
||
embedded software for free we request you assist our global community by
|
||
participating in the support forum.
|
||
|
||
http://www.FreeRTOS.org/training - Investing in training allows your team to
|
||
be as productive as possible as early as possible. Now you can receive
|
||
FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
|
||
Ltd, and the world's leading authority on the world's leading RTOS.
|
||
|
||
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
|
||
including FreeRTOS+Trace - an indispensable productivity tool, a DOS
|
||
compatible FAT file system, and our tiny thread aware UDP/IP stack.
|
||
|
||
http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
|
||
Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
|
||
|
||
http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
|
||
Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
|
||
licenses offer ticketed support, indemnification and commercial middleware.
|
||
|
||
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
|
||
engineered and independently SIL3 certified version for use in safety and
|
||
mission critical applications that require provable dependability.
|
||
|
||
1 tab == 4 spaces!
|
||
*/
|
||
|
||
|
||
#ifndef FREERTOS_CONFIG_H
|
||
#define FREERTOS_CONFIG_H
|
||
|
||
#include "sys.h"
|
||
#include "usart.h"
|
||
//<2F><><EFBFBD>Բ<EFBFBD>ͬ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ò<EFBFBD>ͬ<EFBFBD><CDAC>stdint.h<>ļ<EFBFBD>
|
||
#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__)
|
||
#include <stdint.h>
|
||
extern uint32_t SystemCoreClock;
|
||
#endif
|
||
|
||
//<2F><><EFBFBD><EFBFBD>
|
||
#define vAssertCalled(char,int) printf("Error:%s,%d\r\n",char,int)
|
||
#define configASSERT(x) if((x)==0) vAssertCalled(__FILE__,__LINE__)
|
||
|
||
/***************************************************************************************************************/
|
||
/* FreeRTOS<4F><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1> */
|
||
/***************************************************************************************************************/
|
||
#define configUSE_PREEMPTION 1 //1ʹ<31><CAB9><EFBFBD><EFBFBD>ռʽ<D5BC>ںˣ<DABA>0ʹ<30><CAB9>Э<EFBFBD><D0AD>
|
||
#define configUSE_TIME_SLICING 1 //1ʹ<31><CAB9>ʱ<EFBFBD><CAB1>Ƭ<EFBFBD><C6AC><EFBFBD><EFBFBD>(Ĭ<><C4AC>ʽʹ<CABD>ܵ<EFBFBD>)
|
||
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 //0:ͨ<>÷<EFBFBD><C3B7><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1<><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ⷽ<EFBFBD><E2B7BD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>Ҫ<EFBFBD><D2AA><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>
|
||
//һ<><D2BB><EFBFBD><EFBFBD>Ӳ<EFBFBD><D3B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EEA3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>õ<EFBFBD>
|
||
//MCUû<55><C3BB><EFBFBD><EFBFBD>ЩӲ<D0A9><D3B2>ָ<EFBFBD><D6B8><EFBFBD>Ļ<EFBFBD><C4BB>˺<EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ0<CEAA><30>
|
||
#define configUSE_TICKLESS_IDLE 0 //1<><31><EFBFBD>õ<C3B5><CDB9><EFBFBD>ticklessģʽ
|
||
#define configUSE_QUEUE_SETS 1 //Ϊ1ʱ<31><CAB1><EFBFBD>ö<EFBFBD><C3B6><EFBFBD>
|
||
#define configCPU_CLOCK_HZ (SystemCoreClock) //CPUƵ<55><C6B5>
|
||
#define configTICK_RATE_HZ (100) //ʱ<>ӽ<EFBFBD><D3BD><EFBFBD>Ƶ<EFBFBD>ʣ<EFBFBD><CAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ100<30><30><EFBFBD><EFBFBD><EFBFBD>ھ<EFBFBD><DABE><EFBFBD>10ms
|
||
#define configMAX_PRIORITIES (32) //<2F><>ʹ<EFBFBD>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȼ<EFBFBD>
|
||
#define configMINIMAL_STACK_SIZE ((unsigned short)130) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>õĶ<C3B5>ջ<EFBFBD><D5BB>С<EFBFBD><D0A1>130*4=520bytes<65><73> 130<33><30>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>ջ<EFBFBD>ռ<EFBFBD><D5BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>120bytes
|
||
#define configMAX_TASK_NAME_LEN (16) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
|
||
#define configUSE_16_BIT_TICKS 0 //ϵͳ<CFB5><CDB3><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD> 0<><30>ʾ32λ 1<><31>ʾ16λ
|
||
//1<><31>ʾΪ16λ<36><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Σ<EFBFBD>0<EFBFBD><30>ʾΪ32λ<32><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
#define configIDLE_SHOULD_YIELD 1 //Ϊ1ʱ<31><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>CPUʹ<55><CAB9>Ȩ<EFBFBD><C8A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD>ȼ<EFBFBD><C8BC><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>
|
||
#define configUSE_TASK_NOTIFICATIONS 1 //Ϊ1ʱ<31><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֪ͨ<CDA8><D6AA><EFBFBD>ܣ<EFBFBD>Ĭ<EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD>
|
||
#define configUSE_MUTEXES 1 //Ϊ1ʱʹ<CAB1>û<EFBFBD><C3BB><EFBFBD><EFBFBD>ź<EFBFBD><C5BA><EFBFBD>
|
||
#define configQUEUE_REGISTRY_SIZE 8 //<2F><>Ϊ0ʱ<30><CAB1>ʾ<EFBFBD><CABE><EFBFBD>ö<EFBFBD><C3B6>м<EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD>ǿ<EFBFBD><C7BF><EFBFBD>
|
||
//<2F><>¼<EFBFBD>Ķ<EFBFBD><C4B6>к<EFBFBD><D0BA>ź<EFBFBD><C5BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF>
|
||
#define configCHECK_FOR_STACK_OVERFLOW 0 //<2F><><EFBFBD><EFBFBD>0ʱ<30><CAB1><EFBFBD>ö<EFBFBD>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ô˹<C3B4><CBB9><EFBFBD>
|
||
//<2F>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ṩһ<E1B9A9><D2BB>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӻ<EFBFBD><D3BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>õĻ<C3B5>
|
||
//<2F><>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>Ϊ1<CEAA><31><EFBFBD><EFBFBD>2<EFBFBD><32><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ⷽ<EFBFBD><E2B7BD><EFBFBD><EFBFBD>
|
||
#define configUSE_RECURSIVE_MUTEXES 1 //Ϊ1ʱʹ<CAB1>õݹ黥<DDB9><E9BBA5><EFBFBD>ź<EFBFBD><C5BA><EFBFBD>
|
||
#define configUSE_MALLOC_FAILED_HOOK 0 //1ʹ<31><CAB9><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܹ<EFBFBD><DCB9>Ӻ<EFBFBD><D3BA><EFBFBD>
|
||
#define configUSE_APPLICATION_TASK_TAG 0
|
||
#define configUSE_COUNTING_SEMAPHORES 1 //Ϊ1ʱʹ<CAB1>ü<EFBFBD><C3BC><EFBFBD><EFBFBD>ź<EFBFBD><C5BA><EFBFBD>
|
||
|
||
/***************************************************************************************************************/
|
||
/* FreeRTOS<4F><53><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1> */
|
||
/***************************************************************************************************************/
|
||
#define configSUPPORT_DYNAMIC_ALLOCATION 1 //֧<>ֶ<EFBFBD>̬<EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD><EFBFBD>
|
||
#define configTOTAL_HEAP_SIZE ((size_t)(22*1024)) //ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD>ܵĶѴ<C4B6>С20k
|
||
|
||
/***************************************************************************************************************/
|
||
/* FreeRTOS<4F>빳<EFBFBD>Ӻ<EFBFBD><D3BA><EFBFBD><EFBFBD>йص<D0B9><D8B5><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1> */
|
||
/***************************************************************************************************************/
|
||
#define configUSE_IDLE_HOOK 0 //1<><31>ʹ<EFBFBD>ÿ<EFBFBD><C3BF>й<EFBFBD><D0B9>ӣ<EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>
|
||
#define configUSE_TICK_HOOK 0 //1<><31>ʹ<EFBFBD><CAB9>ʱ<EFBFBD><CAB1>Ƭ<EFBFBD><C6AC><EFBFBD>ӣ<EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>
|
||
|
||
/***************************************************************************************************************/
|
||
/* FreeRTOS<4F><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<D7B4>ռ<EFBFBD><D5BC>йص<D0B9><D8B5><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1> */
|
||
/***************************************************************************************************************/
|
||
#define configGENERATE_RUN_TIME_STATS 0 //Ϊ1ʱ<31><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>ͳ<EFBFBD>ƹ<EFBFBD><C6B9><EFBFBD>
|
||
#define configUSE_TRACE_FACILITY 1 //Ϊ1<CEAA><31><EFBFBD>ÿ<EFBFBD><C3BF>ӻ<EFBFBD><D3BB><EFBFBD><EFBFBD>ٵ<EFBFBD><D9B5><EFBFBD>
|
||
#define configUSE_STATS_FORMATTING_FUNCTIONS 1 //<2F><><EFBFBD><EFBFBD>configUSE_TRACE_FACILITYͬʱΪ1ʱ<31><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>3<EFBFBD><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
//prvWriteNameToBuffer(),vTaskList(),
|
||
//vTaskGetRunTimeStats()
|
||
|
||
/***************************************************************************************************************/
|
||
/* FreeRTOS<4F><53>Э<EFBFBD><D0AD><EFBFBD>йص<D0B9><D8B5><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1> */
|
||
/***************************************************************************************************************/
|
||
#define configUSE_CO_ROUTINES 0 //Ϊ1ʱ<31><CAB1><EFBFBD><EFBFBD>Э<EFBFBD>̣<EFBFBD><CCA3><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD><D0AD><EFBFBD>Ժ<EFBFBD><D4BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>croutine.c
|
||
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) //Э<>̵<EFBFBD><CCB5><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD>ȼ<EFBFBD><C8BC><EFBFBD>Ŀ
|
||
|
||
/***************************************************************************************************************/
|
||
/* FreeRTOS<4F><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>йص<D0B9><D8B5><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1> */
|
||
/***************************************************************************************************************/
|
||
#define configUSE_TIMERS 1 //Ϊ1ʱ<31><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
|
||
#define configTIMER_TASK_PRIORITY (configMAX_PRIORITIES-1) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>ȼ<EFBFBD>
|
||
#define configTIMER_QUEUE_LENGTH 5 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>г<EFBFBD><D0B3><EFBFBD>
|
||
#define configTIMER_TASK_STACK_DEPTH (configMINIMAL_STACK_SIZE*2) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ջ<EFBFBD><D5BB>С
|
||
|
||
/***************************************************************************************************************/
|
||
/* FreeRTOS<4F><53>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1> */
|
||
/***************************************************************************************************************/
|
||
#define INCLUDE_xTaskGetSchedulerState 1
|
||
#define INCLUDE_vTaskPrioritySet 1
|
||
#define INCLUDE_uxTaskPriorityGet 1
|
||
#define INCLUDE_vTaskDelete 1
|
||
#define INCLUDE_vTaskCleanUpResources 1
|
||
#define INCLUDE_vTaskSuspend 1
|
||
#define INCLUDE_vTaskDelayUntil 1
|
||
#define INCLUDE_vTaskDelay 1
|
||
#define INCLUDE_eTaskGetState 1
|
||
#define INCLUDE_xTimerPendFunctionCall 1
|
||
|
||
/***************************************************************************************************************/
|
||
/* FreeRTOS<4F><53><EFBFBD>ж<EFBFBD><D0B6>йص<D0B9><D8B5><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1> */
|
||
/***************************************************************************************************************/
|
||
#ifdef __NVIC_PRIO_BITS
|
||
#define configPRIO_BITS __NVIC_PRIO_BITS
|
||
#else
|
||
#define configPRIO_BITS 4
|
||
#endif
|
||
|
||
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15 //<2F>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȼ<EFBFBD>
|
||
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 //ϵͳ<CFB5>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><D0B6><EFBFBD><EFBFBD>ȼ<EFBFBD>
|
||
#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) //0XF0
|
||
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
|
||
|
||
/***************************************************************************************************************/
|
||
/* FreeRTOS<4F><53><EFBFBD>жϷ<D0B6><CFB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>йص<D0B9><D8B5><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1> */
|
||
/***************************************************************************************************************/
|
||
#define xPortPendSVHandler PendSV_Handler
|
||
#define vPortSVCHandler SVC_Handler
|
||
|
||
#endif /* FREERTOS_CONFIG_H */
|
||
|