![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Bluetooth Connected TOF Sensor
Dependencies: BLE_API X_NUCLEO_6180XA1 X_NUCLEO_IDB0XA1 mbed
Fork of BLE_HeartRate_IDB0XA1 by
Diff: bricks/stop.cpp
- Revision:
- 28:def5e0f0fb06
diff -r 32267cee7cb8 -r def5e0f0fb06 bricks/stop.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bricks/stop.cpp Wed Feb 01 22:08:56 2017 +0000 @@ -0,0 +1,37 @@ +// stop.cpp - stop button functionality + +#include "bricks/stop.h" + +//============================================================================== +// Stop Button Functionality +//============================================================================== + + static bool flag; // stop indication flag + + static void cbButton(void) // button press callback + { + flag = true; + } + + void StopButton::set() // set stop flag + { + flag = true; + } + + void StopButton::clear() // clear stop flag + { + flag = false; + } + + bool StopButton::request() // stop requested? + { + return flag; + } + + StopButton::StopButton(PinName pin) : InterruptIn(pin) // constructor + { + clear(); + rise(&cbButton); + } + +// eof \ No newline at end of file