Skip to content

Commit

Permalink
[Display][Menu] Add backlight breathing entry
Browse files Browse the repository at this point in the history
  • Loading branch information
drashna committed Feb 21, 2025
1 parent 72c4339 commit 767391e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions users/drashna/display/menu/submenus/backlight_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,28 @@ __attribute__((weak)) void display_handler_bl_level(char *text_buffer, size_t bu
snprintf(text_buffer, buffer_len - 1, "%d", get_backlight_level());
}

# ifdef BACKLIGHT_BREATHING
bool menu_handler_breathing(menu_input_t input) {
switch (input) {
case menu_input_left:
case menu_input_right:
backlight_toggle_breathing();
return false;
default:
return true;
}
}

__attribute__((weak)) void display_handler_breathing(char *text_buffer, size_t buffer_len) {
snprintf(text_buffer, buffer_len - 1, "%s", is_backlight_breathing() ? "on" : "off");
}
# endif

menu_entry_t backlight_entries[] = {
MENU_ENTRY_CHILD("Backlight Enabled", "Enabled", bl_enabled),
MENU_ENTRY_CHILD("Backlight Level", "Level", bl_level),
# ifdef BACKLIGHT_BREATHING
MENU_ENTRY_CHILD("Backlight Breathing", "Breathing", breathing),
# endif
};
#endif // BACKLIGHT_ENABLE

0 comments on commit 767391e

Please sign in to comment.