aboutsummaryrefslogtreecommitdiff
path: root/source/Screen.cpp
diff options
context:
space:
mode:
authorJakob Stendahl <jakob.stendahl@outlook.com>2021-06-08 00:56:19 +0200
committerJakob Stendahl <jakob.stendahl@outlook.com>2021-06-08 00:56:19 +0200
commit820e89ead9577c7aa4b7ef10f363daf8a28247ac (patch)
tree8006e48de8129e836ee45ef4516a036625949062 /source/Screen.cpp
parente9a5544db7be5e461b92743b37adcc77162483b7 (diff)
downloadhoverbit-ble-820e89ead9577c7aa4b7ef10f363daf8a28247ac.tar.gz
hoverbit-ble-820e89ead9577c7aa4b7ef10f363daf8a28247ac.zip
:sparkles: Do lots of small tweaks
Diffstat (limited to 'source/Screen.cpp')
-rw-r--r--source/Screen.cpp38
1 files changed, 5 insertions, 33 deletions
diff --git a/source/Screen.cpp b/source/Screen.cpp
index ad52247..f961994 100644
--- a/source/Screen.cpp
+++ b/source/Screen.cpp
@@ -179,9 +179,6 @@ void HoverBitDisplay::update() {
if (isPause) { return; }
int batteryMilliVolt = controller.GetBatteryVoltage();
- flipFrame = (uBit.systemTime() - tmpTimer) > 1000;
- if (flipFrame) { tmpTimer = uBit.systemTime(); }
-
if ((((&uBit.io.P0)->getAnalogValue()) < 600) && (((&uBit.io.P0)->getAnalogValue()) >= 400)) {
iconBatteryCharging();
} else if (controller.BatteryEmpty() || (batteryMilliVolt < BATTERY_LOW_LIMIT && (&uBit.io.P0)->getAnalogValue() > 300)) {
@@ -189,7 +186,7 @@ void HoverBitDisplay::update() {
} else if (!BLEconnected) {
BLENotConnected();
} else {
- mainScreen();
+ showGraphs();
}
}
@@ -211,40 +208,15 @@ void HoverBitDisplay::lowBattery() {
* Flashes a bluetooth symbol on screen.
*/
void HoverBitDisplay::BLENotConnected() {
- if ((((uBit.systemTime() >> (12 - 1) & 1)) == 1)) {
- bBLEIndicator = !bBLEIndicator;
+ if (uBit.systemTime() % 1000 > 250) {
+ MicroBitImage img(bluetoothSymbol);
+ uBit.display.print(img);
+ } else {
uBit.display.clear();
- if (bBLEIndicator) {
- MicroBitImage img(bluetoothSymbol);
- uBit.display.print(img);
- } else {
- // Need to actually see this to know if I want to flash only
- // blank screen or with battery.
- //batteryLevelFullScreen();
- }
}
}
/**
- * Method that does the "default" main screen mode.
- * Called when in a connected "normal" operating state.
- */
-void HoverBitDisplay::mainScreen() {
- switch (displayMainScreenMode) {
- case OFF:
- break;
- case BATTERY:
- uBit.display.clear();
- batteryLevelFullScreen();
- break;
- case GRAPHS:
- default:
- showGraphs();
- break;
- }
-}
-
-/**
* Show the GRAPH displayMainScreenMode
*/
void HoverBitDisplay::showGraphs() {