mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-22 05:14:46 -07:00
Backlight settings bug
This commit is contained in:
@@ -65,6 +65,7 @@ typedef enum {
|
||||
NotificationMessageTypeDelay,
|
||||
|
||||
NotificationMessageTypeLedDisplayBacklight,
|
||||
NotificationMessageTypeLedDisplayBacklightForceOn,
|
||||
NotificationMessageTypeLedDisplayBacklightEnforceOn,
|
||||
NotificationMessageTypeLedDisplayBacklightEnforceAuto,
|
||||
|
||||
|
||||
@@ -498,6 +498,19 @@ static void notification_process_notification_message(
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NotificationMessageTypeLedDisplayBacklightForceOn:
|
||||
// Force Backlight ON even if its ON now
|
||||
lcd_backlight_is_on = false;
|
||||
notification_apply_notification_led_layer(
|
||||
&app->display,
|
||||
notification_message->data.led.value * display_brightness_setting *
|
||||
app->current_night_shift * 1.0f);
|
||||
reset_mask |= reset_display_mask;
|
||||
lcd_backlight_is_on = true;
|
||||
|
||||
//start rgb_mod_rainbow_timer when display backlight is ON and all corresponding settings is ON too
|
||||
rainbow_timer_starter(app);
|
||||
break;
|
||||
case NotificationMessageTypeLedDisplayBacklightEnforceOn:
|
||||
if(!app->display_led_lock) {
|
||||
app->display_led_lock = true;
|
||||
|
||||
@@ -17,6 +17,12 @@ const NotificationMessage message_display_backlight_off = {
|
||||
.data.led.value = 0x00,
|
||||
};
|
||||
|
||||
/** Display: backlight wakeup even if its ON now */
|
||||
const NotificationMessage message_display_backlight_force_on = {
|
||||
.type = NotificationMessageTypeLedDisplayBacklightForceOn,
|
||||
.data.led.value = 0xFF,
|
||||
};
|
||||
|
||||
/** Display: backlight always on */
|
||||
const NotificationMessage message_display_backlight_enforce_on = {
|
||||
.type = NotificationMessageTypeLedDisplayBacklightEnforceOn,
|
||||
@@ -259,6 +265,12 @@ const NotificationSequence sequence_display_backlight_off = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
/** Display: backlight wakeup even if its ON now */
|
||||
const NotificationSequence sequence_display_backlight_force_on = {
|
||||
&message_display_backlight_force_on,
|
||||
NULL,
|
||||
};
|
||||
|
||||
/** Display: backlight always on lock */
|
||||
const NotificationSequence sequence_display_backlight_enforce_on = {
|
||||
&message_display_backlight_enforce_on,
|
||||
|
||||
@@ -87,7 +87,8 @@ extern const NotificationSequence sequence_display_backlight_on;
|
||||
extern const NotificationSequence sequence_display_backlight_off;
|
||||
/** Display: backlight force off after a delay of 1000ms */
|
||||
extern const NotificationSequence sequence_display_backlight_off_delay_1000;
|
||||
|
||||
/** Display: backlight wakeup even if its ON now */
|
||||
extern const NotificationSequence sequence_display_backlight_force_on;
|
||||
/** Display: backlight always on lock */
|
||||
extern const NotificationSequence sequence_display_backlight_enforce_on;
|
||||
/** Display: backlight always on unlock */
|
||||
|
||||
@@ -295,7 +295,7 @@ static void backlight_changed(VariableItem* item) {
|
||||
variable_item_set_current_value_text(item, backlight_text[index]);
|
||||
app->notification->settings.display_brightness = backlight_value[index];
|
||||
|
||||
notification_message(app->notification, &sequence_display_backlight_on);
|
||||
notification_message(app->notification, &sequence_display_backlight_force_on);
|
||||
}
|
||||
|
||||
static void screen_changed(VariableItem* item) {
|
||||
@@ -557,11 +557,10 @@ static void night_shift_changed(VariableItem* item) {
|
||||
|
||||
variable_item_set_current_value_text(item, night_shift_text[index]);
|
||||
app->notification->settings.night_shift = night_shift_value[index];
|
||||
app->notification->current_night_shift = night_shift_value[index];
|
||||
app->notification->current_night_shift = night_shift_value[index];
|
||||
|
||||
// force demo night_shift brightness to rgb backlight and stock backlight
|
||||
notification_message(app->notification, &sequence_display_backlight_on);
|
||||
// app->notification->current_night_shift = night_shift_value[index];
|
||||
// notification_message(app->notification, &sequence_display_backlight_force_on);
|
||||
|
||||
for(int i = 4; i < 6; i++) {
|
||||
VariableItem* t_item = variable_item_list_get(app->variable_item_list, i);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
entry,status,name,type,params
|
||||
Version,+,87.5,,
|
||||
Version,+,87.6,,
|
||||
Header,+,applications/drivers/subghz/cc1101_ext/cc1101_ext_interconnect.h,,
|
||||
Header,+,applications/services/applications.h,,
|
||||
Header,+,applications/services/bt/bt_service/bt.h,,
|
||||
@@ -5383,6 +5383,7 @@ Variable,+,sequence_charged,const NotificationSequence,
|
||||
Variable,+,sequence_charging,const NotificationSequence,
|
||||
Variable,+,sequence_display_backlight_enforce_auto,const NotificationSequence,
|
||||
Variable,+,sequence_display_backlight_enforce_on,const NotificationSequence,
|
||||
Variable,+,sequence_display_backlight_force_on,const NotificationSequence,
|
||||
Variable,+,sequence_display_backlight_off,const NotificationSequence,
|
||||
Variable,+,sequence_display_backlight_off_delay_1000,const NotificationSequence,
|
||||
Variable,+,sequence_display_backlight_on,const NotificationSequence,
|
||||
|
||||
|
Reference in New Issue
Block a user