Nuvoton / Mbed OS NuMaker-mbed-SPIF-FileSystem-example
Revision:
5:af8e8a91a373
Parent:
4:df65a888a785
Child:
6:5904bcfd7c00
--- a/main.cpp	Mon Nov 04 18:40:57 2019 +0800
+++ b/main.cpp	Tue Nov 05 11:20:02 2019 +0800
@@ -77,8 +77,9 @@
 int main() {
     printf("--- Mbed OS filesystem example ---\n");
 
-    // Setup the irq in case we want to use it
-    irq.fall(erase);
+    // Setup the erase event on button press, use the event queue
+    // to avoid running in interrupt context
+    irq.fall(mbed_event_queue()->event(erase));
 
     // Try to mount the filesystem
     printf("Mounting the filesystem... ");