diff options
author | Jakob Stendahl <jakob.stendahl@outlook.com> | 2021-06-08 00:56:19 +0200 |
---|---|---|
committer | Jakob Stendahl <jakob.stendahl@outlook.com> | 2021-06-08 00:56:19 +0200 |
commit | 820e89ead9577c7aa4b7ef10f363daf8a28247ac (patch) | |
tree | 8006e48de8129e836ee45ef4516a036625949062 /source/Screen.cpp | |
parent | e9a5544db7be5e461b92743b37adcc77162483b7 (diff) | |
download | hoverbit-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.cpp | 38 |
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() { |