Public Access
Fix dense images on the Nano and the off image in slow mode
- Nano: B data is drawn fast enough for the serial line. A hex digit arrives every 87 us; with a division and four drawPixel() calls per digit a lit digit took about 105 us, so dense frames (all yellow, the panda bitmap) overflowed the 64 byte receive buffer: frames not shown or wrong, "Line too long", frame check repairs that failed the same way. Now the parser counts columns and rows and BROSE9323::drawDots() sets the 4 dots (about 20 us). - ESP32: Power off and the start of the night draw the off image also when slow mode had the power off already (it powers on for it, once) - Tests: drawDots() against drawPixel(), off image in slow mode - Version 2.19.3 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
41af2944bc
commit
7a28e34380
13 files changed
+130
-17
No files matched your search
@@ -290,6 +290,25 @@ void BROSE9323::printBuffer(void)
|
||||
}
|
||||
}
|
||||
|
||||
void BROSE9323::drawDots(int16_t x, int16_t y, uint8_t bits, bool color)
|
||||
{
|
||||
if (!(bits & 0xF) || y < 0 || y >= height())
|
||||
return;
|
||||
// Never used in direct mode (B commands), so only the buffer changes
|
||||
_drawing = true;
|
||||
uint8_t *row = _new_buffer + y * _buffer_width;
|
||||
for (uint8_t mask = 8; mask; mask >>= 1, x++)
|
||||
{
|
||||
if (!(bits & mask) || x < 0 || x >= width())
|
||||
continue;
|
||||
uint8_t bit = 1 << (x & 7);
|
||||
if (color)
|
||||
row[x >> 3] |= bit;
|
||||
else
|
||||
row[x >> 3] &= ~bit;
|
||||
}
|
||||
}
|
||||
|
||||
void BROSE9323::_selectColumn(uint8_t col)
|
||||
{
|
||||
if (_active_col == col)
|
||||
|
||||
@@ -154,6 +154,10 @@ public:
|
||||
bool refreshing(void) const { return _refreshing; }
|
||||
#endif
|
||||
#ifndef ESPSERIAL
|
||||
// Draws the set bits of a hex digit of B data into the buffer (bit 3 at x, bit 0 at
|
||||
// x + 3), like drawPixel() but fast enough for the serial port: dense B lines take
|
||||
// about 23 us per dot with drawPixel(), and a digit arrives every 87 us
|
||||
void drawDots(int16_t x, int16_t y, uint8_t bits, bool color);
|
||||
void printBuffer(void);
|
||||
#endif
|
||||
size_t print(const char *ifsh);
|
||||
|
||||
Reference in new issue
Block a user