Public Access
Add scrolling, countdown, stopwatch, images, seconds, multiplier and degree sign
- Text elements can scroll in a window at a set speed; clock, countdown and stopwatch can show seconds. Moving pages are sent as instant frames (new Nano command D1) and paced by the estimated flip time. - Countdown to a date and time (smart, days, days + time, with seconds), stopwatch (web UI, HA switch and reset button), image element (fixed or by Home Assistant state), multiplier for HA values, degree sign (char 127) in all fonts and the font converter. - Page format version 2; version 1 pages are converted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ca8d78ea8a
commit
fc6fa1a180
38 files changed
+1370
-277
No files matched your search
@@ -3,17 +3,41 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "display/text.h"
|
||||
|
||||
FlipdotFrames::FlipdotFrames(BROSE9323 &display, PageResources &resources) : _display(display), _resources(resources)
|
||||
{
|
||||
}
|
||||
|
||||
void FlipdotFrames::dynamicPage(const LocalTime &time)
|
||||
uint32_t FlipdotFrames::dynamicPage(const LocalTime &time, uint32_t now, bool redraw)
|
||||
{
|
||||
uint8_t bitmap[BITMAP_BYTES];
|
||||
renderPage(_dynamic, time, _resources, bitmap);
|
||||
_drawFullScreen(bitmap);
|
||||
uint32_t wait = renderPage(_dynamic, time, now, _resources, bitmap);
|
||||
bool moving = wait != 0;
|
||||
if (!redraw && memcmp(bitmap, _last_dynamic, BITMAP_BYTES) == 0)
|
||||
return wait;
|
||||
// The Nano has no acknowledgement: wait until it has flipped the dots of this frame,
|
||||
// or the next frame overflows its serial buffer
|
||||
uint32_t busy = _flipMs(bitmap, redraw);
|
||||
_drawFullScreen(bitmap, moving);
|
||||
memcpy(_last_dynamic, bitmap, BITMAP_BYTES);
|
||||
return moving && wait < busy ? busy : wait;
|
||||
}
|
||||
|
||||
void FlipdotFrames::setDrive(uint16_t flip_time, const DriveSettings &drive)
|
||||
{
|
||||
_dot_us = (uint32_t)drive.pulses * (flip_time + drive.flip_gap);
|
||||
}
|
||||
|
||||
// About how long the Nano takes to receive and show the bitmap (all: every dot flips)
|
||||
uint32_t FlipdotFrames::_flipMs(const uint8_t *bitmap, bool all) const
|
||||
{
|
||||
uint32_t dots = 0;
|
||||
for (int y = 0; y < BITMAP_HEIGHT; y++)
|
||||
for (int x = 0; x < BITMAP_WIDTH; x++)
|
||||
dots += all || bitmapPixel(bitmap, x, y) != _display.shownPixel(x, y);
|
||||
return FRAME_SEND_TIME + dots * _dot_us / 1000;
|
||||
}
|
||||
|
||||
void FlipdotFrames::noWifi(int hour, int minute)
|
||||
@@ -62,9 +86,9 @@ void FlipdotFrames::setOffBitmap(const uint8_t *bitmap)
|
||||
memset(_off, 0, BITMAP_BYTES);
|
||||
}
|
||||
|
||||
void FlipdotFrames::_drawFullScreen(const uint8_t *bitmap)
|
||||
void FlipdotFrames::_drawFullScreen(const uint8_t *bitmap, bool instant)
|
||||
{
|
||||
_display.fillScreen(0);
|
||||
_display.drawBitmap(0, 0, bitmap, BITMAP_WIDTH, BITMAP_HEIGHT, 1);
|
||||
_display.display();
|
||||
_display.display(false, instant);
|
||||
}
|
||||
Reference in new issue
Block a user