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;
139139static uint8_t caps_led_status ;
140140bool kb_als_auto_brightness ;
141141
142+ #define KB_FN_LOCKED BIT(7)
143+ /* Mask off the FN Locked bit */
144+ #define KB_BRIGHTNESS_MASK 0x7F
145+
142146/*
143147 * return auto dim keyboard backlight, it decided by
144148 * key combo(fn+space).
@@ -228,10 +232,10 @@ void fnkey_shutdown(void)
228232 if (kbbl_auto_dim_is_enable ())
229233 current_kb |= KEYBOARD_BL_BRIGHTNESS_AUTO ;
230234 else
231- current_kb |= kblight_get () & 0x7F ;
235+ current_kb |= kblight_get () & KB_BRIGHTNESS_MASK ;
232236
233237 if (Fn_key & FN_LOCKED ) {
234- current_kb |= 0x80 ;
238+ current_kb |= KB_FN_LOCKED ;
235239 }
236240 system_set_bbram (SYSTEM_BBRAM_IDX_KBSTATE , current_kb );
237241
@@ -246,7 +250,7 @@ void fnkey_startup(void)
246250 uint8_t current_kb = 0 ;
247251
248252 if (system_get_bbram (SYSTEM_BBRAM_IDX_KBSTATE , & current_kb ) == EC_SUCCESS ) {
249- if (current_kb & 0x80 ) {
253+ if (current_kb & KB_FN_LOCKED ) {
250254 Fn_key |= FN_LOCKED ;
251255 }
252256 }
You can’t perform that action at this time.
0 commit comments