File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
zephyr/program/framework/src Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,10 @@ uint8_t bl_brightness = KEYBOARD_BL_BRIGHTNESS_OFF;
139
139
static uint8_t caps_led_status ;
140
140
bool kb_als_auto_brightness ;
141
141
142
+ #define KB_FN_LOCKED BIT(7)
143
+ /* Mask off the FN Locked bit */
144
+ #define KB_BRIGHTNESS_MASK 0x7F
145
+
142
146
/*
143
147
* return auto dim keyboard backlight, it decided by
144
148
* key combo(fn+space).
@@ -228,10 +232,10 @@ void fnkey_shutdown(void)
228
232
if (kbbl_auto_dim_is_enable ())
229
233
current_kb |= KEYBOARD_BL_BRIGHTNESS_AUTO ;
230
234
else
231
- current_kb |= kblight_get () & 0x7F ;
235
+ current_kb |= kblight_get () & KB_BRIGHTNESS_MASK ;
232
236
233
237
if (Fn_key & FN_LOCKED ) {
234
- current_kb |= 0x80 ;
238
+ current_kb |= KB_FN_LOCKED ;
235
239
}
236
240
system_set_bbram (SYSTEM_BBRAM_IDX_KBSTATE , current_kb );
237
241
@@ -246,7 +250,7 @@ void fnkey_startup(void)
246
250
uint8_t current_kb = 0 ;
247
251
248
252
if (system_get_bbram (SYSTEM_BBRAM_IDX_KBSTATE , & current_kb ) == EC_SUCCESS ) {
249
- if (current_kb & 0x80 ) {
253
+ if (current_kb & KB_FN_LOCKED ) {
250
254
Fn_key |= FN_LOCKED ;
251
255
}
252
256
}
You can’t perform that action at this time.
0 commit comments