]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/CORTEX_LM3Sxxxx_IAR_Keil/main.c
Update version number to 8.1.2 after moving the defaulting of configUSE_PORT_OPTIMISE...
[freertos] / FreeRTOS / Demo / CORTEX_LM3Sxxxx_IAR_Keil / main.c
index ccec25f510ac72e5ffe8b7adcbc108ad819ecd39..34d4f7999912ce7cfacfad8d7ac059b6b8ed6d7b 100644 (file)
@@ -1,5 +1,6 @@
 /*\r
-    FreeRTOS V7.5.1 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+    FreeRTOS V8.1.2 - Copyright (C) 2014 Real Time Engineers Ltd.\r
+    All rights reserved\r
 \r
     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
 \r
     the terms of the GNU General Public License (version 2) as published by the\r
     Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.\r
 \r
-    >>! NOTE: The modification to the GPL is included to allow you to distribute\r
-    >>! a combined work that includes FreeRTOS without being obliged to provide\r
-    >>! the source code for proprietary components outside of the FreeRTOS\r
-    >>! kernel.\r
+    >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
+    >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
+    >>!   obliged to provide the source code for proprietary components     !<<\r
+    >>!   outside of the FreeRTOS kernel.                                   !<<\r
 \r
     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
@@ -149,12 +150,13 @@ and the TCP/IP stack together cannot be accommodated with the 32K size limit. */
 #include "recmutex.h"\r
 #include "IntQueue.h"\r
 #include "QueueSet.h"\r
+#include "EventGroupsDemo.h"\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
 /* The time between cycles of the 'check' functionality (defined within the\r
 tick hook. */\r
-#define mainCHECK_DELAY                                                ( ( portTickType ) 5000 / portTICK_RATE_MS )\r
+#define mainCHECK_DELAY                                                ( ( TickType_t ) 5000 / portTICK_PERIOD_MS )\r
 \r
 /* Size of the stack allocated to the uIP task. */\r
 #define mainBASIC_WEB_STACK_SIZE            ( configMINIMAL_STACK_SIZE * 3 )\r
@@ -180,7 +182,7 @@ time. */
 \r
 /* The period of the system clock in nano seconds.  This is used to calculate\r
 the jitter time in nano seconds. */\r
-#define mainNS_PER_CLOCK                                       ( ( unsigned portLONG ) ( ( 1.0 / ( double ) configCPU_CLOCK_HZ ) * 1000000000.0 ) )\r
+#define mainNS_PER_CLOCK                                       ( ( unsigned long ) ( ( 1.0 / ( double ) configCPU_CLOCK_HZ ) * 1000000000.0 ) )\r
 \r
 /* Constants used when writing strings to the display. */\r
 #define mainCHARACTER_HEIGHT                           ( 9 )\r
@@ -220,17 +222,17 @@ extern void vSetupHighFrequencyTimer( void );
 /*\r
  * Hook functions that can get called by the kernel.\r
  */\r
-void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed portCHAR *pcTaskName );\r
+void vApplicationStackOverflowHook( TaskHandle_t *pxTask, signed char *pcTaskName );\r
 void vApplicationTickHook( void );\r
 \r
 \r
 /*-----------------------------------------------------------*/\r
 \r
 /* The queue used to send messages to the OLED task. */\r
-xQueueHandle xOLEDQueue;\r
+QueueHandle_t xOLEDQueue;\r
 \r
 /* The welcome text. */\r
-const portCHAR * const pcWelcomeMessage = "   www.FreeRTOS.org";\r
+const char * const pcWelcomeMessage = "   www.FreeRTOS.org";\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
@@ -259,6 +261,7 @@ int main( void )
        vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
        vStartQueuePeekTasks();\r
        vStartQueueSetTasks();\r
+       vStartEventGroupTasks();\r
 \r
        /* Exclude some tasks if using the kickstart version to ensure we stay within\r
        the 32K code size limit. */\r
