]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/ARM7_LPC2368_Eclipse/RTOSDemo/main.c
Start to remove unnecessary 'signed char *' casts from strings that are now just...
[freertos] / FreeRTOS / Demo / ARM7_LPC2368_Eclipse / RTOSDemo / main.c
index 973e73254f1856e841f54dd50418633c77126055..e6357c4115ceb16b3530767542b01f9240cd6327 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+    FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
     All rights reserved\r
 \r
     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
  * for messages - waking and displaying the messages as they arrive.\r
  *\r
  * "Check" hook -  This only executes every five seconds from the tick hook.\r
- * Its main function is to check that all the standard demo tasks are still \r
- * operational.  Should any unexpected behaviour within a demo task be discovered \r
- * the tick hook will write an error to the LCD (via the LCD task).  If all the \r
- * demo tasks are executing with their expected behaviour then the check task \r
+ * Its main function is to check that all the standard demo tasks are still\r
+ * operational.  Should any unexpected behaviour within a demo task be discovered\r
+ * the tick hook will write an error to the LCD (via the LCD task).  If all the\r
+ * demo tasks are executing with their expected behaviour then the check task\r
  * writes PASS to the LCD (again via the LCD task), as described above.\r
  *\r
  * "uIP" task -  This is the task that handles the uIP stack.  All TCP/IP\r
 #define mainBLOCK_Q_PRIORITY                           ( tskIDLE_PRIORITY + 2 )\r
 #define mainFLASH_PRIORITY                  ( tskIDLE_PRIORITY + 2 )\r
 #define mainCREATOR_TASK_PRIORITY           ( tskIDLE_PRIORITY + 3 )\r
-#define mainGEN_QUEUE_TASK_PRIORITY                    ( tskIDLE_PRIORITY ) \r
+#define mainGEN_QUEUE_TASK_PRIORITY                    ( tskIDLE_PRIORITY )\r
 \r
 /* Constants to setup the PLL. */\r
 #define mainPLL_MUL                    ( ( unsigned portLONG ) ( 8 - 1 ) )\r
 #define mainMAM_TIM_3          ( ( unsigned portCHAR ) 0x03 )\r
 #define mainMAM_MODE_FULL      ( ( unsigned portCHAR ) 0x02 )\r
 \r
-/* \r
+/*\r
  * The task that handles the uIP stack.  All TCP/IP processing is performed in\r
  * this task.\r
  */\r
 extern void vuIP_Task( void *pvParameters );\r
 \r
 /*\r
- * The LCD is written two by more than one task so is controlled by a \r
- * 'gatekeeper' task.  This is the only task that is actually permitted to \r
+ * The LCD is written two by more than one task so is controlled by a\r
+ * 'gatekeeper' task.  This is the only task that is actually permitted to\r
  * access the LCD directly.  Other tasks wanting to display a message send\r
  * the message to the gatekeeper.\r
  */\r
@@ -159,31 +159,31 @@ xQueueHandle xLCDQueue;
 int main( void )\r
 {\r
        prvSetupHardware();\r
-       \r
+\r
        /* Create the queue used by the LCD task.  Messages for display on the LCD\r
        are received via this queue. */\r
        xLCDQueue = xQueueCreate( mainQUEUE_SIZE, sizeof( xLCDMessage ) );\r
 \r
        /* Create the uIP task.  This uses the lwIP RTOS abstraction layer.*/\r
-    xTaskCreate( vuIP_Task, ( signed portCHAR * ) "uIP", mainBASIC_WEB_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );\r
+    xTaskCreate( vuIP_Task, "uIP", mainBASIC_WEB_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );\r
 \r
        /* Start the standard demo tasks. */\r
        vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
     vCreateBlockTimeTasks();\r
     vStartLEDFlashTasks( mainFLASH_PRIORITY );\r
     vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY );\r
-    vStartQueuePeekTasks();   \r
+    vStartQueuePeekTasks();\r
     vStartDynamicPriorityTasks();\r
 \r
        /* Start the tasks defined within this file/specific to this demo. */\r
-       xTaskCreate( vLCDTask, ( signed portCHAR * ) "LCD", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );\r
+       xTaskCreate( vLCDTask, "LCD", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY - 1, NULL );\r
 \r
        /* Start the scheduler. */\r
        vTaskStartScheduler();\r
 \r
     /* Will only get here if there was insufficient memory to create the idle\r
     task. */\r
-       return 0; \r
+       return 0;\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
@@ -200,7 +200,7 @@ static portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
        if( ulTicksSinceLastDisplay >= mainCHECK_DELAY )\r
        {\r
                ulTicksSinceLastDisplay = 0;\r
-               \r
+\r
                /* Has an error been found in any task? */\r
 \r
         if( xAreBlockingQueuesStillRunning() != pdTRUE )\r
@@ -217,17 +217,17 @@ static portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
                {\r
                        xMessage.pcMessage = "ERROR - GENQ";\r
                }\r
-               \r
+\r
                if( xAreQueuePeekTasksStillRunning() != pdTRUE )\r
                {\r
                        xMessage.pcMessage = "ERROR - PEEKQ";\r
-               }       \r
-               \r
+               }\r
+\r
                if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )\r
                {\r
                        xMessage.pcMessage = "ERROR - DYNAMIC";\r
                }\r
-        \r
+\r
         xMessage.xColumn++;\r
 \r
                /* Send the message to the LCD gatekeeper for display. */\r
@@ -244,7 +244,7 @@ xLCDMessage xMessage;
        /* Initialise the LCD and display a startup message. */\r
        LCD_init();\r
        LCD_cur_off();\r
-    LCD_cls();    \r
+    LCD_cls();\r
     LCD_gotoxy( 1, 1 );\r
     LCD_puts( "www.FreeRTOS.org" );\r
 \r
@@ -252,7 +252,7 @@ xLCDMessage xMessage;
        {\r
                /* Wait for a message to arrive that requires displaying. */\r
                while( xQueueReceive( xLCDQueue, &xMessage, portMAX_DELAY ) != pdPASS );\r
-               \r
+\r
                /* Display the message.  Print each message to a different position. */\r
                LCD_cls();\r
                LCD_gotoxy( ( xMessage.xColumn & 0x07 ) + 1, ( xMessage.xColumn & 0x01 ) + 1 );\r
@@ -268,17 +268,17 @@ static void prvSetupHardware( void )
                /* Remap the interrupt vectors to RAM if we are are running from RAM. */\r
                SCB_MEMMAP = 2;\r
        #endif\r
-       \r
+\r
        /* Disable the PLL. */\r
        PLLCON = 0;\r
        PLLFEED = mainPLL_FEED_BYTE1;\r
        PLLFEED = mainPLL_FEED_BYTE2;\r
-       \r
+\r
        /* Configure clock source. */\r
        SCS |= mainOSC_ENABLE;\r
        while( !( SCS & mainOSC_STAT ) );\r
-       CLKSRCSEL = mainOSC_SELECT; \r
-       \r
+       CLKSRCSEL = mainOSC_SELECT;\r
+\r
        /* Setup the PLL to multiply the XTAL input by 4. */\r
        PLLCFG = ( mainPLL_MUL | mainPLL_DIV );\r
        PLLFEED = mainPLL_FEED_BYTE1;\r
@@ -288,20 +288,20 @@ static void prvSetupHardware( void )
        PLLCON = mainPLL_ENABLE;\r
        PLLFEED = mainPLL_FEED_BYTE1;\r
        PLLFEED = mainPLL_FEED_BYTE2;\r
-       CCLKCFG = mainCPU_CLK_DIV;      \r
+       CCLKCFG = mainCPU_CLK_DIV;\r
        while( !( PLLSTAT & mainPLL_LOCK ) );\r
-       \r
+\r
        /* Connecting the clock. */\r
        PLLCON = mainPLL_CONNECT;\r
        PLLFEED = mainPLL_FEED_BYTE1;\r
        PLLFEED = mainPLL_FEED_BYTE2;\r
-       while( !( PLLSTAT & mainPLL_CONNECTED ) ); \r
-       \r
-       /* \r
+       while( !( PLLSTAT & mainPLL_CONNECTED ) );\r
+\r
+       /*\r
        This code is commented out as the MAM does not work on the original revision\r
        LPC2368 chips.  If using Rev B chips then you can increase the speed though\r
        the use of the MAM.\r
-       \r
+\r
        Setup and turn on the MAM.  Three cycle access is used due to the fast\r
        PLL used.  It is possible faster overall performance could be obtained by\r
        tuning the MAM and PLL settings.\r
@@ -309,7 +309,7 @@ static void prvSetupHardware( void )
        MAMTIM = mainMAM_TIM_3;\r
        MAMCR = mainMAM_MODE_FULL;\r
        */\r
-       \r
+\r
        /* Setup the led's on the MCB2300 board */\r
        vParTestInitialise();\r
 }\r