diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2019-03-14 14:44:18 -0400 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2019-03-14 14:44:18 -0400 |
commit | 352e0df7d800b033ce24ad1022461f5d1908da93 (patch) | |
tree | 3cf6adf03311668fe3ecbbb21c070668624fa10a /source/sharp.hpp | |
parent | 31e115f7e72532fbfd456709e95d440e3be46fa1 (diff) |
cleanup, display screen abstraction
Diffstat (limited to 'source/sharp.hpp')
-rw-r--r-- | source/sharp.hpp | 39 |
1 files changed, 39 insertions, 0 deletions
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 <functional> + +using RenderFunc = std::function<void(Adafruit_GFX&)>; +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_ + |