@@ -268,7 +271,7 @@ int main( void )
                PHY. */\r
                if( SysCtlPeripheralPresent( SYSCTL_PERIPH_ETH ) )\r
                {\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
        }\r
        #endif\r
@@ -276,7 +279,7 @@ int main( void )
 \r
 \r
        /* Start the tasks defined within this file/specific to this demo. */\r
-       xTaskCreate( vOLEDTask, ( signed portCHAR * ) "OLED", mainOLED_TASK_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+       xTaskCreate( vOLEDTask, "OLED", mainOLED_TASK_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
 \r
        /* The suicide tasks must be created last as they need to know how many\r
        tasks were running prior to their creation in order to ascertain whether\r
@@ -322,7 +325,7 @@ void prvSetupHardware( void )
 void vApplicationTickHook( void )\r
 {\r
 static xOLEDMessage xMessage = { "PASS" };\r
-static unsigned portLONG ulTicksSinceLastDisplay = 0;\r
+static unsigned long ulTicksSinceLastDisplay = 0;\r
 portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;\r
 \r
        /* Called from every tick interrupt.  Have enough ticks passed to make it\r
@@ -377,6 +380,10 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
                {\r
                        xMessage.pcMessage = "ERROR IN Q SET";\r
                }\r
+               else if( xAreEventGroupTasksStillRunning() != pdTRUE )\r
+               {\r
+                       xMessage.pcMessage = "ERROR IN EVNT GRP";\r
+               }\r
 \r
                configASSERT( strcmp( ( const char * ) xMessage.pcMessage, "PASS" ) == 0 );\r
 \r
@@ -388,22 +395,25 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
        /* Write to a queue that is in use as part of the queue set demo to\r
        demonstrate using queue sets from an ISR. */\r
        vQueueSetAccessQueueSetFromISR();\r
+\r
+       /* Call the event group ISR tests. */\r
+       vPeriodicEventGroupsProcessing();\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
 void vOLEDTask( void *pvParameters )\r
 {\r
 xOLEDMessage xMessage;\r
-unsigned portLONG ulY, ulMaxY;\r
-static portCHAR cMessage[ mainMAX_MSG_LEN ];\r
-extern volatile unsigned portLONG ulMaxJitter;\r
-const unsigned portCHAR *pucImage;\r
+unsigned long ulY, ulMaxY;\r
+static char cMessage[ mainMAX_MSG_LEN ];\r
+extern volatile unsigned long ulMaxJitter;\r
+const unsigned char *pucImage;\r
 \r
 /* Functions to access the OLED.  The one used depends on the dev kit\r
 being used. */\r
-void ( *vOLEDInit )( unsigned portLONG ) = NULL;\r
-void ( *vOLEDStringDraw )( const portCHAR *, unsigned portLONG, unsigned portLONG, unsigned portCHAR ) = NULL;\r
-void ( *vOLEDImageDraw )( const unsigned portCHAR *, unsigned portLONG, unsigned portLONG, unsigned portLONG, unsigned portLONG ) = NULL;\r
+void ( *vOLEDInit )( unsigned long ) = NULL;\r
+void ( *vOLEDStringDraw )( const char *, unsigned long, unsigned long, unsigned char ) = NULL;\r
+void ( *vOLEDImageDraw )( const unsigned char *, unsigned long, unsigned long, unsigned long, unsigned long ) = NULL;\r
 void ( *vOLEDClear )( void ) = NULL;\r
 \r
        /* Map the OLED access functions to the driver functions that are appropriate\r
@@ -467,7 +477,7 @@ void ( *vOLEDClear )( void ) = NULL;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed portCHAR *pcTaskName )\r
+void vApplicationStackOverflowHook( TaskHandle_t *pxTask, signed char *pcTaskName )\r
 {\r
        ( void ) pxTask;\r
        ( void ) pcTaskName;\r