aboutsummaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorJakob Stendahl <jakob.stendahl@outlook.com>2021-02-28 11:50:15 +0100
committerJakob Stendahl <jakob.stendahl@outlook.com>2021-02-28 11:50:15 +0100
commit4cceee770b44a7a9606543087bb89901574c7540 (patch)
treeea7540d3530bf9e2e1eb127895b7eb021c1534b2 /inc
parent418b418be9d36db42eb729df4a875439673001b7 (diff)
downloadhoverbit-ble-4cceee770b44a7a9606543087bb89901574c7540.tar.gz
hoverbit-ble-4cceee770b44a7a9606543087bb89901574c7540.zip
:art: Move display related code to Screen.cpp
Diffstat (limited to 'inc')
-rw-r--r--inc/Screen.h35
1 files changed, 34 insertions, 1 deletions
diff --git a/inc/Screen.h b/inc/Screen.h
index e141a86..abac919 100644
--- a/inc/Screen.h
+++ b/inc/Screen.h
@@ -26,6 +26,10 @@ DEALINGS IN THE SOFTWARE.
#define SCREEN_H_
#include <MicroBit.h>
+#include "HoverBitController.h"
+
+extern MicroBit uBit;
+extern HoverBitController controller;
enum DisplayMainScreenMode { GRAPHS, BATTERY, OFF };
@@ -74,6 +78,35 @@ const char* const bluetoothSymbol = "\
255,000,255,000,255\n\
000,000,255,255,000\n";
-void plotYLine(MicroBit *uBit, int y1, int y2, int x);
+class HoverBitDisplay {
+ private:
+ DisplayMainScreenMode screenMode;
+ unsigned int tmpTimer;
+ bool BLEconnected;
+ bool bBLEIndicator;
+ bool flipFrame;
+ bool isPause;
+
+ void lowBattery();
+ void BLENotConnected();
+ void mainScreen();
+ void showGraphs();
+
+ public:
+ void mode(DisplayMainScreenMode mode);
+ DisplayMainScreenMode mode();
+ void nextMode();
+ void pause();
+ void pause(bool p);
+ void update();
+ void updateBLEState(bool connected);
+};
+
+void plotYLine(int y1, int y2, int x);
+void plotXLine(int x1, int x2, int y);
+void iconBatteryDead();
+void iconBatteryLow();
+void iconBatteryCharging();
+void batteryLevelFullScreen();
#endif // SCREEN_H_