#include "flash.h"\r
#include "dynamic.h"\r
#include "comtest2.h"\r
+#include "GenQTest.h"\r
\r
/* ST driver includes. */\r
#include "stm32l1xx_usart.h"\r
#define mainFLASH_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )\r
#define mainLCD_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )\r
#define mainCOM_TEST_PRIORITY ( tskIDLE_PRIORITY + 2 )\r
+#define mainGENERIC_QUEUE_TEST_PRIORITY ( tskIDLE_PRIORITY )\r
\r
#define mainLCD_TASK_STACK_SIZE ( configMINIMAL_STACK_SIZE * 2 )\r
\r
#define mainMESSAGE_BUTTON_SEL ( 5 )\r
#define mainMESSAGE_STATUS ( 6 )\r
\r
+#define mainERROR_DYNAMIC_TASKS ( 2 )\r
+#define mainERROR_COM_TEST ( 3 )\r
+#define mainERROR_GEN_QUEUE_TEST ( 4 )\r
+\r
/* Baud rate used by the comtest tasks. */\r
#define mainCOM_TEST_BAUD_RATE ( 9600 )\r
\r
static void prvSetupHardware( void );\r
static void prvLCDTask( void *pvParameters );\r
static void vTempTask( void *pv );\r
+static void prvGenerateStatusMessage( char *pcBuffer, long lStatusValue );\r
\r
unsigned long ulTIM6_OverflowCount = 0UL;\r
\r
vStartDynamicPriorityTasks();\r
vStartLEDFlashTasks( mainFLASH_TASK_PRIORITY );\r
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );\r
+ vStartGenericQueueTasks( mainGENERIC_QUEUE_TEST_PRIORITY );\r
\r
vTaskStartScheduler();\r
}\r
xQueueMessage xReceivedMessage;\r
long lLine = Line1;\r
const long lFontHeight = (((sFONT *)LCD_GetFont())->Height);\r
-static char cBuffer[ 256 ];\r
+static char cBuffer[ 512 ];\r
\r
/* This function is the only function that uses printf(). If printf() is\r
used from any other function then some sort of mutual exclusion on stdout\r
own string to print out. */\r
sprintf( cBuffer, "%s", ( char * ) xReceivedMessage.lMessageValue );\r
break;\r
- case mainMESSAGE_STATUS : sprintf( cBuffer, "Task status = %s", ( ( xReceivedMessage.lMessageValue ) ? "PASS" : "FAIL" ) );\r
+ case mainMESSAGE_STATUS : prvGenerateStatusMessage( cBuffer, xReceivedMessage.lMessageValue );\r
break;\r
default : sprintf( cBuffer, "Unknown message" );\r
break;\r
}\r
/*-----------------------------------------------------------*/\r
\r
+static void prvGenerateStatusMessage( char *pcBuffer, long lStatusValue )\r
+{\r
+ switch( lStatusValue )\r
+ {\r
+ case pdPASS : sprintf( pcBuffer, "Task status = PASS" );\r
+ break;\r
+ case mainERROR_DYNAMIC_TASKS : sprintf( pcBuffer, "Error: Dynamic tasks" );\r
+ break;\r
+ case mainERROR_COM_TEST : sprintf( pcBuffer, "Error: COM test" );\r
+ break;\r
+ case mainERROR_GEN_QUEUE_TEST : sprintf( pcBuffer, "Error: Gen Q test" );\r
+ break;\r
+ default : sprintf( pcBuffer, "Unknown status" );\r
+ break;\r
+ }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
void EXTI9_5_IRQHandler( void )\r
{\r
const xQueueMessage xMessage = { mainMESSAGE_BUTTON_SEL, ( unsigned long ) "Select Interrupt!" };\r
{\r
if( xAreDynamicPriorityTasksStillRunning() != pdPASS )\r
{\r
- xStatusMessage.lMessageValue = pdFAIL;\r
+ xStatusMessage.lMessageValue = mainERROR_DYNAMIC_TASKS;\r
}\r
\r
if( xAreComTestTasksStillRunning() != pdPASS )\r
{\r
- xStatusMessage.lMessageValue = pdFAIL;\r
+ xStatusMessage.lMessageValue = mainERROR_COM_TEST;\r
+ }\r
+ \r
+ if( xAreGenericQueueTasksStillRunning() != pdPASS )\r
+ {\r
+ xStatusMessage.lMessageValue = mainERROR_GEN_QUEUE_TEST;\r
}\r
\r
xQueueSendFromISR( xLCDQueue, &xStatusMessage, &lHigherPriorityTaskWoken );\r
\r
for( ;; );\r
}\r
+/*-----------------------------------------------------------*/\r
\r
+void vApplicationMallocFailedHook( void )\r
+{\r
+ for( ;; );\r
+}\r
\r
\r