Commit fd92dab
committed
Macropad hotkeys: Add screensaver mode to prevent OLED burn-in
This commit introduces a screensaver mode to the Adafruit Macropad
hotkeys script, addressing issue #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 #2882.
Signed-off-by: Flavio Fernandes <[email protected]>1 parent 24406bf commit fd92dab
1 file changed
+47
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
34 | 41 | | |
35 | 42 | | |
36 | 43 | | |
37 | 44 | | |
38 | 45 | | |
39 | 46 | | |
40 | 47 | | |
| 48 | + | |
41 | 49 | | |
42 | 50 | | |
43 | 51 | | |
| |||
57 | 65 | | |
58 | 66 | | |
59 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
60 | 91 | | |
61 | 92 | | |
62 | 93 | | |
| |||
111 | 142 | | |
112 | 143 | | |
113 | 144 | | |
| 145 | + | |
| 146 | + | |
114 | 147 | | |
115 | 148 | | |
116 | 149 | | |
| 150 | + | |
| 151 | + | |
117 | 152 | | |
118 | 153 | | |
119 | 154 | | |
| |||
132 | 167 | | |
133 | 168 | | |
134 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
135 | 176 | | |
136 | 177 | | |
137 | 178 | | |
| |||
140 | 181 | | |
141 | 182 | | |
142 | 183 | | |
| 184 | + | |
143 | 185 | | |
144 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
145 | 191 | | |
146 | 192 | | |
147 | 193 | | |
| |||
0 commit comments