]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/RL78_RL78G13_Promo_Board_IAR/main.c
Minor updates to demo projects to ensure correct building with V8 rc1.
[freertos] / FreeRTOS / Demo / RL78_RL78G13_Promo_Board_IAR / main.c
index b8875d3bb5ebbfc4cf2e0a9633f53a7a8ca5ded3..91d45f46c05821707b8f82921db31d0c934db677 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
     FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
     ***************************************************************************\r
 \r
 \r
-    http://www.FreeRTOS.org - Documentation, books, training, latest versions, \r
+    http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
     license and Real Time Engineers Ltd. contact details.\r
 \r
     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
     including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
     fully thread aware and reentrant UDP/IP stack.\r
 \r
-    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High \r
-    Integrity Systems, who sell the code with commercial support, \r
+    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
+    Integrity Systems, who sell the code with commercial support,\r
     indemnification and middleware, under the OpenRTOS brand.\r
-    \r
-    http://www.SafeRTOS.com - High Integrity Systems also provide a safety \r
-    engineered and independently SIL3 certified version for use in safety and \r
+\r
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
+    engineered and independently SIL3 certified version for use in safety and\r
     mission critical applications that require provable dependability.\r
 */\r
 \r
@@ -200,11 +200,11 @@ static xTimerHandle xDemoTimer = NULL;
 /* This variable is incremented each time the demo timer expires. */\r
 static volatile unsigned long ulDemoSoftwareTimerCounter = 0UL;\r
 \r
-/* RL78/G13 Option Byte Definition. Watchdog disabled, LVI enabled, OCD interface\r
+/* RL78 Option Byte Definition. Watchdog disabled, LVI enabled, OCD interface\r
 enabled. */\r
 __root __far const unsigned char OptionByte[] @ 0x00C0 =\r
 {\r
-       WATCHDOG_DISABLED, LVI_ENABLED, RESERVED_FF, OCD_ENABLED\r
+       0x6eU, 0xffU, 0xe8U, 0x85U\r
 };\r
 \r
 /* Security byte definition */\r
@@ -228,7 +228,7 @@ short main( void )
 \r
        /* Create the RegTest tasks as described at the top of this file. */\r
        xTaskCreate( vRegTest1, "Reg1", configMINIMAL_STACK_SIZE, NULL, 0, NULL );\r
-       xTaskCreate( vRegTest2, "Reg2", configMINIMAL_STACK_SIZE, NULL, 0, NULL );      \r
+       xTaskCreate( vRegTest2, "Reg2", configMINIMAL_STACK_SIZE, NULL, 0, NULL );\r
 \r
        /* Create the software timer that performs the 'check' functionality,\r
        as described at the top of this file. */\r
@@ -238,7 +238,7 @@ short main( void )
                                                                ( void * ) 0,                                           /* The ID is not used, so can be set to anything. */\r
                                                                prvCheckTimerCallback                           /* The callback function that inspects the status of all the other tasks. */\r
                                                          );\r
-                                                       \r
+\r
        /* Create the software timer that just increments a variable for demo\r
        purposes. */\r
        xDemoTimer = xTimerCreate( "DemoTimer",/* A text name, purely to help debugging. */\r
@@ -247,12 +247,12 @@ short main( void )
                                                                ( void * ) 0,                                           /* The ID is not used, so can be set to anything. */\r
                                                                prvDemoTimerCallback                            /* The callback function that inspects the status of all the other tasks. */\r
                                                          );\r
-       \r
+\r
        /* Start both the check timer and the demo timer.  The timers won't actually\r
        start until the scheduler is started. */\r
        xTimerStart( xCheckTimer, mainDONT_BLOCK );\r
        xTimerStart( xDemoTimer, mainDONT_BLOCK );\r
-       \r
+\r
        /* Finally start the scheduler running. */\r
        vTaskStartScheduler();\r
 \r
@@ -281,12 +281,12 @@ static portBASE_TYPE xChangedTimerPeriodAlready = pdFALSE, xErrorStatus = pdPASS
        {\r
                xErrorStatus = pdFAIL;\r
        }\r
-       \r
+\r
        if( xArePollingQueuesStillRunning() != pdTRUE )\r
        {\r
                xErrorStatus = pdFAIL;\r
        }\r
