www.freertos.org
Dependents: mbed_freeRTOS_send
Fork of FreeRTOS by
Source/portable/RVDS/ARM_CM3/portmacro.h@1:6db425da9b9e, 2016-05-18 (annotated)
- Committer:
- ser1516
- Date:
- Wed May 18 21:25:21 2016 +0000
- Revision:
- 1:6db425da9b9e
- Parent:
- 0:8e57f3e9cc89
queue implementada com accelarometro e pot a enviar para o can - ainda nao testado
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rgrover1 | 0:8e57f3e9cc89 | 1 | /* |
rgrover1 | 0:8e57f3e9cc89 | 2 | FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. |
rgrover1 | 0:8e57f3e9cc89 | 3 | All rights reserved |
rgrover1 | 0:8e57f3e9cc89 | 4 | |
rgrover1 | 0:8e57f3e9cc89 | 5 | VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. |
rgrover1 | 0:8e57f3e9cc89 | 6 | |
rgrover1 | 0:8e57f3e9cc89 | 7 | *************************************************************************** |
rgrover1 | 0:8e57f3e9cc89 | 8 | * * |
rgrover1 | 0:8e57f3e9cc89 | 9 | * FreeRTOS provides completely free yet professionally developed, * |
rgrover1 | 0:8e57f3e9cc89 | 10 | * robust, strictly quality controlled, supported, and cross * |
rgrover1 | 0:8e57f3e9cc89 | 11 | * platform software that has become a de facto standard. * |
rgrover1 | 0:8e57f3e9cc89 | 12 | * * |
rgrover1 | 0:8e57f3e9cc89 | 13 | * Help yourself get started quickly and support the FreeRTOS * |
rgrover1 | 0:8e57f3e9cc89 | 14 | * project by purchasing a FreeRTOS tutorial book, reference * |
rgrover1 | 0:8e57f3e9cc89 | 15 | * manual, or both from: http://www.FreeRTOS.org/Documentation * |
rgrover1 | 0:8e57f3e9cc89 | 16 | * * |
rgrover1 | 0:8e57f3e9cc89 | 17 | * Thank you! * |
rgrover1 | 0:8e57f3e9cc89 | 18 | * * |
rgrover1 | 0:8e57f3e9cc89 | 19 | *************************************************************************** |
rgrover1 | 0:8e57f3e9cc89 | 20 | |
rgrover1 | 0:8e57f3e9cc89 | 21 | This file is part of the FreeRTOS distribution. |
rgrover1 | 0:8e57f3e9cc89 | 22 | |
rgrover1 | 0:8e57f3e9cc89 | 23 | FreeRTOS is free software; you can redistribute it and/or modify it under |
rgrover1 | 0:8e57f3e9cc89 | 24 | the terms of the GNU General Public License (version 2) as published by the |
rgrover1 | 0:8e57f3e9cc89 | 25 | Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. |
rgrover1 | 0:8e57f3e9cc89 | 26 | |
rgrover1 | 0:8e57f3e9cc89 | 27 | >>! NOTE: The modification to the GPL is included to allow you to distribute |
rgrover1 | 0:8e57f3e9cc89 | 28 | >>! a combined work that includes FreeRTOS without being obliged to provide |
rgrover1 | 0:8e57f3e9cc89 | 29 | >>! the source code for proprietary components outside of the FreeRTOS |
rgrover1 | 0:8e57f3e9cc89 | 30 | >>! kernel. |
rgrover1 | 0:8e57f3e9cc89 | 31 | |
rgrover1 | 0:8e57f3e9cc89 | 32 | FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY |
rgrover1 | 0:8e57f3e9cc89 | 33 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
rgrover1 | 0:8e57f3e9cc89 | 34 | FOR A PARTICULAR PURPOSE. Full license text is available from the following |
rgrover1 | 0:8e57f3e9cc89 | 35 | link: http://www.freertos.org/a00114.html |
rgrover1 | 0:8e57f3e9cc89 | 36 | |
rgrover1 | 0:8e57f3e9cc89 | 37 | 1 tab == 4 spaces! |
rgrover1 | 0:8e57f3e9cc89 | 38 | |
rgrover1 | 0:8e57f3e9cc89 | 39 | *************************************************************************** |
rgrover1 | 0:8e57f3e9cc89 | 40 | * * |
rgrover1 | 0:8e57f3e9cc89 | 41 | * Having a problem? Start by reading the FAQ "My application does * |
rgrover1 | 0:8e57f3e9cc89 | 42 | * not run, what could be wrong?" * |
rgrover1 | 0:8e57f3e9cc89 | 43 | * * |
rgrover1 | 0:8e57f3e9cc89 | 44 | * http://www.FreeRTOS.org/FAQHelp.html * |
rgrover1 | 0:8e57f3e9cc89 | 45 | * * |
rgrover1 | 0:8e57f3e9cc89 | 46 | *************************************************************************** |
rgrover1 | 0:8e57f3e9cc89 | 47 | |
rgrover1 | 0:8e57f3e9cc89 | 48 | http://www.FreeRTOS.org - Documentation, books, training, latest versions, |
rgrover1 | 0:8e57f3e9cc89 | 49 | license and Real Time Engineers Ltd. contact details. |
rgrover1 | 0:8e57f3e9cc89 | 50 | |
rgrover1 | 0:8e57f3e9cc89 | 51 | http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, |
rgrover1 | 0:8e57f3e9cc89 | 52 | including FreeRTOS+Trace - an indispensable productivity tool, a DOS |
rgrover1 | 0:8e57f3e9cc89 | 53 | compatible FAT file system, and our tiny thread aware UDP/IP stack. |
rgrover1 | 0:8e57f3e9cc89 | 54 | |
rgrover1 | 0:8e57f3e9cc89 | 55 | http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High |
rgrover1 | 0:8e57f3e9cc89 | 56 | Integrity Systems to sell under the OpenRTOS brand. Low cost OpenRTOS |
rgrover1 | 0:8e57f3e9cc89 | 57 | licenses offer ticketed support, indemnification and middleware. |
rgrover1 | 0:8e57f3e9cc89 | 58 | |
rgrover1 | 0:8e57f3e9cc89 | 59 | http://www.SafeRTOS.com - High Integrity Systems also provide a safety |
rgrover1 | 0:8e57f3e9cc89 | 60 | engineered and independently SIL3 certified version for use in safety and |
rgrover1 | 0:8e57f3e9cc89 | 61 | mission critical applications that require provable dependability. |
rgrover1 | 0:8e57f3e9cc89 | 62 | |
rgrover1 | 0:8e57f3e9cc89 | 63 | 1 tab == 4 spaces! |
rgrover1 | 0:8e57f3e9cc89 | 64 | */ |
rgrover1 | 0:8e57f3e9cc89 | 65 | |
rgrover1 | 0:8e57f3e9cc89 | 66 | |
rgrover1 | 0:8e57f3e9cc89 | 67 | #ifndef PORTMACRO_H |
rgrover1 | 0:8e57f3e9cc89 | 68 | #define PORTMACRO_H |
rgrover1 | 0:8e57f3e9cc89 | 69 | |
rgrover1 | 0:8e57f3e9cc89 | 70 | #ifdef __cplusplus |
rgrover1 | 0:8e57f3e9cc89 | 71 | extern "C" { |
rgrover1 | 0:8e57f3e9cc89 | 72 | #endif |
rgrover1 | 0:8e57f3e9cc89 | 73 | |
rgrover1 | 0:8e57f3e9cc89 | 74 | /*----------------------------------------------------------- |
rgrover1 | 0:8e57f3e9cc89 | 75 | * Port specific definitions. |
rgrover1 | 0:8e57f3e9cc89 | 76 | * |
rgrover1 | 0:8e57f3e9cc89 | 77 | * The settings in this file configure FreeRTOS correctly for the |
rgrover1 | 0:8e57f3e9cc89 | 78 | * given hardware and compiler. |
rgrover1 | 0:8e57f3e9cc89 | 79 | * |
rgrover1 | 0:8e57f3e9cc89 | 80 | * These settings should not be altered. |
rgrover1 | 0:8e57f3e9cc89 | 81 | *----------------------------------------------------------- |
rgrover1 | 0:8e57f3e9cc89 | 82 | */ |
rgrover1 | 0:8e57f3e9cc89 | 83 | |
rgrover1 | 0:8e57f3e9cc89 | 84 | /* Type definitions. */ |
rgrover1 | 0:8e57f3e9cc89 | 85 | #define portCHAR char |
rgrover1 | 0:8e57f3e9cc89 | 86 | #define portFLOAT float |
rgrover1 | 0:8e57f3e9cc89 | 87 | #define portDOUBLE double |
rgrover1 | 0:8e57f3e9cc89 | 88 | #define portLONG long |
rgrover1 | 0:8e57f3e9cc89 | 89 | #define portSHORT short |
rgrover1 | 0:8e57f3e9cc89 | 90 | #define portSTACK_TYPE unsigned portLONG |
rgrover1 | 0:8e57f3e9cc89 | 91 | #define portBASE_TYPE long |
rgrover1 | 0:8e57f3e9cc89 | 92 | |
rgrover1 | 0:8e57f3e9cc89 | 93 | #if( configUSE_16_BIT_TICKS == 1 ) |
rgrover1 | 0:8e57f3e9cc89 | 94 | typedef unsigned portSHORT portTickType; |
rgrover1 | 0:8e57f3e9cc89 | 95 | #define portMAX_DELAY ( portTickType ) 0xffff |
rgrover1 | 0:8e57f3e9cc89 | 96 | #else |
rgrover1 | 0:8e57f3e9cc89 | 97 | typedef unsigned portLONG portTickType; |
rgrover1 | 0:8e57f3e9cc89 | 98 | #define portMAX_DELAY ( portTickType ) 0xffffffff |
rgrover1 | 0:8e57f3e9cc89 | 99 | #endif |
rgrover1 | 0:8e57f3e9cc89 | 100 | /*-----------------------------------------------------------*/ |
rgrover1 | 0:8e57f3e9cc89 | 101 | |
rgrover1 | 0:8e57f3e9cc89 | 102 | /* Architecture specifics. */ |
rgrover1 | 0:8e57f3e9cc89 | 103 | #define portSTACK_GROWTH ( -1 ) |
rgrover1 | 0:8e57f3e9cc89 | 104 | #define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ ) |
rgrover1 | 0:8e57f3e9cc89 | 105 | #define portBYTE_ALIGNMENT 8 |
rgrover1 | 0:8e57f3e9cc89 | 106 | /*-----------------------------------------------------------*/ |
rgrover1 | 0:8e57f3e9cc89 | 107 | |
rgrover1 | 0:8e57f3e9cc89 | 108 | /* Scheduler utilities. */ |
rgrover1 | 0:8e57f3e9cc89 | 109 | extern void vPortYield( void ); |
rgrover1 | 0:8e57f3e9cc89 | 110 | #define portNVIC_INT_CTRL_REG ( * ( ( volatile unsigned long * ) 0xe000ed04 ) ) |
rgrover1 | 0:8e57f3e9cc89 | 111 | #define portNVIC_PENDSVSET_BIT ( 1UL << 28UL ) |
rgrover1 | 0:8e57f3e9cc89 | 112 | #define portYIELD() vPortYield() |
rgrover1 | 0:8e57f3e9cc89 | 113 | #define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT |
rgrover1 | 0:8e57f3e9cc89 | 114 | #define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x ) |
rgrover1 | 0:8e57f3e9cc89 | 115 | /*-----------------------------------------------------------*/ |
rgrover1 | 0:8e57f3e9cc89 | 116 | |
rgrover1 | 0:8e57f3e9cc89 | 117 | /* Critical section management. */ |
rgrover1 | 0:8e57f3e9cc89 | 118 | extern unsigned long ulPortSetInterruptMask( void ); |
rgrover1 | 0:8e57f3e9cc89 | 119 | extern void vPortClearInterruptMask( unsigned long ulNewMask ); |
rgrover1 | 0:8e57f3e9cc89 | 120 | extern void vPortEnterCritical( void ); |
rgrover1 | 0:8e57f3e9cc89 | 121 | extern void vPortExitCritical( void ); |
rgrover1 | 0:8e57f3e9cc89 | 122 | |
rgrover1 | 0:8e57f3e9cc89 | 123 | #define portDISABLE_INTERRUPTS() ulPortSetInterruptMask() |
rgrover1 | 0:8e57f3e9cc89 | 124 | #define portENABLE_INTERRUPTS() vPortClearInterruptMask( 0 ) |
rgrover1 | 0:8e57f3e9cc89 | 125 | #define portENTER_CRITICAL() vPortEnterCritical() |
rgrover1 | 0:8e57f3e9cc89 | 126 | #define portEXIT_CRITICAL() vPortExitCritical() |
rgrover1 | 0:8e57f3e9cc89 | 127 | #define portSET_INTERRUPT_MASK_FROM_ISR() ulPortSetInterruptMask() |
rgrover1 | 0:8e57f3e9cc89 | 128 | #define portCLEAR_INTERRUPT_MASK_FROM_ISR(x) vPortClearInterruptMask(x) |
rgrover1 | 0:8e57f3e9cc89 | 129 | /*-----------------------------------------------------------*/ |
rgrover1 | 0:8e57f3e9cc89 | 130 | |
rgrover1 | 0:8e57f3e9cc89 | 131 | /* Tickless idle/low power functionality. */ |
rgrover1 | 0:8e57f3e9cc89 | 132 | #ifndef portSUPPRESS_TICKS_AND_SLEEP |
rgrover1 | 0:8e57f3e9cc89 | 133 | extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime ); |
rgrover1 | 0:8e57f3e9cc89 | 134 | #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime ) |
rgrover1 | 0:8e57f3e9cc89 | 135 | #endif |
rgrover1 | 0:8e57f3e9cc89 | 136 | /*-----------------------------------------------------------*/ |
rgrover1 | 0:8e57f3e9cc89 | 137 | |
rgrover1 | 0:8e57f3e9cc89 | 138 | /* Port specific optimisations. */ |
rgrover1 | 0:8e57f3e9cc89 | 139 | #if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1 |
rgrover1 | 0:8e57f3e9cc89 | 140 | |
rgrover1 | 0:8e57f3e9cc89 | 141 | /* Check the configuration. */ |
rgrover1 | 0:8e57f3e9cc89 | 142 | #if( configMAX_PRIORITIES > 32 ) |
rgrover1 | 0:8e57f3e9cc89 | 143 | #error configUSE_PORT_OPTIMISED_TASK_SELECTION can only be set to 1 when configMAX_PRIORITIES is less than or equal to 32. It is very rare that a system requires more than 10 to 15 difference priorities as tasks that share a priority will time slice. |
rgrover1 | 0:8e57f3e9cc89 | 144 | #endif |
rgrover1 | 0:8e57f3e9cc89 | 145 | |
rgrover1 | 0:8e57f3e9cc89 | 146 | /* Store/clear the ready priorities in a bit map. */ |
rgrover1 | 0:8e57f3e9cc89 | 147 | #define portRECORD_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) |= ( 1UL << ( uxPriority ) ) |
rgrover1 | 0:8e57f3e9cc89 | 148 | #define portRESET_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) &= ~( 1UL << ( uxPriority ) ) |
rgrover1 | 0:8e57f3e9cc89 | 149 | |
rgrover1 | 0:8e57f3e9cc89 | 150 | /*-----------------------------------------------------------*/ |
rgrover1 | 0:8e57f3e9cc89 | 151 | |
rgrover1 | 0:8e57f3e9cc89 | 152 | #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31 - __clz( ( uxReadyPriorities ) ) ) |
rgrover1 | 0:8e57f3e9cc89 | 153 | |
rgrover1 | 0:8e57f3e9cc89 | 154 | #endif /* taskRECORD_READY_PRIORITY */ |
rgrover1 | 0:8e57f3e9cc89 | 155 | /*-----------------------------------------------------------*/ |
rgrover1 | 0:8e57f3e9cc89 | 156 | |
rgrover1 | 0:8e57f3e9cc89 | 157 | /* Task function macros as described on the FreeRTOS.org WEB site. These are |
rgrover1 | 0:8e57f3e9cc89 | 158 | not necessary for to use this port. They are defined so the common demo files |
rgrover1 | 0:8e57f3e9cc89 | 159 | (which build with all the ports) will build. */ |
rgrover1 | 0:8e57f3e9cc89 | 160 | #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters ) |
rgrover1 | 0:8e57f3e9cc89 | 161 | #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters ) |
rgrover1 | 0:8e57f3e9cc89 | 162 | /*-----------------------------------------------------------*/ |
rgrover1 | 0:8e57f3e9cc89 | 163 | |
rgrover1 | 0:8e57f3e9cc89 | 164 | #ifdef configASSERT |
rgrover1 | 0:8e57f3e9cc89 | 165 | void vPortValidateInterruptPriority( void ); |
rgrover1 | 0:8e57f3e9cc89 | 166 | #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() vPortValidateInterruptPriority() |
rgrover1 | 0:8e57f3e9cc89 | 167 | #endif |
rgrover1 | 0:8e57f3e9cc89 | 168 | |
rgrover1 | 0:8e57f3e9cc89 | 169 | /* portNOP() is not required by this port. */ |
rgrover1 | 0:8e57f3e9cc89 | 170 | #define portNOP() |
rgrover1 | 0:8e57f3e9cc89 | 171 | |
rgrover1 | 0:8e57f3e9cc89 | 172 | #ifdef __cplusplus |
rgrover1 | 0:8e57f3e9cc89 | 173 | } |
rgrover1 | 0:8e57f3e9cc89 | 174 | #endif |
rgrover1 | 0:8e57f3e9cc89 | 175 | |
rgrover1 | 0:8e57f3e9cc89 | 176 | #endif /* PORTMACRO_H */ |
rgrover1 | 0:8e57f3e9cc89 | 177 |