Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BLE_API X_NUCLEO_6180XA1 X_NUCLEO_IDB0XA1 mbed
Fork of BLE_HeartRate_IDB0XA1 by
Diff: bricks/stop.cpp
- Revision:
- 28:def5e0f0fb06
--- /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
