Update
Dependencies: mbed mbed-rtos X_NUCLEO_IHM02A1
Diff: Buttons.cpp
- Revision:
- 42:0aaa3b282b6e
- Parent:
- 38:3776ee18e56f
diff -r 1a2ba8849aa6 -r 0aaa3b282b6e Buttons.cpp --- a/Buttons.cpp Wed May 15 00:47:19 2019 +0000 +++ b/Buttons.cpp Thu May 16 20:10:32 2019 +0000 @@ -5,66 +5,6 @@ extern DigitalIn Button2; -/* -extern volatile bool buttonSTART_pressed; // Used in the main loop -extern volatile bool buttonSTART_enabled; // Used for debouncing -extern Timeout buttonSTART_timeout; // Used for debouncing - -extern volatile bool buttonAbbruch_pressed; // Used in the main loop -extern volatile bool buttonAbbruch_enabled; // Used for debouncing -extern Timeout buttonAbbruch_timeout; // Used for debouncing - -*/ - -/* --------------------------- START_BUTTON --------------------------------- -// Enables button when bouncing is over -void buttonSTART_enabled_cb(void) -{ - buttonSTART_enabled = true; -} -void buttonSTART_diable_cb(void) -{ - buttonSTART_enabled = false; -} - -// ISR handling button pressed event -void buttonSTART_onpressed_cb(void) -{ - if (buttonSTART_enabled) { // Disabled while the button is bouncing - buttonSTART_enabled = false; - buttonSTART_pressed = true; // To be read by the main loop - - buttonSTART_timeout.attach(callback(buttonSTART_enabled_cb), 0.300); // Debounce time 300 ms - } -} -/* ---------------------------------- END ----------------------------------- */ - - - - -/* ------------------------- ABBRUCH_BUTTON --------------------------------- -// Enables button when bouncing is over -void buttonAbbruch_enabled_cb(void) -{ - buttonAbbruch_enabled = true; -} -void buttonAbbruch_diable_cb(void) -{ - buttonAbbruch_enabled = false; -} - -// ISR handling button pressed event -void buttonAbbruch_onpressed_cb(void) -{ - if (buttonAbbruch_enabled) { // Disabled while the button is bouncing - buttonAbbruch_enabled = false; - buttonAbbruch_pressed = true; // To be read by the main loop - - buttonAbbruch_timeout.attach(callback(buttonAbbruch_enabled_cb), 0.300); // Debounce time 300 ms - } -} -*/ - bool get_Button_1() { if(Button1 == 1)