Francisco Paez / freertos

Dependents:   frdm_k64f_freertos_lib

Committer:
fep
Date:
Wed May 31 02:27:10 2017 +0000
Revision:
0:62cd296ba2a7
FreeRTOS v9.0.0 for Cortex-M4F (FRDM-K64F and others...)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
fep 0:62cd296ba2a7 1 /*
fep 0:62cd296ba2a7 2 FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd.
fep 0:62cd296ba2a7 3 All rights reserved
fep 0:62cd296ba2a7 4
fep 0:62cd296ba2a7 5 VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
fep 0:62cd296ba2a7 6
fep 0:62cd296ba2a7 7 This file is part of the FreeRTOS distribution.
fep 0:62cd296ba2a7 8
fep 0:62cd296ba2a7 9 FreeRTOS is free software; you can redistribute it and/or modify it under
fep 0:62cd296ba2a7 10 the terms of the GNU General Public License (version 2) as published by the
fep 0:62cd296ba2a7 11 Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
fep 0:62cd296ba2a7 12
fep 0:62cd296ba2a7 13 ***************************************************************************
fep 0:62cd296ba2a7 14 >>! NOTE: The modification to the GPL is included to allow you to !<<
fep 0:62cd296ba2a7 15 >>! distribute a combined work that includes FreeRTOS without being !<<
fep 0:62cd296ba2a7 16 >>! obliged to provide the source code for proprietary components !<<
fep 0:62cd296ba2a7 17 >>! outside of the FreeRTOS kernel. !<<
fep 0:62cd296ba2a7 18 ***************************************************************************
fep 0:62cd296ba2a7 19
fep 0:62cd296ba2a7 20 FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
fep 0:62cd296ba2a7 21 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
fep 0:62cd296ba2a7 22 FOR A PARTICULAR PURPOSE. Full license text is available on the following
fep 0:62cd296ba2a7 23 link: http://www.freertos.org/a00114.html
fep 0:62cd296ba2a7 24
fep 0:62cd296ba2a7 25 ***************************************************************************
fep 0:62cd296ba2a7 26 * *
fep 0:62cd296ba2a7 27 * FreeRTOS provides completely free yet professionally developed, *
fep 0:62cd296ba2a7 28 * robust, strictly quality controlled, supported, and cross *
fep 0:62cd296ba2a7 29 * platform software that is more than just the market leader, it *
fep 0:62cd296ba2a7 30 * is the industry's de facto standard. *
fep 0:62cd296ba2a7 31 * *
fep 0:62cd296ba2a7 32 * Help yourself get started quickly while simultaneously helping *
fep 0:62cd296ba2a7 33 * to support the FreeRTOS project by purchasing a FreeRTOS *
fep 0:62cd296ba2a7 34 * tutorial book, reference manual, or both: *
fep 0:62cd296ba2a7 35 * http://www.FreeRTOS.org/Documentation *
fep 0:62cd296ba2a7 36 * *
fep 0:62cd296ba2a7 37 ***************************************************************************
fep 0:62cd296ba2a7 38
fep 0:62cd296ba2a7 39 http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
fep 0:62cd296ba2a7 40 the FAQ page "My application does not run, what could be wrong?". Have you
fep 0:62cd296ba2a7 41 defined configASSERT()?
fep 0:62cd296ba2a7 42
fep 0:62cd296ba2a7 43 http://www.FreeRTOS.org/support - In return for receiving this top quality
fep 0:62cd296ba2a7 44 embedded software for free we request you assist our global community by
fep 0:62cd296ba2a7 45 participating in the support forum.
fep 0:62cd296ba2a7 46
fep 0:62cd296ba2a7 47 http://www.FreeRTOS.org/training - Investing in training allows your team to
fep 0:62cd296ba2a7 48 be as productive as possible as early as possible. Now you can receive
fep 0:62cd296ba2a7 49 FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
fep 0:62cd296ba2a7 50 Ltd, and the world's leading authority on the world's leading RTOS.
fep 0:62cd296ba2a7 51
fep 0:62cd296ba2a7 52 http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
fep 0:62cd296ba2a7 53 including FreeRTOS+Trace - an indispensable productivity tool, a DOS
fep 0:62cd296ba2a7 54 compatible FAT file system, and our tiny thread aware UDP/IP stack.
fep 0:62cd296ba2a7 55
fep 0:62cd296ba2a7 56 http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
fep 0:62cd296ba2a7 57 Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
fep 0:62cd296ba2a7 58
fep 0:62cd296ba2a7 59 http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
fep 0:62cd296ba2a7 60 Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
fep 0:62cd296ba2a7 61 licenses offer ticketed support, indemnification and commercial middleware.
fep 0:62cd296ba2a7 62
fep 0:62cd296ba2a7 63 http://www.SafeRTOS.com - High Integrity Systems also provide a safety
fep 0:62cd296ba2a7 64 engineered and independently SIL3 certified version for use in safety and
fep 0:62cd296ba2a7 65 mission critical applications that require provable dependability.
fep 0:62cd296ba2a7 66
fep 0:62cd296ba2a7 67 1 tab == 4 spaces!
fep 0:62cd296ba2a7 68 */
fep 0:62cd296ba2a7 69
fep 0:62cd296ba2a7 70
fep 0:62cd296ba2a7 71 #ifndef FREERTOS_CONFIG_H
fep 0:62cd296ba2a7 72 #define FREERTOS_CONFIG_H
fep 0:62cd296ba2a7 73
fep 0:62cd296ba2a7 74 /*-----------------------------------------------------------
fep 0:62cd296ba2a7 75 * Application specific definitions.
fep 0:62cd296ba2a7 76 *
fep 0:62cd296ba2a7 77 * These definitions should be adjusted for your particular hardware and
fep 0:62cd296ba2a7 78 * application requirements.
fep 0:62cd296ba2a7 79 *
fep 0:62cd296ba2a7 80 * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
fep 0:62cd296ba2a7 81 * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
fep 0:62cd296ba2a7 82 *
fep 0:62cd296ba2a7 83 * See http://www.freertos.org/a00110.html.
fep 0:62cd296ba2a7 84 *----------------------------------------------------------*/
fep 0:62cd296ba2a7 85
fep 0:62cd296ba2a7 86 #include <stdint.h>
fep 0:62cd296ba2a7 87 extern uint32_t SystemCoreClock;
fep 0:62cd296ba2a7 88
fep 0:62cd296ba2a7 89 #define configUSE_PREEMPTION 1
fep 0:62cd296ba2a7 90 #define configUSE_IDLE_HOOK 0
fep 0:62cd296ba2a7 91 #define configUSE_TICK_HOOK 0
fep 0:62cd296ba2a7 92 #define configCPU_CLOCK_HZ ( SystemCoreClock )
fep 0:62cd296ba2a7 93 #define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
fep 0:62cd296ba2a7 94 #define configMAX_PRIORITIES ( 5 )
fep 0:62cd296ba2a7 95 #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 130 )
fep 0:62cd296ba2a7 96 #define configTOTAL_HEAP_SIZE ( ( size_t ) ( 16 * 1024 ) )
fep 0:62cd296ba2a7 97 #define configMAX_TASK_NAME_LEN ( 10 )
fep 0:62cd296ba2a7 98 #define configUSE_TRACE_FACILITY 0
fep 0:62cd296ba2a7 99 #define configUSE_16_BIT_TICKS 0
fep 0:62cd296ba2a7 100 #define configIDLE_SHOULD_YIELD 1
fep 0:62cd296ba2a7 101 #define configUSE_MUTEXES 1
fep 0:62cd296ba2a7 102 #define configQUEUE_REGISTRY_SIZE 0
fep 0:62cd296ba2a7 103 #define configCHECK_FOR_STACK_OVERFLOW 2
fep 0:62cd296ba2a7 104 #define configUSE_RECURSIVE_MUTEXES 1
fep 0:62cd296ba2a7 105 #define configUSE_MALLOC_FAILED_HOOK 1
fep 0:62cd296ba2a7 106 #define configUSE_APPLICATION_TASK_TAG 0
fep 0:62cd296ba2a7 107 #define configUSE_COUNTING_SEMAPHORES 1
fep 0:62cd296ba2a7 108 #define configGENERATE_RUN_TIME_STATS 0
fep 0:62cd296ba2a7 109
fep 0:62cd296ba2a7 110 /* Co-routine definitions. */
fep 0:62cd296ba2a7 111 #define configUSE_CO_ROUTINES 0
fep 0:62cd296ba2a7 112 #define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
fep 0:62cd296ba2a7 113
fep 0:62cd296ba2a7 114 /* Software timer definitions. */
fep 0:62cd296ba2a7 115 #define configUSE_TIMERS 1
fep 0:62cd296ba2a7 116 #define configTIMER_TASK_PRIORITY ( 2 )
fep 0:62cd296ba2a7 117 #define configTIMER_QUEUE_LENGTH 5
fep 0:62cd296ba2a7 118 #define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 )
fep 0:62cd296ba2a7 119
fep 0:62cd296ba2a7 120 /* Set the following definitions to 1 to include the API function, or zero
fep 0:62cd296ba2a7 121 to exclude the API function. */
fep 0:62cd296ba2a7 122 #define INCLUDE_vTaskPrioritySet 1
fep 0:62cd296ba2a7 123 #define INCLUDE_uxTaskPriorityGet 1
fep 0:62cd296ba2a7 124 #define INCLUDE_vTaskDelete 1
fep 0:62cd296ba2a7 125 #define INCLUDE_vTaskCleanUpResources 1
fep 0:62cd296ba2a7 126 #define INCLUDE_vTaskSuspend 1
fep 0:62cd296ba2a7 127 #define INCLUDE_vTaskDelayUntil 1
fep 0:62cd296ba2a7 128 #define INCLUDE_vTaskDelay 1
fep 0:62cd296ba2a7 129
fep 0:62cd296ba2a7 130 /* Cortex-M specific definitions. */
fep 0:62cd296ba2a7 131 #ifdef __NVIC_PRIO_BITS
fep 0:62cd296ba2a7 132 /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
fep 0:62cd296ba2a7 133 #define configPRIO_BITS __NVIC_PRIO_BITS
fep 0:62cd296ba2a7 134 #else
fep 0:62cd296ba2a7 135 #define configPRIO_BITS 4 /* 15 priority levels */
fep 0:62cd296ba2a7 136 #endif
fep 0:62cd296ba2a7 137
fep 0:62cd296ba2a7 138 /* The lowest interrupt priority that can be used in a call to a "set priority"
fep 0:62cd296ba2a7 139 function. */
fep 0:62cd296ba2a7 140 #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0x0f
fep 0:62cd296ba2a7 141
fep 0:62cd296ba2a7 142 /* The highest interrupt priority that can be used by any interrupt service
fep 0:62cd296ba2a7 143 routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
fep 0:62cd296ba2a7 144 INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
fep 0:62cd296ba2a7 145 PRIORITY THAN THIS! (higher priorities are lower numeric values. */
fep 0:62cd296ba2a7 146 #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 10
fep 0:62cd296ba2a7 147
fep 0:62cd296ba2a7 148 /* Interrupt priorities used by the kernel port layer itself. These are generic
fep 0:62cd296ba2a7 149 to all Cortex-M ports, and do not rely on any particular library functions. */
fep 0:62cd296ba2a7 150 #define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
fep 0:62cd296ba2a7 151 /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
fep 0:62cd296ba2a7 152 See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
fep 0:62cd296ba2a7 153 #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
fep 0:62cd296ba2a7 154
fep 0:62cd296ba2a7 155 /* Normal assert() semantics without relying on the provision of an assert.h
fep 0:62cd296ba2a7 156 header file. */
fep 0:62cd296ba2a7 157 #define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
fep 0:62cd296ba2a7 158
fep 0:62cd296ba2a7 159 /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
fep 0:62cd296ba2a7 160 standard names. */
fep 0:62cd296ba2a7 161 #define vPortSVCHandler SVC_Handler
fep 0:62cd296ba2a7 162 #define xPortPendSVHandler PendSV_Handler
fep 0:62cd296ba2a7 163 #define xPortSysTickHandler SysTick_Handler
fep 0:62cd296ba2a7 164
fep 0:62cd296ba2a7 165 #endif /* FREERTOS_CONFIG_H */
fep 0:62cd296ba2a7 166
fep 0:62cd296ba2a7 167