Public Access
Add a web UI to the clock firmware
- Web UI on port 80: live view of the display, choose the page (clock or a bitmap), bitmaps (list, show, live, edit, delete), draw / image upload with conversion in the browser, live mode, settings, Home Assistant - Live view from a shadow buffer in the BROSE9323 driver (shownPixel) - Settings in NVS with the original behaviour as defaults: schedule times, quarter hours, yawning Pikachu, No WiFi screen, flip time, status LED, Home Assistant broker (restart on change) - Bitmaps on LittleFS; new 320 KB partition, ota slots now 1.31 MB - DisplayController: pages, live mode, settings; app.cpp holds the objects - README for the recovery app; docs for the web UI - Tests: settings, time parsing, bitmap format and names, schedule with settings, pages and live mode (95 total) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c9e0800e36
commit
2b1ac12ed7
34 files changed
+1989
-117
No files matched your search
@@ -70,6 +70,8 @@ void BROSE9323::display(bool force)
|
||||
#ifdef ESPSERIAL
|
||||
stream->print("D\n");
|
||||
stream->flush();
|
||||
// Shadow copy of what the dots show now (for the web UI)
|
||||
memcpy(_old_buffer, _new_buffer, _buffer_size);
|
||||
#else
|
||||
if (_direct_mode)
|
||||
return;
|
||||
@@ -113,7 +115,20 @@ void BROSE9323::drawPixel(int16_t x, int16_t y, uint16_t color)
|
||||
#ifdef ESPSERIAL
|
||||
if (y >= height() || y < 0 || x >= width() || x < 0)
|
||||
return;
|
||||
|
||||
|
||||
// Shadow copy for the web UI; S (direct mode) is visible right away
|
||||
if (color)
|
||||
_new_buffer[y * _buffer_width + x / 8] |= 1 << (x & 7);
|
||||
else
|
||||
_new_buffer[y * _buffer_width + x / 8] &= ~(1 << (x & 7));
|
||||
if (_direct_mode)
|
||||
{
|
||||
if (color)
|
||||
_old_buffer[y * _buffer_width + x / 8] |= 1 << (x & 7);
|
||||
else
|
||||
_old_buffer[y * _buffer_width + x / 8] &= ~(1 << (x & 7));
|
||||
}
|
||||
|
||||
char s[10];
|
||||
sprintf(s, "%c%02x%02x%d\n", _direct_mode ? 'S' : 's', x, y, (bool)color);
|
||||
stream->print(s);
|
||||
@@ -162,6 +177,7 @@ void BROSE9323::drawPixel(int16_t x, int16_t y, uint16_t color)
|
||||
void BROSE9323::fillScreen(uint16_t color)
|
||||
{
|
||||
#ifdef ESPSERIAL
|
||||
memset(_new_buffer, color ? 0xFF : 0x00, _buffer_size);
|
||||
stream->print(color ? "F1\n" : "F0\n");
|
||||
#else
|
||||
memset(_new_buffer, color ? 0xFF : 0x00, _buffer_size);
|
||||
@@ -309,4 +325,14 @@ size_t BROSE9323::print(const char *ifsh)
|
||||
ifsh = temp.c_str();
|
||||
|
||||
return Adafruit_GFX::print(ifsh);
|
||||
}
|
||||
}
|
||||
bool BROSE9323::shownPixel(int16_t x, int16_t y) const
|
||||
{
|
||||
if (y >= height() || y < 0 || x >= width() || x < 0)
|
||||
return false;
|
||||
#if defined(__AVR_ATmega168P__) || defined(__AVR_ATmega168PB__) || defined(__AVR_ATmega168__)
|
||||
return _new_buffer[y * _buffer_width + x / 8] & (1 << (x & 7));
|
||||
#else
|
||||
return _old_buffer[y * _buffer_width + x / 8] & (1 << (x & 7));
|
||||
#endif
|
||||
}
|
||||
@@ -87,5 +87,7 @@ public:
|
||||
void printBuffer(void);
|
||||
#endif
|
||||
size_t print(const char *ifsh);
|
||||
// State of a dot as of the last display() call (ESP32: shadow copy for the web UI)
|
||||
bool shownPixel(int16_t x, int16_t y) const;
|
||||
};
|
||||
#endif //BROSE9323_H
|
||||
Reference in new issue
Block a user