Remove Rainbow timer bug (after last code cleanup)

This commit is contained in:
Dmitry422
2025-03-25 15:52:38 +07:00
parent b792e094fb
commit 23d2bed66a
2 changed files with 6 additions and 2 deletions

View File

@@ -154,7 +154,9 @@ void rainbow_timer_start(RGBBacklightApp* app) {
// stop furi timer for rainbow // stop furi timer for rainbow
void rainbow_timer_stop(RGBBacklightApp* app) { void rainbow_timer_stop(RGBBacklightApp* app) {
furi_timer_stop(app->rainbow_timer); if (furi_timer_is_running (app->rainbow_timer)){
furi_timer_stop(app->rainbow_timer);
}
} }
// if rgb_backlight_installed then apply rainbow colors to backlight and start/restart/stop rainbow_timer // if rgb_backlight_installed then apply rainbow colors to backlight and start/restart/stop rainbow_timer

View File

@@ -355,7 +355,6 @@ static void rgb_backlight_rainbow_changed(VariableItem* item) {
variable_item_set_current_value_text(item, rgb_backlight_rainbow_mode_text[index]); variable_item_set_current_value_text(item, rgb_backlight_rainbow_mode_text[index]);
app->notification->rgb_srv->settings->rainbow_mode = rgb_backlight_rainbow_mode_value[index]; app->notification->rgb_srv->settings->rainbow_mode = rgb_backlight_rainbow_mode_value[index];
rainbow_timer_starter(app->notification->rgb_srv);
rgb_backlight_settings_save(app->notification->rgb_srv->settings); rgb_backlight_settings_save(app->notification->rgb_srv->settings);
// restore saved rgb backlight settings if we switch_off rainbow mode // restore saved rgb backlight settings if we switch_off rainbow mode
@@ -367,6 +366,9 @@ static void rgb_backlight_rainbow_changed(VariableItem* item) {
rgb_backlight_set_led_static_color( rgb_backlight_set_led_static_color(
0, app->notification->rgb_srv->settings->led_0_color_index); 0, app->notification->rgb_srv->settings->led_0_color_index);
rgb_backlight_update(app->notification->rgb_srv->settings->brightness); rgb_backlight_update(app->notification->rgb_srv->settings->brightness);
rainbow_timer_stop (app->notification->rgb_srv);
} else {
rainbow_timer_starter(app->notification->rgb_srv);
} }
} }