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:
- 68:13e2343452d5
- Parent:
- 60:b899414e1d34
- Child:
- 69:9d6ecd584a0c
--- a/main.cpp	Thu Sep 01 19:33:25 2016 +0000
+++ b/main.cpp	Fri Sep 02 07:41:33 2016 +0900
@@ -258,16 +258,10 @@
 				const uint8_t batteryPercentage = BatteryLevel::readBatteryPercentage(batteryVoltage);
 				const bool isLowBattery = batteryVoltage < BatteryLevel::BATTERY_LOW;
 	
-				DEBUG_PRINTF("%d%% [%d:%s] %s\r\n",
-					batteryPercentage,
-					HIDController::status(),
-					HIDController::statusString(),
-					isLowBattery ? "LOWBAT" : "WFE"
-				);
-	
 				HIDController::updateBatteryLevel(batteryPercentage, batteryVoltage * 1000);
 	
 				if (isLowBattery) {
+					DEBUG_PRINTF("LOWBAT %f %d%%", batteryVoltage, batteryPercentage);
 					powerOff();
 				}
 			}
@@ -275,7 +269,11 @@
 			if (HIDController::status() == DISCONNECTED) {
 				HIDController::initializeConnection(false);
 			}
-			
+
+			DEBUG_PRINTF("WFE [%d:%s]\r\n",
+				HIDController::status(),
+				HIDController::statusString()
+			);
 			HIDController::waitForEvent();
 		}
 	}