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/StackMacros.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 | #ifndef STACK_MACROS_H |
dflet | 3:a8c249046181 | 71 | #define STACK_MACROS_H |
dflet | 3:a8c249046181 | 72 | |
dflet | 3:a8c249046181 | 73 | /* |
dflet | 3:a8c249046181 | 74 | * Call the stack overflow hook function if the stack of the task being swapped |
dflet | 3:a8c249046181 | 75 | * out is currently overflowed, or looks like it might have overflowed in the |
dflet | 3:a8c249046181 | 76 | * past. |
dflet | 3:a8c249046181 | 77 | * |
dflet | 3:a8c249046181 | 78 | * Setting configCHECK_FOR_STACK_OVERFLOW to 1 will cause the macro to check |
dflet | 3:a8c249046181 | 79 | * the current stack state only - comparing the current top of stack value to |
dflet | 3:a8c249046181 | 80 | * the stack limit. Setting configCHECK_FOR_STACK_OVERFLOW to greater than 1 |
dflet | 3:a8c249046181 | 81 | * will also cause the last few stack bytes to be checked to ensure the value |
dflet | 3:a8c249046181 | 82 | * to which the bytes were set when the task was created have not been |
dflet | 3:a8c249046181 | 83 | * overwritten. Note this second test does not guarantee that an overflowed |
dflet | 3:a8c249046181 | 84 | * stack will always be recognised. |
dflet | 3:a8c249046181 | 85 | */ |
dflet | 3:a8c249046181 | 86 | |
dflet | 3:a8c249046181 | 87 | /*-----------------------------------------------------------*/ |
dflet | 3:a8c249046181 | 88 | |
dflet | 3:a8c249046181 | 89 | #if( configCHECK_FOR_STACK_OVERFLOW == 0 ) |
dflet | 3:a8c249046181 | 90 | |
dflet | 3:a8c249046181 | 91 | /* FreeRTOSConfig.h is not set to check for stack overflows. */ |
dflet | 3:a8c249046181 | 92 | #define taskFIRST_CHECK_FOR_STACK_OVERFLOW() |
dflet | 3:a8c249046181 | 93 | #define taskSECOND_CHECK_FOR_STACK_OVERFLOW() |
dflet | 3:a8c249046181 | 94 | |
dflet | 3:a8c249046181 | 95 | #endif /* configCHECK_FOR_STACK_OVERFLOW == 0 */ |
dflet | 3:a8c249046181 | 96 | /*-----------------------------------------------------------*/ |
dflet | 3:a8c249046181 | 97 | |
dflet | 3:a8c249046181 | 98 | #if( configCHECK_FOR_STACK_OVERFLOW == 1 ) |
dflet | 3:a8c249046181 | 99 | |
dflet | 3:a8c249046181 | 100 | /* FreeRTOSConfig.h is only set to use the first method of |
dflet | 3:a8c249046181 | 101 | overflow checking. */ |
dflet | 3:a8c249046181 | 102 | #define taskSECOND_CHECK_FOR_STACK_OVERFLOW() |
dflet | 3:a8c249046181 | 103 | |
dflet | 3:a8c249046181 | 104 | #endif |
dflet | 3:a8c249046181 | 105 | /*-----------------------------------------------------------*/ |
dflet | 3:a8c249046181 | 106 | |
dflet | 3:a8c249046181 | 107 | #if( ( configCHECK_FOR_STACK_OVERFLOW > 0 ) && ( portSTACK_GROWTH < 0 ) ) |
dflet | 3:a8c249046181 | 108 | |
dflet | 3:a8c249046181 | 109 | /* Only the current stack state is to be checked. */ |
dflet | 3:a8c249046181 | 110 | #define taskFIRST_CHECK_FOR_STACK_OVERFLOW() \ |
dflet | 3:a8c249046181 | 111 | { \ |
dflet | 3:a8c249046181 | 112 | /* Is the currently saved stack pointer within the stack limit? */ \ |
dflet | 3:a8c249046181 | 113 | if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack ) \ |
dflet | 3:a8c249046181 | 114 | { \ |
dflet | 3:a8c249046181 | 115 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ |
dflet | 3:a8c249046181 | 116 | } \ |
dflet | 3:a8c249046181 | 117 | } |
dflet | 3:a8c249046181 | 118 | |
dflet | 3:a8c249046181 | 119 | #endif /* configCHECK_FOR_STACK_OVERFLOW > 0 */ |
dflet | 3:a8c249046181 | 120 | /*-----------------------------------------------------------*/ |
dflet | 3:a8c249046181 | 121 | |
dflet | 3:a8c249046181 | 122 | #if( ( configCHECK_FOR_STACK_OVERFLOW > 0 ) && ( portSTACK_GROWTH > 0 ) ) |
dflet | 3:a8c249046181 | 123 | |
dflet | 3:a8c249046181 | 124 | /* Only the current stack state is to be checked. */ |
dflet | 3:a8c249046181 | 125 | #define taskFIRST_CHECK_FOR_STACK_OVERFLOW() \ |
dflet | 3:a8c249046181 | 126 | { \ |
dflet | 3:a8c249046181 | 127 | \ |
dflet | 3:a8c249046181 | 128 | /* Is the currently saved stack pointer within the stack limit? */ \ |
dflet | 3:a8c249046181 | 129 | if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack ) \ |
dflet | 3:a8c249046181 | 130 | { \ |
dflet | 3:a8c249046181 | 131 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ |
dflet | 3:a8c249046181 | 132 | } \ |
dflet | 3:a8c249046181 | 133 | } |
dflet | 3:a8c249046181 | 134 | |
dflet | 3:a8c249046181 | 135 | #endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */ |
dflet | 3:a8c249046181 | 136 | /*-----------------------------------------------------------*/ |
dflet | 3:a8c249046181 | 137 | |
dflet | 3:a8c249046181 | 138 | #if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) ) |
dflet | 3:a8c249046181 | 139 | |
dflet | 3:a8c249046181 | 140 | #define taskSECOND_CHECK_FOR_STACK_OVERFLOW() \ |
dflet | 3:a8c249046181 | 141 | { \ |
dflet | 3:a8c249046181 | 142 | static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ |
dflet | 3:a8c249046181 | 143 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ |
dflet | 3:a8c249046181 | 144 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ |
dflet | 3:a8c249046181 | 145 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ |
dflet | 3:a8c249046181 | 146 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE }; \ |
dflet | 3:a8c249046181 | 147 | \ |
dflet | 3:a8c249046181 | 148 | \ |
dflet | 3:a8c249046181 | 149 | /* Has the extremity of the task stack ever been written over? */ \ |
dflet | 3:a8c249046181 | 150 | if( memcmp( ( void * ) pxCurrentTCB->pxStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \ |
dflet | 3:a8c249046181 | 151 | { \ |
dflet | 3:a8c249046181 | 152 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ |
dflet | 3:a8c249046181 | 153 | } \ |
dflet | 3:a8c249046181 | 154 | } |
dflet | 3:a8c249046181 | 155 | |
dflet | 3:a8c249046181 | 156 | #endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */ |
dflet | 3:a8c249046181 | 157 | /*-----------------------------------------------------------*/ |
dflet | 3:a8c249046181 | 158 | |
dflet | 3:a8c249046181 | 159 | #if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH > 0 ) ) |
dflet | 3:a8c249046181 | 160 | |
dflet | 3:a8c249046181 | 161 | #define taskSECOND_CHECK_FOR_STACK_OVERFLOW() \ |
dflet | 3:a8c249046181 | 162 | { \ |
dflet | 3:a8c249046181 | 163 | int8_t *pcEndOfStack = ( int8_t * ) pxCurrentTCB->pxEndOfStack; \ |
dflet | 3:a8c249046181 | 164 | static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ |
dflet | 3:a8c249046181 | 165 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ |
dflet | 3:a8c249046181 | 166 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ |
dflet | 3:a8c249046181 | 167 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ |
dflet | 3:a8c249046181 | 168 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE }; \ |
dflet | 3:a8c249046181 | 169 | \ |
dflet | 3:a8c249046181 | 170 | \ |
dflet | 3:a8c249046181 | 171 | pcEndOfStack -= sizeof( ucExpectedStackBytes ); \ |
dflet | 3:a8c249046181 | 172 | \ |
dflet | 3:a8c249046181 | 173 | /* Has the extremity of the task stack ever been written over? */ \ |
dflet | 3:a8c249046181 | 174 | if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \ |
dflet | 3:a8c249046181 | 175 | { \ |
dflet | 3:a8c249046181 | 176 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ |
dflet | 3:a8c249046181 | 177 | } \ |
dflet | 3:a8c249046181 | 178 | } |
dflet | 3:a8c249046181 | 179 | |
dflet | 3:a8c249046181 | 180 | #endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */ |
dflet | 3:a8c249046181 | 181 | /*-----------------------------------------------------------*/ |
dflet | 3:a8c249046181 | 182 | |
dflet | 3:a8c249046181 | 183 | #endif /* STACK_MACROS_H */ |
dflet | 3:a8c249046181 | 184 | |
dflet | 3:a8c249046181 | 185 |