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 mbed-dev nRF51822
Diff: main.cpp
- Revision:
- 45:f4be69c936f6
- Parent:
- 43:4de3870b39cb
- Child:
- 47:5bf2ae8cc710
--- a/main.cpp Sat Aug 27 17:58:45 2016 +0900
+++ b/main.cpp Sun Aug 28 14:32:28 2016 +0000
@@ -255,7 +255,7 @@
// use timer1 to use wait 5ms
timeout.attach_us(wakeupKeyIntervalSleep, 5000);
keyIntervalInterrupt = false;
- while (!keyIntervalInterrupt) sleep();
+ while (!keyIntervalInterrupt) HIDController::waitForEvent();
}
} else {
if (!updateStatudLedEnabled) updateStatusLed();
@@ -276,6 +276,10 @@
if (isLowBattery) {
powerOff();
}
+
+ if (HIDController::status() == DISCONNECTED) {
+ HIDController::initializeConnection(false);
+ }
if (DEBUG_BLE_INTERRUPT) {
HIDController::waitForEvent();