]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/RISC-V-Qemu-sifive_e-Eclipse-GCC/main.c
Update libraries and sundry check-ins ready for the V10.3.0 kernel release.
[freertos] / FreeRTOS / Demo / RISC-V-Qemu-sifive_e-Eclipse-GCC / main.c
index 07912293e2e09061bc8bc1ea630e3d169cc6cc5e..04c095bcecb8772ae6f088023d79e2698c4b290a 100644 (file)
@@ -50,7 +50,8 @@
  * This project has only been tested in the QEMU emulation of the HiFive board\r
  * from SiFive.\r
  *\r
- * Start QEMU using the following command line:\r
+ * NOTE - Requires QEMU 1908xx or higher.  Start QEMU using the following command \r
+ * line:\r
  *\r
  * [your_path_1]\qemu-system-riscv32 -kernel [your_path_2]\FreeRTOS\Demo\RISC-V-Qemu-sifive_e-FreedomStudio\Debug\RTOSDemo.elf -S -s -machine sifive_e\r
  *\r
@@ -73,7 +74,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     0\r
+#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY     1\r
 \r
 /*\r
  * main_blinky() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1.\r
@@ -82,6 +83,7 @@ or 0 to run the more comprehensive test and demo application. */
 #if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1\r
        extern void main_blinky( void );\r
 #else\r
+       #warning At the time of writing the QEMU MTIME behaviour is erratic, resulting in test failures.\r
        extern void main_full( void );\r
 #endif /* #if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 */\r
 \r
@@ -191,11 +193,13 @@ volatile uint32_t ulSetTo1ToExitFunction = 0;
 \r
 void vSendString( const char * pcString )\r
 {\r
+const uint32_t ulTxFifoFullBit = 0x80000000UL;\r
+\r
        while( *pcString != 0x00 )\r
        {\r
-               while( UART0_REG( UART_REG_TXFIFO ) & 0x80000000 );\r
+               while( ( UART0_REG( UART_REG_TXFIFO ) & ulTxFifoFullBit ) != 0UL );\r
                UART0_REG( UART_REG_TXFIFO ) = *pcString;\r
-               *pcString++;\r
+               pcString++;\r
        }\r
 }\r
 \r