HelloWorld with Button

Fork of events_ex_1 by mbed_example

Files at this revision

API Documentation at this revision

Comitter:
rafalmag
Date:
Thu Mar 08 23:04:59 2018 +0000
Parent:
3:f3c40f098a11
Commit message:
fixed compiler warnings

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
diff -r f3c40f098a11 -r 18e37cfe2fa1 main.cpp
--- a/main.cpp	Tue Mar 06 23:46:03 2018 +0000
+++ b/main.cpp	Thu Mar 08 23:04:59 2018 +0000
@@ -3,6 +3,7 @@
 
 
 DigitalOut led1(LED1);
+Thread thread;
 
 InterruptIn button1(USER_BUTTON);
 volatile bool button1_pressed = false; // Used in the main loop
@@ -27,7 +28,7 @@
     }
 }
 
-void led_thread(void const *args)
+void led_thread()
 {
     while (true) {
         if(button1.read()==1) {
@@ -46,8 +47,8 @@
     button1.mode(PullUp); // Activate pull-up
     button1.fall(callback(button1_onEvent_cb)); // Attach ISR to handle button press event
     button1.rise(callback(button1_onEvent_cb)); // Attach ISR to handle button rise event
-
-    Thread thread(led_thread);
+    Thread thread;
+    thread.start(led_thread);
 
     int idx = 0; // Just for printf below
 
diff -r f3c40f098a11 -r 18e37cfe2fa1 mbed-os.lib
--- a/mbed-os.lib	Tue Mar 06 23:46:03 2018 +0000
+++ b/mbed-os.lib	Thu Mar 08 23:04:59 2018 +0000
@@ -1,1 +1,1 @@
-https://github.com/ARMmbed/mbed-os/#c9e63f14085f5751ff5ead79a7c0382d50a813a2
+https://github.com/ARMmbed/mbed-os/#5f6572179d66ce4c09d6517b659ac51133cc980d