diff --git a/applications/main/xtreme_app/scenes/xtreme_app_scene_misc_screen.c b/applications/main/xtreme_app/scenes/xtreme_app_scene_misc_screen.c index cef463b02..76ae26baf 100644 --- a/applications/main/xtreme_app/scenes/xtreme_app_scene_misc_screen.c +++ b/applications/main/xtreme_app/scenes/xtreme_app_scene_misc_screen.c @@ -5,6 +5,9 @@ enum VarItemListIndex { VarItemListIndexLeftHanded, VarItemListIndexRgbBacklight, VarItemListIndexLcdColor, + VarItemListIndexRainbowLcd, + VarItemListIndexRainbowSpeed, + VarItemListIndexRainbowInterval, }; void xtreme_app_scene_misc_screen_var_item_list_callback(void* context, uint32_t index) { @@ -237,6 +240,7 @@ bool xtreme_app_scene_misc_screen_on_event(void* context, SceneManagerEvent even if(change) { XTREME_SETTINGS()->rgb_backlight = !XTREME_SETTINGS()->rgb_backlight; app->save_settings = true; + app->save_backlight = true; notification_message(app->notification, &sequence_display_backlight_on); rgb_backlight_reconfigure(XTREME_SETTINGS()->rgb_backlight); scene_manager_previous_scene(app->scene_manager); diff --git a/firmware/targets/f7/api_symbols.csv b/firmware/targets/f7/api_symbols.csv index ceeb2eaa8..d259477b2 100644 --- a/firmware/targets/f7/api_symbols.csv +++ b/firmware/targets/f7/api_symbols.csv @@ -1734,7 +1734,7 @@ Function,+,hex_char_to_uint8,_Bool,"char, char, uint8_t*" Function,+,hex_chars_to_uint64,_Bool,"const char*, uint64_t*" Function,+,hex_chars_to_uint8,_Bool,"const char*, uint8_t*" Function,+,hsv2rgb,RgbColor,HsvColor -Function,+,hsvcmp,int,"HsvColor*, HsvColor*" +Function,+,hsvcmp,int,"const HsvColor*, const HsvColor*" Function,-,hypot,double,"double, double" Function,-,hypotf,float,"float, float" Function,-,hypotl,long double,"long double, long double" @@ -2570,7 +2570,7 @@ Function,+,rgb_backlight_set_rainbow_interval,void,uint32_t Function,+,rgb_backlight_set_rainbow_mode,void,RGBBacklightRainbowMode Function,+,rgb_backlight_set_rainbow_speed,void,uint8_t Function,-,rgb_backlight_update,void,"uint8_t, _Bool" -Function,+,rgbcmp,int,"RgbColor*, RgbColor*" +Function,+,rgbcmp,int,"const RgbColor*, const RgbColor*" Function,-,rindex,char*,"const char*, int" Function,-,rint,double,double Function,-,rintf,float,float diff --git a/lib/drivers/rgb_backlight.c b/lib/drivers/rgb_backlight.c index a8604034e..e0956f700 100644 --- a/lib/drivers/rgb_backlight.c +++ b/lib/drivers/rgb_backlight.c @@ -53,12 +53,7 @@ static struct { .last_brightness = 0, .last_color = {0, 0, 0}, .rainbow_timer = NULL, - .rainbow_hsv = - { - .h = 0, - .s = 255, - .v = 255, - }, + .rainbow_hsv = {0, 255, 255}, }; static void rainbow_timer(void* ctx) { diff --git a/lib/toolbox/colors.c b/lib/toolbox/colors.c index 612a5f501..33ad8152c 100644 --- a/lib/toolbox/colors.c +++ b/lib/toolbox/colors.c @@ -2,11 +2,11 @@ #include "colors.h" -inline int rgbcmp(RgbColor* a, RgbColor* b) { +inline int rgbcmp(const RgbColor* a, const RgbColor* b) { return memcmp(a, b, sizeof(RgbColor)); } -inline int hsvcmp(HsvColor* a, HsvColor* b) { +inline int hsvcmp(const HsvColor* a, const HsvColor* b) { return memcmp(a, b, sizeof(HsvColor)); } diff --git a/lib/toolbox/colors.h b/lib/toolbox/colors.h index 2d90a72db..902b1a5d0 100644 --- a/lib/toolbox/colors.h +++ b/lib/toolbox/colors.h @@ -19,9 +19,9 @@ typedef struct HsvColor { uint8_t v; } HsvColor; -int rgbcmp(RgbColor* a, RgbColor* b); +int rgbcmp(const RgbColor* a, const RgbColor* b); -int hsvcmp(HsvColor* a, HsvColor* b); +int hsvcmp(const HsvColor* a, const HsvColor* b); RgbColor hsv2rgb(HsvColor hsv);