tick hook). */\r
#define mainCHECK_DELAY ( ( portTickType ) 5000 / portTICK_RATE_MS )\r
\r
+/* The toggle rate for the LED. */\r
+#define mainLED_TOGGLE_RATE ( ( portTickType ) 1000 / portTICK_RATE_MS )\r
+\r
/* Task priorities. */\r
#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 2 )\r
#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )\r
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )\r
#define mainUIP_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )\r
+#define mainFLASH_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 )\r
#define mainINTEGER_TASK_PRIORITY ( tskIDLE_PRIORITY )\r
#define mainGEN_QUEUE_TASK_PRIORITY ( tskIDLE_PRIORITY )\r
\r
*/\r
extern void vUSBTask( void *pvParameters );\r
\r
+/*\r
+ * Very basic task that does nothing but use delays to flash an LED.\r
+ */\r
+static void prvFlashTask( void *pvParameters );\r
+\r
/*\r
* Simply returns the current status message for display on served WEB pages.\r
*/\r
vStartQueuePeekTasks();\r
vStartRecursiveMutexTasks();\r
\r
+ /* Create the simple LED flash task. */\r
+ xTaskCreate( prvFlashTask, ( signed char * ) "Flash", configMINIMAL_STACK_SIZE, ( void * ) NULL, mainFLASH_TASK_PRIORITY, NULL );\r
+ \r
/* Create the USB task. */\r
-// xTaskCreate( vUSBTask, ( signed char * ) "USB", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( vUSBTask, ( signed char * ) "USB", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
\r
/* Create the uIP task. The WEB server runs in this task. */\r
xTaskCreate( vuIP_Task, ( signed char * ) "uIP", mainBASIC_WEB_STACK_SIZE, ( void * ) NULL, mainUIP_TASK_PRIORITY, NULL );\r
{\r
pcStatusMessage = "An error has been detected in the Mutex test/demo.";\r
}\r
- \r
+ }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvFlashTask( void *pvParameters )\r
+{\r
+portTickType xLastFlashTime;\r
+\r
+ /* We need to initialise xLastFlashTime prior to the first call to\r
+ vTaskDelayUntil(). */\r
+ xLastFlashTime = xTaskGetTickCount();\r
+\r
+ for(;;)\r
+ {\r
+ /* Simply toggle the LED between delays. */\r
+ vTaskDelayUntil( &xLastFlashTime, mainLED_TOGGLE_RATE );\r
vParTestToggleLED( 0 );\r
}\r
}\r
/* select main OSC, 12MHz, as the PLL clock source. */\r
SC->CLKSRCSEL = 0x1; \r
\r
- SC->PLL0CFG = 0x0b;\r
+ SC->PLL0CFG = 0x20031;\r
SC->PLL0FEED = PLLFEED_FEED1;\r
SC->PLL0FEED = PLLFEED_FEED2;\r
- \r
+ \r
/* Enable PLL, disconnected. */\r
SC->PLL0CON = 1; \r
SC->PLL0FEED = PLLFEED_FEED1;\r
SC->CCLKCFG = 0x03;\r
\r
/* Configure flash accelerator. */\r
- SC->FLASHCFG = 0x303a;\r
+ SC->FLASHCFG = 0x403a;\r
\r
/* Check lock bit status. */\r
while( ( ( SC->PLL0STAT & ( 1 << 26 ) ) == 0 ) ); \r