From 4cceee770b44a7a9606543087bb89901574c7540 Mon Sep 17 00:00:00 2001 From: Jakob Stendahl Date: Sun, 28 Feb 2021 11:50:15 +0100 Subject: :art: Move display related code to Screen.cpp --- inc/Screen.h | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'inc') 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 +#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_ -- cgit v1.2.3