Add configurable display auto-sleep with wake on keypress#16
Open
not-in-stock wants to merge 2 commits intocarrefinho:mainfrom
Open
Add configurable display auto-sleep with wake on keypress#16not-in-stock wants to merge 2 commits intocarrefinho:mainfrom
not-in-stock wants to merge 2 commits intocarrefinho:mainfrom
Conversation
65db4b6 to
a90120d
Compare
e735be1 to
abe3491
Compare
- Set PWM_MIN to 15% instead of 1% to ensure display is always visible - Force 20% brightness on wake in ALS mode before ALS thread adjusts - Set sleeping=false before blank_off() to prevent race condition with ALS thread - Remove LED debug code Fixes issue where display would wake but appear off in dark rooms due to 1% backlight being invisible. Display now wakes with visible brightness that ALS adjusts within 150ms.
|
Can we add this to the new feat/new-status-screens branch (Zephyr 4.1)? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds an optional feature to automatically turn off the dongle’s display after inactivity and wake it on any keypress from peripherals. The feature is disabled by default to avoid changing behavior for existing builds.
Summary
Changes
CONFIG_PROSPECTOR_DISPLAY_SLEEP_ENABLE(default n)CONFIG_PROSPECTOR_DISPLAY_IDLE_TIMEOUT_MS(default 30000)CONFIG_PROSPECTOR_DISPLAY_SLEEP_USE_PM(depends onPM_DEVICE, default n)include/prospector/display_power.hboards/shields/prospector_adapter/src/display_idle.cboards/shields/prospector_adapter/CMakeLists.txt(addeddisplay_idle.c)boards/shields/prospector_adapter/src/brightness.c(ALS loop guards backlight while sleeping)README.md(configuration examples and defaults)Configuration
Enable and configure in your shield/board config:
Implementation notes
boards/shields/prospector_adapter/src/display_idle.cuses:k_work_delayableto track inactivity.zmk_keycode_state_changed,zmk_position_state_changed.display_blanking_on/offorpm_device_action_run()when PM is enabled.boards/shields/prospector_adapter/src/brightness.cchecksprospector_display_is_sleeping()to keep backlight off while sleeping.Testing
CONFIG_PROSPECTOR_DISPLAY_SLEEP_ENABLE=yPM_DEVICEandCONFIG_PROSPECTOR_DISPLAY_SLEEP_USE_PM=yand verify sleep/resume works as expected.