summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruvok2025-08-02 19:17:54 +0200
committeruvok2025-08-02 19:17:58 +0200
commit50c9e11ff4d137f6e979102f89954f5bd8ec2909 (patch)
tree2f90f17bf6393454eb90755e7fc0ce33ea60d125
parent98baf20860831957285a6d2acca1680bae15124f (diff)
Remove "demo" display
-rw-r--r--include/badge/display.h1
-rw-r--r--src/display.cpp38
2 files changed, 4 insertions, 35 deletions
diff --git a/include/badge/display.h b/include/badge/display.h
index d78c899..fa4c1e9 100644
--- a/include/badge/display.h
+++ b/include/badge/display.h
@@ -8,7 +8,6 @@ namespace de::uvok::badge
extern const int image_count;
void display_init(void);
- void display_demo(void);
uint8_t display_next(void);
uint8_t display_prev(void);
diff --git a/src/display.cpp b/src/display.cpp
index 3a2d99f..44b13b1 100644
--- a/src/display.cpp
+++ b/src/display.cpp
@@ -45,6 +45,8 @@ static uint8_t displayed = 0;
#include "snep2.xbm"
// #include "snep3.xbm"
+static bool is_initial = true;
+
void de::uvok::badge::display_init(void)
{
LOG_F("Init display...\n");
@@ -62,37 +64,6 @@ void de::uvok::badge::display_init(void)
LOG_F("Display done.\n");
}
-void de::uvok::badge::display_demo(void)
-{
-#define TEXT_BORDER 10
- // display.clearScreen();
- static const char s_hungry[] = "hungry";
- display.setRotation(1);
- display.setTextColor(GxEPD_BLACK);
- int16_t tbx, tby;
- uint16_t tbw, tbh;
- display.setFont(&FreeMonoBold9pt7b);
- display.getTextBounds(s_hungry, 0, 0, &tbx, &tby, &tbw, &tbh);
- // center the bounding box by transposition of the origin:
- uint16_t x = display.width() - tbw - TEXT_BORDER - tbx;
- uint16_t y = ((display.height() - tbh) / 2) - tby;
- display.setFullWindow();
- display.firstPage();
- do
- {
- display.drawXBitmap(0, 0, (unsigned char *)chleepy_bits, chleepy_width, chleepy_height, GxEPD_BLACK);
- display.getTextBounds(s_hungry, x, y, &tbx, &tby, &tbw, &tbh);
- display.fillRect(tbx - TEXT_BORDER, tby - TEXT_BORDER, tbw + 2 * TEXT_BORDER, tbh + 2 * TEXT_BORDER,
- GxEPD_WHITE);
-
- display.setCursor(x, y);
- display.print(s_hungry);
- } while (display.nextPage());
-
- display.hibernate();
-#undef TEXT_BORDER
-}
-
#define IMAGE_DATA(name, text) {name##_bits, name##_width, name##_height, text}
const struct
@@ -116,7 +87,6 @@ typedef enum
static void displayDo(display_mode_t mode)
{
- static bool is_initial = true;
if (is_initial)
{
mode = DISPLAY_FULL;
@@ -196,8 +166,8 @@ void de::uvok::badge::display_direct(uint8_t num)
}
void de::uvok::badge::display_indicator(DisplayIndicator indicator)
-{
-
+ {
+
}