![](/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
bricks/stop.cpp@28:def5e0f0fb06, 2017-02-01 (annotated)
- Committer:
- hux
- Date:
- Wed Feb 01 22:08:56 2017 +0000
- Revision:
- 28:def5e0f0fb06
First S16_Blue_ToF application which runs nicely!; Digital display can be switched on/off with red slider
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hux | 28:def5e0f0fb06 | 1 | // stop.cpp - stop button functionality |
hux | 28:def5e0f0fb06 | 2 | |
hux | 28:def5e0f0fb06 | 3 | #include "bricks/stop.h" |
hux | 28:def5e0f0fb06 | 4 | |
hux | 28:def5e0f0fb06 | 5 | //============================================================================== |
hux | 28:def5e0f0fb06 | 6 | // Stop Button Functionality |
hux | 28:def5e0f0fb06 | 7 | //============================================================================== |
hux | 28:def5e0f0fb06 | 8 | |
hux | 28:def5e0f0fb06 | 9 | static bool flag; // stop indication flag |
hux | 28:def5e0f0fb06 | 10 | |
hux | 28:def5e0f0fb06 | 11 | static void cbButton(void) // button press callback |
hux | 28:def5e0f0fb06 | 12 | { |
hux | 28:def5e0f0fb06 | 13 | flag = true; |
hux | 28:def5e0f0fb06 | 14 | } |
hux | 28:def5e0f0fb06 | 15 | |
hux | 28:def5e0f0fb06 | 16 | void StopButton::set() // set stop flag |
hux | 28:def5e0f0fb06 | 17 | { |
hux | 28:def5e0f0fb06 | 18 | flag = true; |
hux | 28:def5e0f0fb06 | 19 | } |
hux | 28:def5e0f0fb06 | 20 | |
hux | 28:def5e0f0fb06 | 21 | void StopButton::clear() // clear stop flag |
hux | 28:def5e0f0fb06 | 22 | { |
hux | 28:def5e0f0fb06 | 23 | flag = false; |
hux | 28:def5e0f0fb06 | 24 | } |
hux | 28:def5e0f0fb06 | 25 | |
hux | 28:def5e0f0fb06 | 26 | bool StopButton::request() // stop requested? |
hux | 28:def5e0f0fb06 | 27 | { |
hux | 28:def5e0f0fb06 | 28 | return flag; |
hux | 28:def5e0f0fb06 | 29 | } |
hux | 28:def5e0f0fb06 | 30 | |
hux | 28:def5e0f0fb06 | 31 | StopButton::StopButton(PinName pin) : InterruptIn(pin) // constructor |
hux | 28:def5e0f0fb06 | 32 | { |
hux | 28:def5e0f0fb06 | 33 | clear(); |
hux | 28:def5e0f0fb06 | 34 | rise(&cbButton); |
hux | 28:def5e0f0fb06 | 35 | } |
hux | 28:def5e0f0fb06 | 36 | |
hux | 28:def5e0f0fb06 | 37 | // eof |