Nuvoton / Mbed OS NuMaker-mbed-SPIF-FileSystem-example
Revision:
8:47803c22154e
Parent:
6:5904bcfd7c00
Child:
9:6ce52eb7b6c4
--- a/main.cpp	Wed Apr 29 16:41:09 2020 +0800
+++ b/main.cpp	Wed Apr 29 16:47:46 2020 +0800
@@ -41,7 +41,8 @@
 // #include "FATFileSystem.h"
 // FATFileSystem fs("fs");
 
-
+// Support bare-metal build in which RTOS will be absent
+#if MBED_CONF_RTOS_PRESENT
 // Set up the button to trigger an erase
 InterruptIn irq(BUTTON1);
 void erase() {
@@ -69,15 +70,17 @@
         error("error: %s (%d)\n", strerror(-err), err);
     }
 }
-
+#endif
 
 // Entry point for the example
 int main() {
     printf("--- Mbed OS filesystem example ---\n");
 
+#if MBED_CONF_RTOS_PRESENT
     // Setup the erase event on button press, use the event queue
     // to avoid running in interrupt context
     irq.fall(mbed_event_queue()->event(erase));
+#endif
 
     // Try to mount the filesystem
     printf("Mounting the filesystem... ");