]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/RISC-V-Qemu-sifive_e-Eclipse-GCC/main.c
Rework RISC-V QEMU example to use vanilla Eclipse in place of Freedom Studio. NOTE...
[freertos] / FreeRTOS / Demo / RISC-V-Qemu-sifive_e-Eclipse-GCC / main.c
index 07912293e2e09061bc8bc1ea630e3d169cc6cc5e..d274e16cc41107eae375bb8a90f65974df5895a7 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
@@ -191,11 +192,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