2026-10-13 00:56:32 +02:00
|
|
|
#include "display/frames.h"
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2026-10-13 01:52:34 +02:00
|
|
|
#include <string.h>
|
2026-10-13 00:56:32 +02:00
|
|
|
|
2026-10-13 01:34:04 +02:00
|
|
|
#include "display/text.h"
|
2026-10-13 00:56:32 +02:00
|
|
|
|
2026-10-15 19:43:59 +02:00
|
|
|
FlipdotFrames::FlipdotFrames(BROSE9323 &display, PageResources &resources) : _display(display), _resources(resources)
|
2026-10-13 00:56:32 +02:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-15 19:43:59 +02:00
|
|
|
void FlipdotFrames::dynamicPage(const LocalTime &time)
|
2026-10-13 00:56:32 +02:00
|
|
|
{
|
2026-10-15 19:43:59 +02:00
|
|
|
uint8_t bitmap[BITMAP_BYTES];
|
|
|
|
|
renderPage(_dynamic, time, _resources, bitmap);
|
|
|
|
|
_drawFullScreen(bitmap);
|
2026-10-13 00:56:32 +02:00
|
|
|
}
|
|
|
|
|
|
2026-10-13 01:34:04 +02:00
|
|
|
void FlipdotFrames::noWifi(int hour, int minute)
|
|
|
|
|
{
|
|
|
|
|
char time[6];
|
|
|
|
|
snprintf(time, sizeof(time), "%02d:%02d", hour, minute);
|
|
|
|
|
drawTextLines(_display, "No WiFi", time);
|
|
|
|
|
_display.display();
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-13 01:52:34 +02:00
|
|
|
void FlipdotFrames::page()
|
|
|
|
|
{
|
|
|
|
|
_drawFullScreen(_page);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FlipdotFrames::live()
|
|
|
|
|
{
|
|
|
|
|
_drawFullScreen(_live);
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-15 01:29:01 +02:00
|
|
|
void FlipdotFrames::off()
|
2026-10-13 00:56:32 +02:00
|
|
|
{
|
2026-10-15 01:29:01 +02:00
|
|
|
_drawFullScreen(_off);
|
2026-10-13 00:56:32 +02:00
|
|
|
}
|
2026-10-13 01:52:34 +02:00
|
|
|
|
2026-10-15 19:43:59 +02:00
|
|
|
void FlipdotFrames::setDynamicPage(const DynamicPage &page)
|
|
|
|
|
{
|
|
|
|
|
_dynamic = page;
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-13 01:52:34 +02:00
|
|
|
void FlipdotFrames::setPageBitmap(const uint8_t *bitmap)
|
|
|
|
|
{
|
|
|
|
|
memcpy(_page, bitmap, BITMAP_BYTES);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FlipdotFrames::setLiveBitmap(const uint8_t *bitmap)
|
|
|
|
|
{
|
|
|
|
|
memcpy(_live, bitmap, BITMAP_BYTES);
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-15 01:29:01 +02:00
|
|
|
void FlipdotFrames::setOffBitmap(const uint8_t *bitmap)
|
|
|
|
|
{
|
|
|
|
|
if (bitmap)
|
|
|
|
|
memcpy(_off, bitmap, BITMAP_BYTES);
|
|
|
|
|
else
|
|
|
|
|
memset(_off, 0, BITMAP_BYTES);
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-13 01:52:34 +02:00
|
|
|
void FlipdotFrames::_drawFullScreen(const uint8_t *bitmap)
|
|
|
|
|
{
|
|
|
|
|
_display.fillScreen(0);
|
|
|
|
|
_display.drawBitmap(0, 0, bitmap, BITMAP_WIDTH, BITMAP_HEIGHT, 1);
|
|
|
|
|
_display.display();
|
|
|
|
|
}
|