Public Access
Fix shifted pictures: non-blocking Nano drawing, frame check, refresh settings
The Nano's periodic full redraw blocked for ~0.8 s. A frame that arrived meanwhile overflowed its 64-byte serial buffer; lost bytes in a bitmap shift the rest of the image (picture moved up), and diff frames never repaired it. - Nano: all drawing (frames, effects, the dot refresh) runs from update() in ~1 ms slices; the refresh pauses while a frame is received or shown - New commands: C (reply with the image checksum) and I (refresh minutes, EEPROM) - ESP32: NanoMonitor asks for the checksum after frames and sends the whole image again on a mismatch, missing answer or Nano restart; counts ERR replies. Periodic whole-image resync. - Settings: "Dot refresh" and "Image resync" intervals (settings v5, v4 records are migrated) - System tab: loop timing, free memory, frame check counts - test_driver: the real driver against a simulated panel Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
58a7cb03c2
commit
090c2bf8ae
45 files changed
+1265
-157
No files matched your search
@@ -9,10 +9,11 @@ StatusScreen::StatusScreen(BROSE9323 &display, NanoLink &nano) : _display(displa
|
||||
{
|
||||
}
|
||||
|
||||
void StatusScreen::setDrive(uint16_t flip_time, const DriveSettings &drive)
|
||||
void StatusScreen::setDrive(uint16_t flip_time, const DriveSettings &drive, uint16_t dot_refresh)
|
||||
{
|
||||
_flip_time = flip_time;
|
||||
_drive = drive;
|
||||
_dot_refresh = dot_refresh;
|
||||
}
|
||||
|
||||
void StatusScreen::sendDrive()
|
||||
@@ -30,6 +31,7 @@ void StatusScreen::loop()
|
||||
_display.setGap(_drive.flip_gap);
|
||||
_display.setPulses(_drive.pulses);
|
||||
_display.setEffect(_drive.effect, _drive.effect_time, _drive.effect_small_only ? EFFECT_FLAG_SMALL_ONLY : 0);
|
||||
_display.setRefreshInterval(_dot_refresh);
|
||||
}
|
||||
|
||||
void StatusScreen::show(const char *line1, const char *line2, bool keep_on)
|
||||
|
||||
@@ -17,7 +17,7 @@ public:
|
||||
|
||||
// How the Nano drives the dots, sent with the first message (default: FLIP_TIME and
|
||||
// the DriveSettings defaults, so the recovery app always shows its messages instantly)
|
||||
void setDrive(uint16_t flip_time, const DriveSettings &drive);
|
||||
void setDrive(uint16_t flip_time, const DriveSettings &drive, uint16_t dot_refresh = RefreshSettings().dots);
|
||||
// Send them again (they changed), from loop()
|
||||
void sendDrive();
|
||||
// Sends changed drive settings once the display is on. Not while the Nano is flashed.
|
||||
@@ -30,4 +30,5 @@ private:
|
||||
bool _drive_pending = false;
|
||||
uint16_t _flip_time;
|
||||
DriveSettings _drive;
|
||||
uint16_t _dot_refresh = RefreshSettings().dots;
|
||||
};
|
||||
Reference in new issue
Block a user