[FL-2515] Keep backlight on for updater ops (#1184)

* [FL-2515] Keep backlight on for updater ops
* Notification: Renamed backlight sequences to more obvious names

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
hedger
2022-04-29 17:21:12 +03:00
committed by GitHub
parent 01434265f6
commit 7017fa4f9e
19 changed files with 77 additions and 70 deletions

View File

@@ -152,7 +152,7 @@ void notification_sound_off() {
static void notification_display_timer(void* ctx) {
furi_assert(ctx);
NotificationApp* app = ctx;
notification_message(app, &sequence_display_off);
notification_message(app, &sequence_display_backlight_off);
}
// message processing
@@ -174,7 +174,7 @@ void notification_process_notification_message(
while(notification_message != NULL) {
switch(notification_message->type) {
case NotificationMessageTypeLedDisplay:
case NotificationMessageTypeLedDisplayBacklight:
// if on - switch on and start timer
// if off - switch off and stop timer
// on timer - switch off
@@ -190,7 +190,7 @@ void notification_process_notification_message(
}
reset_mask |= reset_display_mask;
break;
case NotificationMessageTypeLedDisplayLock:
case NotificationMessageTypeLedDisplayBacklightEnforceOn:
furi_assert(app->display_led_lock < UINT8_MAX);
app->display_led_lock++;
if(app->display_led_lock == 1) {
@@ -199,7 +199,7 @@ void notification_process_notification_message(
notification_message->data.led.value * display_brightness_setting);
}
break;
case NotificationMessageTypeLedDisplayUnlock:
case NotificationMessageTypeLedDisplayBacklightEnforceAuto:
furi_assert(app->display_led_lock > 0);
app->display_led_lock--;
if(app->display_led_lock == 0) {
@@ -322,7 +322,7 @@ void notification_process_internal_message(NotificationApp* app, NotificationApp
while(notification_message != NULL) {
switch(notification_message->type) {
case NotificationMessageTypeLedDisplay:
case NotificationMessageTypeLedDisplayBacklight:
notification_apply_internal_led_layer(
&app->display,
notification_settings_get_display_brightness(
@@ -442,7 +442,7 @@ static void input_event_callback(const void* value, void* context) {
furi_assert(value);
furi_assert(context);
NotificationApp* app = context;
notification_message(app, &sequence_display_on);
notification_message(app, &sequence_display_backlight_on);
}
// App alloc
@@ -482,7 +482,7 @@ static NotificationApp* notification_app_alloc() {
// display backlight control
app->event_record = furi_record_open("input_events");
furi_pubsub_subscribe(app->event_record, input_event_callback, app);
notification_message(app, &sequence_display_on);
notification_message(app, &sequence_display_backlight_on);
return app;
};