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/driverSharp.cpp | |
parent | 31e115f7e72532fbfd456709e95d440e3be46fa1 (diff) |
cleanup, display screen abstraction
Diffstat (limited to 'source/driverSharp.cpp')
-rw-r--r-- | source/driverSharp.cpp | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/source/driverSharp.cpp b/source/driverSharp.cpp deleted file mode 100644 index 4cdc6f1..0000000 --- a/source/driverSharp.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include "driverSharp.h" -#include "rtc.hpp" - -constexpr unsigned int SHARP_SCK = 12; -constexpr unsigned int SHARP_MOSI = 13; -constexpr unsigned int SHARP_SS = 14; - -Adafruit_SharpMem Sharp::display(SHARP_SCK, SHARP_MOSI, SHARP_SS, 144, 168); -TaskHandle_t Sharp::taskHandle; -bool Sharp::holdRendering = false; -char Sharp::message[16] = ""; - -#define BLACK 0 -#define WHITE 1 - -void Sharp::begin(void) -{ - display.begin(); - display.clearDisplay(); - display.setTextSize(3); - display.setTextColor(BLACK, WHITE); - - xTaskCreate(updateTask, "sharp", 512, nullptr, TASK_PRIO_LOW, - &taskHandle); -} - -void Sharp::updateTask([[maybe_unused]] void *arg) -{ - static auto old = RTC::ticks(); - while (1) { - do { - delay(300); - } while (holdRendering); - - if (auto t = RTC::ticks(); t != old) { - old = t; - display.setCursor(0, 10); - display.printf("%2d:%02d:%02d", t / 3600, (t % 3600) / - 60, t % 60); - if (*message != '\0') { - display.setCursor(0, 100); - display.printf("%-16s", message); - } - display.refresh(); - } - } -} - |