Skip to main content

backlight_runner

Function backlight_runner 

Source
pub async fn backlight_runner(
    i2c: I2c<'static, Async, Master>,
    addr0: u8,
    addr1: u8,
) -> !
Expand description

Runs the backlight controller loop.

Initializes both SNLED27351 driver chips, performs a soft-start brightness ramp, then enters an event loop that concurrently handles two concerns:

  • Indicator commands arriving on BACKLIGHT_CH: updates the Caps Lock LED without touching the rest of the matrix.
  • Thermal polling on a THERMAL_POLL ticker: reads the TDF register from both chips and reduces overall brightness to THERMAL_THROTTLE_BRIGHTNESS if either exceeds 70 °C, restoring it automatically when both cool down. A full redraw is issued on each transition so the indicator LED is never lost.