From 999f88853a9c55f5515a7c8a296fd751d09a02d4 Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Tue, 6 Oct 2026 10:22:43 +0200 Subject: [PATCH] perf(l2): the screen fades out and in in ~80 ms Co-Authored-By: Claude Opus 5.5 --- variants/wio-tracker-l2/WioTrackerL2Display.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/variants/wio-tracker-l2/WioTrackerL2Display.h b/variants/wio-tracker-l2/WioTrackerL2Display.h index 703e5c11..e11fbd3f 100644 --- a/variants/wio-tracker-l2/WioTrackerL2Display.h +++ b/variants/wio-tracker-l2/WioTrackerL2Display.h @@ -189,16 +189,16 @@ public: class WioTrackerL2Display : public LGFXDisplay { LGFX_WioTrackerL2 disp; - // The backlight from one PWM level to another over ~180 ms, on a square + // The backlight from one PWM level to another over ~80 ms, on a square // curve (the eye sees the low end's steps). Blocks; 0 ends in standby. void fade(uint8_t from, uint8_t to) { - const int STEPS = 12; + const int STEPS = 8; for (int i = 1; i <= STEPS; i++) { const int t = i * 256 / STEPS; // 0..256 const int k = from < to ? t * t / 256 : 256 - (256 - t) * (256 - t) / 256; const int v = from + ((int)to - from) * k / 256; display->panel()->setBrightness((uint8_t)(i == STEPS ? to : (v < 1 ? 1 : v))); - delay(15); + delay(8); } }