Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macropad hotkeys: Add screensaver mode to prevent OLED burn-in #2883

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Sep 24, 2024

  1. Macropad hotkeys: Add screensaver mode to prevent OLED burn-in

    This commit introduces a screensaver mode to the Adafruit Macropad
    hotkeys script, addressing issue adafruit#2882.
    
    Key Changes:
    - Screensaver Activation: Added a new configurable parameter
      SCREENSAVER_START_TIME, which specifies the duration of inactivity
      (in seconds) before the screensaver activates.
    - Class-Level Variables: Introduced class-level variables in the App
      class to track the last activity time, screensaver mode status, and
      breathing effect brightness.
    - Screensaver Functions: Added helper functions:
      * enter_screensaver_mode(): Turns off the OLED display and LEDs,
        entering screensaver mode.
      * wake_from_screensaver(): Exits screensaver mode and restores the
        previous state of the display and LEDs.
      * screensaver_breathing_effect(): Implements a breathing LED effect
        during screensaver mode.
    - Main Loop Integration: Modified the main loop to monitor inactivity
      and trigger the screensaver mode based on the specified timeout.
    
    This update ensures the Macropad's OLED display is protected from
    burn-in during extended periods of inactivity.
    
    Fixes issue adafruit#2882.
    Signed-off-by: Flavio Fernandes <[email protected]>
    flavio-fernandes committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    fd92dab View commit details
    Browse the repository at this point in the history