Files
immich-frame/src/power_manager.h
cottongin f3df685d02 fix: eliminate diagonal dither pattern from display driver
Root cause: Panel_ED2208's epd_quality mode applies _dither_row_rgb_pair
(diagonal bias pattern with dither=140) during _exec_transfer(). Since our
ImagePipeline already does proper Floyd-Steinberg dithering, the driver's
additional dithering was creating visible diagonal artifacts.

Fix: setEpdMode(epd_fastest) selects _dither_row_none (clean nearest-color
lookup, no spatial bias). On Panel_ED2208 this only affects the dither
function — NOT refresh quality or waveform.

Also: default dither_noise setting to OFF since error scatter was targeting
the wrong layer (it made gradient areas fuzzier without fixing the real
problem in the display driver).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-31 13:23:41 -04:00

30 lines
748 B
C++

#pragma once
#include <Arduino.h>
#include <esp_sleep.h>
#include "config.h"
class PowerManager {
public:
void begin();
uint8_t getBatteryPercent();
bool isCharging();
void updateBatteryLED();
void flashLED(uint8_t r, uint8_t g, uint8_t b, uint16_t duration_ms = LED_PULSE_DURATION_MS);
void enterDeepSleep(uint32_t sleepMinutes = 0);
void enableLightSleep();
void disableEPDPower();
void enableEPDPower();
static bool wasTimedSleepWake();
static void clearTimedSleepFlag();
private:
uint8_t _lastBatteryPct = 100;
unsigned long _lastLEDPulse = 0;
uint8_t _ledBrightness = DEFAULT_LED_BRIGHTNESS;
void setLED(uint8_t index, uint8_t r, uint8_t g, uint8_t b);
void clearLEDs();
};