From 352e0df7d800b033ce24ad1022461f5d1908da93 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Thu, 14 Mar 2019 14:44:18 -0400 Subject: cleanup, display screen abstraction --- source/sharp.hpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 source/sharp.hpp (limited to 'source/sharp.hpp') diff --git a/source/sharp.hpp b/source/sharp.hpp new file mode 100644 index 0000000..a122e5d --- /dev/null +++ b/source/sharp.hpp @@ -0,0 +1,39 @@ +#ifndef SHARP_HPP_ +#define SHARP_HPP_ + +#include "sharp/Adafruit_SharpMem.h" + +#include + +using RenderFunc = std::function; +using Display = Adafruit_GFX; + +class Sharp { +private: + static Adafruit_SharpMem display; + static TaskHandle_t taskHandle; + static bool holdRendering; + + static RenderFunc currentScreen; + +public: + static void begin(void); + + inline static void pause(void) { + holdRendering = true; + } + + inline static void unpause(void) { + holdRendering = false; + } + + inline static void setScreen(const RenderFunc& rf) { + currentScreen = rf; + } + +private: + static void updateTask(void *); +}; + +#endif // SHARP_HPP_ + -- cgit v1.2.3