Update revision to use TI's mqtt and Freertos.
Dependencies: mbed client server
Fork of cc3100_Test_mqtt_CM3 by
FreeRTOS_V8_2_1/source/include/portable.h@3:a8c249046181, 2015-09-03 (annotated)
- Committer:
- dflet
- Date:
- Thu Sep 03 14:02:37 2015 +0000
- Revision:
- 3:a8c249046181
SPI Mode change 1 to 0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dflet | 3:a8c249046181 | 1 | /* |
dflet | 3:a8c249046181 | 2 | FreeRTOS V8.2.1 - Copyright (C) 2015 Real Time Engineers Ltd. |
dflet | 3:a8c249046181 | 3 | All rights reserved |
dflet | 3:a8c249046181 | 4 | |
dflet | 3:a8c249046181 | 5 | VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. |
dflet | 3:a8c249046181 | 6 | |
dflet | 3:a8c249046181 | 7 | This file is part of the FreeRTOS distribution. |
dflet | 3:a8c249046181 | 8 | |
dflet | 3:a8c249046181 | 9 | FreeRTOS is free software; you can redistribute it and/or modify it under |
dflet | 3:a8c249046181 | 10 | the terms of the GNU General Public License (version 2) as published by the |
dflet | 3:a8c249046181 | 11 | Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. |
dflet | 3:a8c249046181 | 12 | |
dflet | 3:a8c249046181 | 13 | *************************************************************************** |
dflet | 3:a8c249046181 | 14 | >>! NOTE: The modification to the GPL is included to allow you to !<< |
dflet | 3:a8c249046181 | 15 | >>! distribute a combined work that includes FreeRTOS without being !<< |
dflet | 3:a8c249046181 | 16 | >>! obliged to provide the source code for proprietary components !<< |
dflet | 3:a8c249046181 | 17 | >>! outside of the FreeRTOS kernel. !<< |
dflet | 3:a8c249046181 | 18 | *************************************************************************** |
dflet | 3:a8c249046181 | 19 | |
dflet | 3:a8c249046181 | 20 | FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY |
dflet | 3:a8c249046181 | 21 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
dflet | 3:a8c249046181 | 22 | FOR A PARTICULAR PURPOSE. Full license text is available on the following |
dflet | 3:a8c249046181 | 23 | link: http://www.freertos.org/a00114.html |
dflet | 3:a8c249046181 | 24 | |
dflet | 3:a8c249046181 | 25 | *************************************************************************** |
dflet | 3:a8c249046181 | 26 | * * |
dflet | 3:a8c249046181 | 27 | * FreeRTOS provides completely free yet professionally developed, * |
dflet | 3:a8c249046181 | 28 | * robust, strictly quality controlled, supported, and cross * |
dflet | 3:a8c249046181 | 29 | * platform software that is more than just the market leader, it * |
dflet | 3:a8c249046181 | 30 | * is the industry's de facto standard. * |
dflet | 3:a8c249046181 | 31 | * * |
dflet | 3:a8c249046181 | 32 | * Help yourself get started quickly while simultaneously helping * |
dflet | 3:a8c249046181 | 33 | * to support the FreeRTOS project by purchasing a FreeRTOS * |
dflet | 3:a8c249046181 | 34 | * tutorial book, reference manual, or both: * |
dflet | 3:a8c249046181 | 35 | * http://www.FreeRTOS.org/Documentation * |
dflet | 3:a8c249046181 | 36 | * * |
dflet | 3:a8c249046181 | 37 | *************************************************************************** |
dflet | 3:a8c249046181 | 38 | |
dflet | 3:a8c249046181 | 39 | http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading |
dflet | 3:a8c249046181 | 40 | the FAQ page "My application does not run, what could be wrong?". Have you |
dflet | 3:a8c249046181 | 41 | defined configASSERT()? |
dflet | 3:a8c249046181 | 42 | |
dflet | 3:a8c249046181 | 43 | http://www.FreeRTOS.org/support - In return for receiving this top quality |
dflet | 3:a8c249046181 | 44 | embedded software for free we request you assist our global community by |
dflet | 3:a8c249046181 | 45 | participating in the support forum. |
dflet | 3:a8c249046181 | 46 | |
dflet | 3:a8c249046181 | 47 | http://www.FreeRTOS.org/training - Investing in training allows your team to |
dflet | 3:a8c249046181 | 48 | be as productive as possible as early as possible. Now you can receive |
dflet | 3:a8c249046181 | 49 | FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers |
dflet | 3:a8c249046181 | 50 | Ltd, and the world's leading authority on the world's leading RTOS. |
dflet | 3:a8c249046181 | 51 | |
dflet | 3:a8c249046181 | 52 | http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, |
dflet | 3:a8c249046181 | 53 | including FreeRTOS+Trace - an indispensable productivity tool, a DOS |
dflet | 3:a8c249046181 | 54 | compatible FAT file system, and our tiny thread aware UDP/IP stack. |
dflet | 3:a8c249046181 | 55 | |
dflet | 3:a8c249046181 | 56 | http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. |
dflet | 3:a8c249046181 | 57 | Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. |
dflet | 3:a8c249046181 | 58 | |
dflet | 3:a8c249046181 | 59 | http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High |
dflet | 3:a8c249046181 | 60 | Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS |
dflet | 3:a8c249046181 | 61 | licenses offer ticketed support, indemnification and commercial middleware. |
dflet | 3:a8c249046181 | 62 | |
dflet | 3:a8c249046181 | 63 | http://www.SafeRTOS.com - High Integrity Systems also provide a safety |
dflet | 3:a8c249046181 | 64 | engineered and independently SIL3 certified version for use in safety and |
dflet | 3:a8c249046181 | 65 | mission critical applications that require provable dependability. |
dflet | 3:a8c249046181 | 66 | |
dflet | 3:a8c249046181 | 67 | 1 tab == 4 spaces! |
dflet | 3:a8c249046181 | 68 | */ |
dflet | 3:a8c249046181 | 69 | |
dflet | 3:a8c249046181 | 70 | /*----------------------------------------------------------- |
dflet | 3:a8c249046181 | 71 | * Portable layer API. Each function must be defined for each port. |
dflet | 3:a8c249046181 | 72 | *----------------------------------------------------------*/ |
dflet | 3:a8c249046181 | 73 | |
dflet | 3:a8c249046181 | 74 | #ifndef PORTABLE_H |
dflet | 3:a8c249046181 | 75 | #define PORTABLE_H |
dflet | 3:a8c249046181 | 76 | |
dflet | 3:a8c249046181 | 77 | /* Each FreeRTOS port has a unique portmacro.h header file. Originally a |
dflet | 3:a8c249046181 | 78 | pre-processor definition was used to ensure the pre-processor found the correct |
dflet | 3:a8c249046181 | 79 | portmacro.h file for the port being used. That scheme was deprecated in favour |
dflet | 3:a8c249046181 | 80 | of setting the compiler's include path such that it found the correct |
dflet | 3:a8c249046181 | 81 | portmacro.h file - removing the need for the constant and allowing the |
dflet | 3:a8c249046181 | 82 | portmacro.h file to be located anywhere in relation to the port being used. |
dflet | 3:a8c249046181 | 83 | Purely for reasons of backward compatibility the old method is still valid, but |
dflet | 3:a8c249046181 | 84 | to make it clear that new projects should not use it, support for the port |
dflet | 3:a8c249046181 | 85 | specific constants has been moved into the deprecated_definitions.h header |
dflet | 3:a8c249046181 | 86 | file. */ |
dflet | 3:a8c249046181 | 87 | #include "deprecated_definitions.h" |
dflet | 3:a8c249046181 | 88 | |
dflet | 3:a8c249046181 | 89 | /* If portENTER_CRITICAL is not defined then including deprecated_definitions.h |
dflet | 3:a8c249046181 | 90 | did not result in a portmacro.h header file being included - and it should be |
dflet | 3:a8c249046181 | 91 | included here. In this case the path to the correct portmacro.h header file |
dflet | 3:a8c249046181 | 92 | must be set in the compiler's include path. */ |
dflet | 3:a8c249046181 | 93 | #ifndef portENTER_CRITICAL |
dflet | 3:a8c249046181 | 94 | #include "portmacro.h" |
dflet | 3:a8c249046181 | 95 | #endif |
dflet | 3:a8c249046181 | 96 | |
dflet | 3:a8c249046181 | 97 | #if portBYTE_ALIGNMENT == 8 |
dflet | 3:a8c249046181 | 98 | #define portBYTE_ALIGNMENT_MASK ( 0x0007 ) |
dflet | 3:a8c249046181 | 99 | #endif |
dflet | 3:a8c249046181 | 100 | |
dflet | 3:a8c249046181 | 101 | #if portBYTE_ALIGNMENT == 4 |
dflet | 3:a8c249046181 | 102 | #define portBYTE_ALIGNMENT_MASK ( 0x0003 ) |
dflet | 3:a8c249046181 | 103 | #endif |
dflet | 3:a8c249046181 | 104 | |
dflet | 3:a8c249046181 | 105 | #if portBYTE_ALIGNMENT == 2 |
dflet | 3:a8c249046181 | 106 | #define portBYTE_ALIGNMENT_MASK ( 0x0001 ) |
dflet | 3:a8c249046181 | 107 | #endif |
dflet | 3:a8c249046181 | 108 | |
dflet | 3:a8c249046181 | 109 | #if portBYTE_ALIGNMENT == 1 |
dflet | 3:a8c249046181 | 110 | #define portBYTE_ALIGNMENT_MASK ( 0x0000 ) |
dflet | 3:a8c249046181 | 111 | #endif |
dflet | 3:a8c249046181 | 112 | |
dflet | 3:a8c249046181 | 113 | #ifndef portBYTE_ALIGNMENT_MASK |
dflet | 3:a8c249046181 | 114 | #error "Invalid portBYTE_ALIGNMENT definition" |
dflet | 3:a8c249046181 | 115 | #endif |
dflet | 3:a8c249046181 | 116 | |
dflet | 3:a8c249046181 | 117 | #ifndef portNUM_CONFIGURABLE_REGIONS |
dflet | 3:a8c249046181 | 118 | #define portNUM_CONFIGURABLE_REGIONS 1 |
dflet | 3:a8c249046181 | 119 | #endif |
dflet | 3:a8c249046181 | 120 | |
dflet | 3:a8c249046181 | 121 | #ifdef __cplusplus |
dflet | 3:a8c249046181 | 122 | extern "C" { |
dflet | 3:a8c249046181 | 123 | #endif |
dflet | 3:a8c249046181 | 124 | |
dflet | 3:a8c249046181 | 125 | #include "mpu_wrappers.h" |
dflet | 3:a8c249046181 | 126 | #include "projdefs.h" |
dflet | 3:a8c249046181 | 127 | |
dflet | 3:a8c249046181 | 128 | /* |
dflet | 3:a8c249046181 | 129 | * Setup the stack of a new task so it is ready to be placed under the |
dflet | 3:a8c249046181 | 130 | * scheduler control. The registers have to be placed on the stack in |
dflet | 3:a8c249046181 | 131 | * the order that the port expects to find them. |
dflet | 3:a8c249046181 | 132 | * |
dflet | 3:a8c249046181 | 133 | */ |
dflet | 3:a8c249046181 | 134 | #if( portUSING_MPU_WRAPPERS == 1 ) |
dflet | 3:a8c249046181 | 135 | StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters, BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION; |
dflet | 3:a8c249046181 | 136 | #else |
dflet | 3:a8c249046181 | 137 | StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters ) PRIVILEGED_FUNCTION; |
dflet | 3:a8c249046181 | 138 | #endif |
dflet | 3:a8c249046181 | 139 | |
dflet | 3:a8c249046181 | 140 | /* Used by heap_5.c. */ |
dflet | 3:a8c249046181 | 141 | typedef struct HeapRegion |
dflet | 3:a8c249046181 | 142 | { |
dflet | 3:a8c249046181 | 143 | uint8_t *pucStartAddress; |
dflet | 3:a8c249046181 | 144 | size_t xSizeInBytes; |
dflet | 3:a8c249046181 | 145 | } HeapRegion_t; |
dflet | 3:a8c249046181 | 146 | |
dflet | 3:a8c249046181 | 147 | /* |
dflet | 3:a8c249046181 | 148 | * Used to define multiple heap regions for use by heap_5.c. This function |
dflet | 3:a8c249046181 | 149 | * must be called before any calls to pvPortMalloc() - not creating a task, |
dflet | 3:a8c249046181 | 150 | * queue, semaphore, mutex, software timer, event group, etc. will result in |
dflet | 3:a8c249046181 | 151 | * pvPortMalloc being called. |
dflet | 3:a8c249046181 | 152 | * |
dflet | 3:a8c249046181 | 153 | * pxHeapRegions passes in an array of HeapRegion_t structures - each of which |
dflet | 3:a8c249046181 | 154 | * defines a region of memory that can be used as the heap. The array is |
dflet | 3:a8c249046181 | 155 | * terminated by a HeapRegions_t structure that has a size of 0. The region |
dflet | 3:a8c249046181 | 156 | * with the lowest start address must appear first in the array. |
dflet | 3:a8c249046181 | 157 | */ |
dflet | 3:a8c249046181 | 158 | void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions ); |
dflet | 3:a8c249046181 | 159 | |
dflet | 3:a8c249046181 | 160 | |
dflet | 3:a8c249046181 | 161 | /* |
dflet | 3:a8c249046181 | 162 | * Map to the memory management routines required for the port. |
dflet | 3:a8c249046181 | 163 | */ |
dflet | 3:a8c249046181 | 164 | void *pvPortMalloc( size_t xSize ) PRIVILEGED_FUNCTION; |
dflet | 3:a8c249046181 | 165 | void vPortFree( void *pv ) PRIVILEGED_FUNCTION; |
dflet | 3:a8c249046181 | 166 | void vPortInitialiseBlocks( void ) PRIVILEGED_FUNCTION; |
dflet | 3:a8c249046181 | 167 | size_t xPortGetFreeHeapSize( void ) PRIVILEGED_FUNCTION; |
dflet | 3:a8c249046181 | 168 | size_t xPortGetMinimumEverFreeHeapSize( void ) PRIVILEGED_FUNCTION; |
dflet | 3:a8c249046181 | 169 | |
dflet | 3:a8c249046181 | 170 | /* |
dflet | 3:a8c249046181 | 171 | * Setup the hardware ready for the scheduler to take control. This generally |
dflet | 3:a8c249046181 | 172 | * sets up a tick interrupt and sets timers for the correct tick frequency. |
dflet | 3:a8c249046181 | 173 | */ |
dflet | 3:a8c249046181 | 174 | BaseType_t xPortStartScheduler( void ) PRIVILEGED_FUNCTION; |
dflet | 3:a8c249046181 | 175 | |
dflet | 3:a8c249046181 | 176 | /* |
dflet | 3:a8c249046181 | 177 | * Undo any hardware/ISR setup that was performed by xPortStartScheduler() so |
dflet | 3:a8c249046181 | 178 | * the hardware is left in its original condition after the scheduler stops |
dflet | 3:a8c249046181 | 179 | * executing. |
dflet | 3:a8c249046181 | 180 | */ |
dflet | 3:a8c249046181 | 181 | void vPortEndScheduler( void ) PRIVILEGED_FUNCTION; |
dflet | 3:a8c249046181 | 182 | |
dflet | 3:a8c249046181 | 183 | /* |
dflet | 3:a8c249046181 | 184 | * The structures and methods of manipulating the MPU are contained within the |
dflet | 3:a8c249046181 | 185 | * port layer. |
dflet | 3:a8c249046181 | 186 | * |
dflet | 3:a8c249046181 | 187 | * Fills the xMPUSettings structure with the memory region information |
dflet | 3:a8c249046181 | 188 | * contained in xRegions. |
dflet | 3:a8c249046181 | 189 | */ |
dflet | 3:a8c249046181 | 190 | #if( portUSING_MPU_WRAPPERS == 1 ) |
dflet | 3:a8c249046181 | 191 | struct xMEMORY_REGION; |
dflet | 3:a8c249046181 | 192 | void vPortStoreTaskMPUSettings( xMPU_SETTINGS *xMPUSettings, const struct xMEMORY_REGION * const xRegions, StackType_t *pxBottomOfStack, uint16_t usStackDepth ) PRIVILEGED_FUNCTION; |
dflet | 3:a8c249046181 | 193 | #endif |
dflet | 3:a8c249046181 | 194 | |
dflet | 3:a8c249046181 | 195 | #ifdef __cplusplus |
dflet | 3:a8c249046181 | 196 | } |
dflet | 3:a8c249046181 | 197 | #endif |
dflet | 3:a8c249046181 | 198 | |
dflet | 3:a8c249046181 | 199 | #endif /* PORTABLE_H */ |
dflet | 3:a8c249046181 | 200 | |
dflet | 3:a8c249046181 | 201 |