]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/RISC-V-Qemu-sifive_e-FreedomStudio/main.c
Recreate the RISC-V-Qemu demo using Vanilla Eclipse in place of Freedom Studio as...
[freertos] / FreeRTOS / Demo / RISC-V-Qemu-sifive_e-FreedomStudio / main.c
index 5c820394b51c4cc8d1e70a8fc1e0d1efdc5fba15..07912293e2e09061bc8bc1ea630e3d169cc6cc5e 100644 (file)
@@ -73,7 +73,7 @@
 \r
 /* Set mainCREATE_SIMPLE_BLINKY_DEMO_ONLY to one to run the simple blinky demo,\r
 or 0 to run the more comprehensive test and demo application. */\r
-#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY     1\r
+#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY     0\r
 \r
 /*\r
  * main_blinky() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1.\r
@@ -85,17 +85,28 @@ or 0 to run the more comprehensive test and demo application. */
        extern void main_full( void );\r
 #endif /* #if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 */\r
 \r
-/* Prototypes for the standard FreeRTOS callback/hook functions implemented\r
-within this file.  See https://www.freertos.org/a00016.html */\r
+/*\r
+ * Prototypes for the standard FreeRTOS callback/hook functions implemented\r
+ * within this file.  See https://www.freertos.org/a00016.html\r
+ */\r
 void vApplicationMallocFailedHook( void );\r
 void vApplicationIdleHook( void );\r
 void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName );\r
 void vApplicationTickHook( void );\r
 \r
+/*\r
+ * Very simply polling write to the UART.  The full demo only writes single\r
+ * characters at a time so as not to disrupt the timing of the test and demo\r
+ * tasks.\r
+ */\r
+void vSendString( const char * pcString );\r
+\r
 /*-----------------------------------------------------------*/\r
 \r
 int main( void )\r
 {\r
+       vSendString( "Starting" );\r
+\r
        /* The mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is described at the top\r
        of this file. */\r
        #if( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 )\r
@@ -176,3 +187,15 @@ volatile uint32_t ulSetTo1ToExitFunction = 0;
                __asm volatile( "NOP" );\r
        }\r
 }\r
+/*-----------------------------------------------------------*/\r
+\r
+void vSendString( const char * pcString )\r
+{\r
+       while( *pcString != 0x00 )\r
+       {\r
+               while( UART0_REG( UART_REG_TXFIFO ) & 0x80000000 );\r
+               UART0_REG( UART_REG_TXFIFO ) = *pcString;\r
+               *pcString++;\r
+       }\r
+}\r
+\r