mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-01 03:15:42 +00:00
Disable low brightness, as this soft-bricks at least the L1 (#7223)
This commit is contained in:
parent
93132fad28
commit
c1431f4f9a
@ -602,32 +602,28 @@ void menuHandler::BuzzerModeMenu()
|
|||||||
|
|
||||||
void menuHandler::BrightnessPickerMenu()
|
void menuHandler::BrightnessPickerMenu()
|
||||||
{
|
{
|
||||||
static const char *optionsArray[] = {"Back", "Low", "Medium", "High", "Very High"};
|
static const char *optionsArray[] = {"Back", "Low", "Medium", "High"};
|
||||||
|
|
||||||
// Get current brightness level to set initial selection
|
// Get current brightness level to set initial selection
|
||||||
int currentSelection = 1; // Default to Low
|
int currentSelection = 1; // Default to Medium
|
||||||
if (uiconfig.screen_brightness >= 255) {
|
if (uiconfig.screen_brightness >= 255) {
|
||||||
currentSelection = 4; // Very High
|
currentSelection = 3; // Very High
|
||||||
} else if (uiconfig.screen_brightness >= 128) {
|
} else if (uiconfig.screen_brightness >= 128) {
|
||||||
currentSelection = 3; // High
|
currentSelection = 2; // High
|
||||||
} else if (uiconfig.screen_brightness >= 64) {
|
|
||||||
currentSelection = 2; // Medium
|
|
||||||
} else {
|
} else {
|
||||||
currentSelection = 1; // Low
|
currentSelection = 1; // Medium
|
||||||
}
|
}
|
||||||
|
|
||||||
BannerOverlayOptions bannerOptions;
|
BannerOverlayOptions bannerOptions;
|
||||||
bannerOptions.message = "Brightness";
|
bannerOptions.message = "Brightness";
|
||||||
bannerOptions.optionsArrayPtr = optionsArray;
|
bannerOptions.optionsArrayPtr = optionsArray;
|
||||||
bannerOptions.optionsCount = 5;
|
bannerOptions.optionsCount = 4;
|
||||||
bannerOptions.bannerCallback = [](int selected) -> void {
|
bannerOptions.bannerCallback = [](int selected) -> void {
|
||||||
if (selected == 1) { // Low
|
if (selected == 1) { // Medium
|
||||||
uiconfig.screen_brightness = 1;
|
|
||||||
} else if (selected == 2) { // Medium
|
|
||||||
uiconfig.screen_brightness = 64;
|
uiconfig.screen_brightness = 64;
|
||||||
} else if (selected == 3) { // High
|
} else if (selected == 2) { // High
|
||||||
uiconfig.screen_brightness = 128;
|
uiconfig.screen_brightness = 128;
|
||||||
} else if (selected == 4) { // Very High
|
} else if (selected == 3) { // Very High
|
||||||
uiconfig.screen_brightness = 255;
|
uiconfig.screen_brightness = 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user