]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/CORTEX_LM3Sxxxx_IAR_Keil/main.c
Update version number in readiness for V10.3.0 release. Sync SVN with reviewed releas...
[freertos] / FreeRTOS / Demo / CORTEX_LM3Sxxxx_IAR_Keil / main.c
index ccfe58b4dd9fb4e1ea18167c6148d738fa3f022f..4e39a252c0985b0bce3f314cc7337bc36577daef 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
- * FreeRTOS Kernel V10.0.1\r
- * Copyright (C) 2017 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
+ * FreeRTOS Kernel V10.3.0\r
+ * Copyright (C) 2020 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
  *\r
  * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
  * this software and associated documentation files (the "Software"), to deal in\r
  *\r
  * "uIP" task -  This is the task that handles the uIP stack.  All TCP/IP\r
  * processing is performed in this task.\r
+ *\r
+ * Use the following command to execute in QEMU from the IAR IDE:\r
+ * qemu-system-arm -machine lm3s6965evb -s -S -kernel [pat_to]\RTOSDemo.out\r
+ * and set IAR connect GDB server to "localhost,1234" in project debug options.\r
  */\r
 \r
-\r
-\r
-\r
 /*************************************************************************\r
  * Please ensure to read http://www.freertos.org/portlm3sx965.html\r
  * which provides information on configuring and running this demo for the\r
@@ -89,12 +90,14 @@ and the TCP/IP stack together cannot be accommodated with the 32K size limit. */
 #include "hw_memmap.h"\r
 #include "hw_types.h"\r
 #include "hw_sysctl.h"\r
+#include "hw_uart.h"\r
 #include "sysctl.h"\r
 #include "gpio.h"\r
 #include "grlib.h"\r
 #include "rit128x96x4.h"\r
 #include "osram128x64x4.h"\r
 #include "formike128x128x16.h"\r
+#include "uart.h"\r
 \r
 /* Demo app includes. */\r
 #include "death.h"\r
@@ -185,6 +188,7 @@ extern void vSetupHighFrequencyTimer( void );
 void vApplicationStackOverflowHook( TaskHandle_t *pxTask, signed char *pcTaskName );\r
 void vApplicationTickHook( void );\r
 \r
+static void prvPrintString( const char * pcString );\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
@@ -220,7 +224,7 @@ int main( void )
        vStartQueuePeekTasks();\r
        vStartQueueSetTasks();\r
        vStartEventGroupTasks();\r
-       vStartMessageBufferTasks();\r
+       vStartMessageBufferTasks( configMINIMAL_STACK_SIZE );\r
        vStartStreamBufferTasks();\r
 \r
        /* Exclude some tasks if using the kickstart version to ensure we stay within\r
@@ -244,8 +248,8 @@ int main( void )
        or not the correct/expected number of tasks are running at any given time. */\r
        vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );\r
 \r
-       /* Uncomment the following line to configure the high frequency interrupt \r
-       used to measure the interrupt jitter time. \r
+       /* Uncomment the following line to configure the high frequency interrupt\r
+       used to measure the interrupt jitter time.\r
        vSetupHighFrequencyTimer(); */\r
 \r
        /* Start the scheduler. */\r
@@ -277,6 +281,11 @@ void prvSetupHardware( void )
        GPIOPadConfigSet( GPIO_PORTF_BASE, (GPIO_PIN_2 | GPIO_PIN_3 ), GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD );\r
 \r
        vParTestInitialise();\r
+\r
+       /* Initialise the UART - QEMU usage does not seem to require this\r
+       initialisation. */\r
+       SysCtlPeripheralEnable( SYSCTL_PERIPH_UART0 );\r
+       UARTEnable( UART0_BASE );\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
@@ -343,8 +352,6 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
                        xMessage.pcMessage = "ERROR IN EVNT GRP";\r
                }\r
 \r
-               configASSERT( strcmp( ( const char * ) xMessage.pcMessage, "PASS" ) == 0 );\r
-\r
                /* Send the message to the OLED gatekeeper for display. */\r
                xHigherPriorityTaskWoken = pdFALSE;\r
                xQueueSendFromISR( xOLEDQueue, &xMessage, &xHigherPriorityTaskWoken );\r
@@ -359,6 +366,16 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
+static void prvPrintString( const char * pcString )\r
+{\r
+       while( *pcString != 0x00 )\r
+       {\r
+               UARTCharPut( UART0_BASE, *pcString );\r
+               pcString++;\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
 void vOLEDTask( void *pvParameters )\r
 {\r
 xOLEDMessage xMessage;\r
@@ -431,6 +448,7 @@ void ( *vOLEDClear )( void ) = NULL;
                high priority time test. */\r
                sprintf( cMessage, "%s [%uns]", xMessage.pcMessage, ulMaxJitter * mainNS_PER_CLOCK );\r
                vOLEDStringDraw( cMessage, 0, ulY, mainFULL_SCALE );\r
+               prvPrintString( cMessage );\r
        }\r
 }\r
 /*-----------------------------------------------------------*/\r
@@ -497,7 +515,7 @@ void vApplicationGetTimerTaskMemory( StaticTask_t **ppxTimerTaskTCBBuffer, Stack
 function then they must be declared static - otherwise they will be allocated on\r
 the stack and so not exists after this function exits. */\r
 static StaticTask_t xTimerTaskTCB;\r
-static StackType_t uxTimerTaskStack[ configTIMER_TASK_STACK_DEPTH ];   \r
+static StackType_t uxTimerTaskStack[ configTIMER_TASK_STACK_DEPTH ];\r
 \r
        /* Pass out a pointer to the StaticTask_t structure in which the Timer\r
        task's state will be stored. */\r