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:
mangavalkandClaude Opus 5.5 committed 2026-10-22 00:24:14 +02:00
1 parent 41af2944bc
commit 7a28e34380
13 files changed
+130 -17

No files matched your search

+34
View File
@@ -583,6 +583,38 @@ void test_power_switch_off_keeps_display_off_during_the_day()
TEST_ASSERT_EQUAL(0, power.on_count);
}
// Slow mode had the power off already: the dots still show the clock, so the power goes on
// for the off image, once
void test_power_switch_off_in_slow_mode_draws_the_off_image()
{
slowMode(true);
run(12, 0, POWER_OFF_DELAY + 200);
TEST_ASSERT_FALSE(power.is_on);
controller->setPowerEnabled(false);
run(12, 1);
TEST_ASSERT_TRUE(power.is_on);
TEST_ASSERT_EQUAL_STRING("off", frames.last().c_str());
run(12, 1, CLEAR_BEFORE_OFF_TIME + 200);
TEST_ASSERT_FALSE(power.is_on);
run(12, 2, 60000);
TEST_ASSERT_EQUAL(2, power.on_count);
TEST_ASSERT_EQUAL(2, (int)frames.shown.size());
}
void test_night_in_slow_mode_draws_the_off_image()
{
slowMode(true);
run(23, 15, POWER_OFF_DELAY + 200);
TEST_ASSERT_FALSE(power.is_on);
run(23, 31);
TEST_ASSERT_TRUE(power.is_on);
TEST_ASSERT_EQUAL_STRING("off", frames.last().c_str());
run(23, 31, POWER_OFF_DELAY + 200);
TEST_ASSERT_FALSE(power.is_on);
run(3, 0, 60000);
TEST_ASSERT_EQUAL(2, power.on_count);
}
void test_power_switch_on_again_shows_clock()
{
run(12, 0);
@@ -3270,6 +3302,8 @@ int main()
RUN_TEST(test_power_switch_off_clears_and_powers_off_quickly);
RUN_TEST(test_power_switch_off_waits_for_the_refresh_effect);
RUN_TEST(test_power_switch_off_keeps_display_off_during_the_day);
RUN_TEST(test_power_switch_off_in_slow_mode_draws_the_off_image);
RUN_TEST(test_night_in_slow_mode_draws_the_off_image);
RUN_TEST(test_power_switch_on_again_shows_clock);
RUN_TEST(test_redraws_after_power_was_switched_off_elsewhere);
RUN_TEST(test_no_wifi_is_shown_after_a_minute_without_wifi);