/*\r
- FreeRTOS V7.5.2 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+ FreeRTOS V8.1.2 - Copyright (C) 2014 Real Time Engineers Ltd. \r
+ All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
\r
the terms of the GNU General Public License (version 2) as published by the\r
Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.\r
\r
- >>! NOTE: The modification to the GPL is included to allow you to distribute\r
- >>! a combined work that includes FreeRTOS without being obliged to provide\r
- >>! the source code for proprietary components outside of the FreeRTOS\r
- >>! kernel.\r
+ >>! NOTE: The modification to the GPL is included to allow you to !<<\r
+ >>! distribute a combined work that includes FreeRTOS without being !<<\r
+ >>! obliged to provide the source code for proprietary components !<<\r
+ >>! outside of the FreeRTOS kernel. !<<\r
\r
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
/*-----------------------------------------------------------*/\r
\r
/*\r
- * Perform any application specific hardware configuration. The clocks,\r
- * memory, etc. are configured before main() is called.\r
+ * Perform any application specific hardware configuration. \r
*/\r
static void prvSetupHardware( void );\r
\r
*/\r
void vApplicationMallocFailedHook( void );\r
void vApplicationIdleHook( void );\r
-void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName );\r
+void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName );\r
void vApplicationTickHook( void );\r
\r
/*\r
}\r
/*-----------------------------------------------------------*/\r
\r
-void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName )\r
+void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )\r
{\r
( void ) pcTaskName;\r
( void ) pxTask;\r
configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h. User code can be\r
added here, but the tick hook is called from an interrupt context, so\r
code must not attempt to block, and only the interrupt safe FreeRTOS API\r
- functions can be used (those that end in FromISR()). The code in this\r
- tick hook implementation is for demonstration only - it has no real\r
- purpose. It just gives a semaphore every 50ms. The semaphore unblocks a\r
- task that then toggles an LED. Additionally, the call to\r
- vQueueSetAccessQueueSetFromISR() is part of the "standard demo tasks"\r
- functionality. */\r
+ functions can be used (those that end in FromISR()). */\r
\r
/* The semaphore and associated task are not created when the simple blinky\r
demo is used. */\r
\r
void vMainConfigureTimerForRunTimeStats( void )\r
{\r
+ /* Used by the optional run-time stats gathering functionality. */\r
+ \r
/* How many clocks are there per tenth of a millisecond? */\r
ulClocksPer10thOfAMilliSecond = configCPU_CLOCK_HZ / 10000UL;\r
}\r
volatile unsigned long * const pulInterruptCTRLState = ( ( volatile unsigned long *) 0xe000ed04 );\r
const unsigned long ulSysTickPendingBit = 0x04000000UL;\r
\r
+ /* Used by the optional run-time stats gathering functionality. */\r
+\r
+\r
/* NOTE: There are potentially race conditions here. However, it is used\r
anyway to keep the examples simple, and to avoid reliance on a separate\r
timer peripheral. */\r
\r
return ulReturn; \r
}\r
+/*-----------------------------------------------------------*/\r
+\r
+#ifdef JUST_AN_EXAMPLE_ISR\r
+\r
+void Dummy_IRQHandler(void)\r
+{\r
+long lHigherPriorityTaskWoken = pdFALSE;\r
+\r
+ /* Clear the interrupt if necessary. */\r
+ Dummy_ClearITPendingBit();\r
+\r
+ /* This interrupt does nothing more than demonstrate how to synchronise a\r
+ task with an interrupt. A semaphore is used for this purpose. Note\r
+ lHigherPriorityTaskWoken is initialised to zero. Only FreeRTOS API functions\r
+ that end in "FromISR" can be called from an ISR. */\r
+ xSemaphoreGiveFromISR( xTestSemaphore, &lHigherPriorityTaskWoken );\r
+\r
+ /* If there was a task that was blocked on the semaphore, and giving the\r
+ semaphore caused the task to unblock, and the unblocked task has a priority\r
+ higher than the current Running state task (the task that this interrupt\r
+ interrupted), then lHigherPriorityTaskWoken will have been set to pdTRUE\r
+ internally within xSemaphoreGiveFromISR(). Passing pdTRUE into the\r
+ portEND_SWITCHING_ISR() macro will result in a context switch being pended to\r
+ ensure this interrupt returns directly to the unblocked, higher priority,\r
+ task. Passing pdFALSE into portEND_SWITCHING_ISR() has no effect. */\r
+ portEND_SWITCHING_ISR( lHigherPriorityTaskWoken );\r
+}\r
+\r
+#endif /* JUST_AN_EXAMPLE_ISR */\r
\r