.

Revision:
12:a07d0af60cc6
Parent:
10:38d6b74b0eb7
Child:
25:65a9183a2178
diff -r 656a96b9981b -r a07d0af60cc6 main.cpp
--- a/main.cpp	Fri Mar 09 21:30:16 2018 +0000
+++ b/main.cpp	Thu Apr 05 15:30:17 2018 +0100
@@ -72,8 +72,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... ");