aboutsummaryrefslogtreecommitdiff
path: root/source/main.cpp
diff options
context:
space:
mode:
authorJakob Stendahl <jakob.stendahl@outlook.com>2021-02-24 13:00:16 +0100
committerJakob Stendahl <jakob.stendahl@outlook.com>2021-02-24 13:00:16 +0100
commit93562d1954b07c1a24a06347152d691d9c1ea35a (patch)
treee3e33e0d5f1ae04f8c6d42de07b73a6d4ad53b8d /source/main.cpp
parent31c0ec6191af1a9d8f491876942a404d4f85468a (diff)
downloadhoverbit-ble-93562d1954b07c1a24a06347152d691d9c1ea35a.tar.gz
hoverbit-ble-93562d1954b07c1a24a06347152d691d9c1ea35a.zip
:lipstick: Make bluetooth symbol flash when not connected
Diffstat (limited to 'source/main.cpp')
-rw-r--r--source/main.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/source/main.cpp b/source/main.cpp
index 815d560..27481a9 100644
--- a/source/main.cpp
+++ b/source/main.cpp
@@ -193,7 +193,25 @@ void mainScreen() {
bool bDelayElapsed = (uBit.systemTime() - tmpTimer) > 1000;
if (bDelayElapsed) { tmpTimer = uBit.systemTime(); }
- if (bDelayElapsed && bConnected) { uart->send(ManagedString("B:") + ManagedString(batteryMilliVolt)); }
+ if (bConnected) {
+ if (bDelayElapsed) {
+ uart->send(ManagedString("B:") + ManagedString(batteryMilliVolt));
+ }
+ } else {
+ if (bDelayElapsed) {
+ bBLEIndicator = !bBLEIndicator;
+ 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();
+ }
+ }
+ return;
+ }
switch (displayMainScreenMode) {
case OFF: