]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/CORTEX_LM3Sxxxx_IAR_Keil/main.c
Update the LM3Sxxxx_IAR_Keil demo so the IAR project writes to the UART and executes...
[freertos] / FreeRTOS / Demo / CORTEX_LM3Sxxxx_IAR_Keil / main.c
index 0e4426cfb4c35145d1725253160e8bd88967ed40..825dcbb519a763a2a7794b71aa7dae817232efac 100644 (file)
  *\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
@@ -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