-       \r
+\r
        if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )\r
        {\r
                xErrorStatus = pdFAIL;\r
@@ -297,7 +297,7 @@ static portBASE_TYPE xChangedTimerPeriodAlready = pdFALSE, xErrorStatus = pdPASS
        {\r
                xErrorStatus = pdFAIL;\r
        }\r
-       \r
+\r
        /* Ensure that the demo software timer has expired\r
        mainDEMO_TIMER_INCREMENTS_PER_CHECK_TIMER_TIMEOUT times in between\r
        each call of this function.  A critical section is not required to access\r
@@ -314,7 +314,7 @@ static portBASE_TYPE xChangedTimerPeriodAlready = pdFALSE, xErrorStatus = pdPASS
        {\r
                ulDemoSoftwareTimerCounter = 0UL;\r
        }\r
-       \r
+\r
        if( ( xErrorStatus == pdFAIL ) && ( xChangedTimerPeriodAlready == pdFALSE ) )\r
        {\r
                /* An error has occurred, but the timer's period has not yet been changed,\r
@@ -322,13 +322,13 @@ static portBASE_TYPE xChangedTimerPeriodAlready = pdFALSE, xErrorStatus = pdPASS
                timer's period means the LED will toggle at a faster rate, giving a\r
                visible indication that something has gone wrong. */\r
                xChangedTimerPeriodAlready = pdTRUE;\r
-                       \r
+\r
                /* This call to xTimerChangePeriod() uses a zero block time.  Functions\r
                called from inside of a timer callback function must *never* attempt to\r
                block. */\r
                xTimerChangePeriod( xCheckTimer, ( mainERROR_CHECK_TIMER_PERIOD_MS ), mainDONT_BLOCK );\r
        }\r
-       \r
+\r
        /* Toggle the LED.  The toggle rate will depend on whether or not an error\r
        has been found in any tasks. */\r
        mainLED_0 = !mainLED_0;\r
@@ -350,58 +350,58 @@ unsigned char ucResetFlag = RESF;
                /* Set fMX */\r
                CMC = 0x00;\r
                MSTOP = 1U;\r
-               \r
+\r
                /* Set fMAIN */\r
                MCM0 = 0U;\r
-               \r
+\r
                /* Set fSUB */\r
                XTSTOP = 1U;\r
                OSMC = 0x10;\r
-               \r
+\r
                /* Set fCLK */\r
                CSS = 0U;\r
-               \r
+\r
                /* Set fIH */\r
                HIOSTOP = 0U;\r
        }\r
        #else\r
        {\r
-               unsigned char ucTempStabset, ucTempStabWait;    \r
+               unsigned char ucTempStabset, ucTempStabWait;\r
 \r
                /* Set fMX */\r
                CMC = 0x41;\r
                OSTS = 0x07;\r
                MSTOP = 0U;\r
                ucTempStabset = 0xFF;\r
-               \r
+\r
                do\r
                {\r
                        ucTempStabWait = OSTC;\r
                        ucTempStabWait &= ucTempStabset;\r
                }\r
                while( ucTempStabWait != ucTempStabset );\r
-               \r
+\r
                /* Set fMAIN */\r
                MCM0 = 1U;\r
-               \r
+\r
                /* Set fSUB */\r
                XTSTOP = 1U;\r
                OSMC = 0x10;\r
-               \r
+\r
                /* Set fCLK */\r
                CSS = 0U;\r
-               \r
+\r
                /* Set fIH */\r
                HIOSTOP = 0U;\r
        }\r
        #endif /* configCLOCK_SOURCE == 1 */\r
-       \r
+\r
        /* LED port initialization - set port register. */\r
        P7 &= 0x7F;\r
-       \r
+\r
        /* Set port mode register. */\r
        PM7 &= 0x7F;\r
-       \r
+\r
        /* Switch pin initialization - enable pull-up resistor. */\r
        PU12_bit.no0  = 1;\r
 \r
@@ -457,6 +457,6 @@ volatile size_t xFreeHeapSpace;
        management options.  If there is a lot of heap memory free then the\r
        configTOTAL_HEAP_SIZE value in FreeRTOSConfig.h can be reduced to free up\r
        RAM. */\r
-       xFreeHeapSpace = xPortGetFreeHeapSize();        \r
+       xFreeHeapSpace = xPortGetFreeHeapSize();\r
 }\r
 \r