Change stepsize to something better suited for 0 - 255

This commit is contained in:
Werner Sembach 2022-08-18 18:47:46 +02:00
parent 5c410c27c9
commit 9d0dd45147

View file

@ -179,7 +179,7 @@ static struct key_entry clevo_keymap[] = {
{ KE_END, 0 } { KE_END, 0 }
}; };
#define BRIGHTNESS_STEP 25 #define BRIGHTNESS_STEP 32
// Keyboard struct // Keyboard struct
struct kbd_led_state_t { struct kbd_led_state_t {
@ -635,20 +635,20 @@ void clevo_keyboard_event_callb(u32 event)
switch (key_event) { switch (key_event) {
case CLEVO_EVENT_DECREASE_BACKLIGHT: case CLEVO_EVENT_DECREASE_BACKLIGHT:
if (kbd_led_state.brightness == BRIGHTNESS_MIN if (kbd_led_state.brightness == BRIGHTNESS_MIN
|| (kbd_led_state.brightness - 25) < BRIGHTNESS_MIN) { || (kbd_led_state.brightness - BRIGHTNESS_STEP) < BRIGHTNESS_MIN) {
set_brightness(BRIGHTNESS_MIN); set_brightness(BRIGHTNESS_MIN);
} else { } else {
set_brightness(kbd_led_state.brightness - 25); set_brightness(kbd_led_state.brightness - BRIGHTNESS_STEP);
} }
break; break;
case CLEVO_EVENT_INCREASE_BACKLIGHT: case CLEVO_EVENT_INCREASE_BACKLIGHT:
if (kbd_led_state.brightness == BRIGHTNESS_MAX if (kbd_led_state.brightness == BRIGHTNESS_MAX
|| (kbd_led_state.brightness + 25) > BRIGHTNESS_MAX) { || (kbd_led_state.brightness + BRIGHTNESS_STEP) > BRIGHTNESS_MAX) {
set_brightness(BRIGHTNESS_MAX); set_brightness(BRIGHTNESS_MAX);
} else { } else {
set_brightness(kbd_led_state.brightness + 25); set_brightness(kbd_led_state.brightness + BRIGHTNESS_STEP);
} }
break; break;