#include "FreeRTOS.h"\r
#include "task.h"\r
\r
-/* Standard demo includes - just needed for the LED (ParTest) initialisation\r
-function. */\r
+/* Standard demo includes. */\r
#include "partest.h"\r
+#include "QueueSet.h"\r
\r
/* Atmel library includes. */\r
#include <asf.h>\r
}\r
/*-----------------------------------------------------------*/\r
\r
+void vApplicationTickHook( void )\r
+{\r
+ /* This function will be called by each tick interrupt if\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()). */\r
+\r
+ #if ( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 0 )\r
+ {\r
+ /* In this case the tick hook is used as part of the queue set test. */\r
+ vQueueSetWriteToQueueFromISR();\r
+ }\r
+ #endif /* mainCREATE_SIMPLE_BLINKY_DEMO_ONLY */\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
}\r
/*-----------------------------------------------------------*/\r
\r
-void vApplicationTickHook( void )\r
-{\r
- /* This function will be called by each tick interrupt if\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()). */\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
}\r
/*-----------------------------------------------------------*/\r
\r
-void vApplicationTickHook( void )\r
-{\r
- /* This function will be called by each tick interrupt if\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()). In this case the tick\r
- hook is used as part of the queue set test. */\r
- vQueueSetWriteToQueueFromISR();\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
* queuesetINITIAL_ISR_TX_VALUE to 0xffffffffUL;\r
*/\r
\r
+/* Standard includes. */\r
+#include <stdlib.h>\r
+\r
/* Kernel includes. */\r
-#include <FreeRTOS.h>\r
+#include "FreeRTOS.h"\r
#include "task.h"\r
#include "queue.h"\r
\r
if( xQueues[ x ] != NULL )\r
{\r
/* xQueues[ x ] can be written to. Send the next value. */\r
- if( xQueueSendFromISR( xQueues[ x ], &ulISRTxValue, NULL ) == pdPASS )\r
+ if( xQueueSendFromISR( xQueues[ x ], ( void * ) &ulISRTxValue, NULL ) == pdPASS )\r
{\r
ulISRTxValue++;\r
\r
{\r
#if ( configUSE_QUEUE_SETS == 1 )\r
{\r
+ /* It is highly unlikely that this code will ever run,\r
+ for the following reason:\r
+ + A task will only lock a queue that is part of a\r
+ queue set when it is blocking on a write to the\r
+ queue.\r
+ + An interrupt can only add something to a queue\r
+ while the queue is locked (resulting in the\r
+ following code executing when the queue is unlocked)\r
+ if the queue is not full, meaning a task will never\r
+ have blocked on a write in the first place.\r
+ The code could execute if an interrupt is also removing\r
+ items from a queue. */\r
if( pxQueue->pxQueueSetContainer != NULL )\r
{\r
if( prvNotifyQueueSetContainer( pxQueue, queueSEND_TO_BACK ) == pdTRUE )\r