feat(backlight): add command to cycle brightness

This commit is contained in:
Alessandro Bortolin
2022-01-22 11:57:51 +01:00
committed by Pete Johanson
parent 2c0fe3934d
commit 13a4515300
9 changed files with 139 additions and 10 deletions

View File

@@ -137,6 +137,14 @@ uint8_t zmk_backlight_calc_brt(int direction) {
return CLAMP(brt, 0, BRT_MAX);
}
uint8_t zmk_backlight_calc_brt_cycle() {
if (state.brightness == BRT_MAX) {
return 0;
} else {
return zmk_backlight_calc_brt(1);
}
}
#if IS_ENABLED(CONFIG_ZMK_BACKLIGHT_AUTO_OFF_IDLE) || IS_ENABLED(CONFIG_ZMK_BACKLIGHT_AUTO_OFF_USB)
static int backlight_auto_state(bool *prev_state, bool new_state) {
if (state.on == new_state) {