mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-19 04:44:47 -07:00
Revert "Small rgb_backlight settings menu changes"
This reverts commit ca2765a3fb.
This commit is contained in:
@@ -9,8 +9,8 @@
|
|||||||
#define RGB_BACKLIGHT_SETTINGS_PATH INT_PATH(RGB_BACKLIGHT_SETTINGS_FILE_NAME)
|
#define RGB_BACKLIGHT_SETTINGS_PATH INT_PATH(RGB_BACKLIGHT_SETTINGS_FILE_NAME)
|
||||||
|
|
||||||
#define RGB_BACKLIGHT_SETTINGS_MAGIC (0x30)
|
#define RGB_BACKLIGHT_SETTINGS_MAGIC (0x30)
|
||||||
#define RGB_BACKLIGHT_SETTINGS_VER_PREV (3) // Previous version number
|
#define RGB_BACKLIGHT_SETTINGS_VER_PREV (2) // Previous version number
|
||||||
#define RGB_BACKLIGHT_SETTINGS_VER (4) // Current version number
|
#define RGB_BACKLIGHT_SETTINGS_VER (3) // Current version number
|
||||||
|
|
||||||
//pervious settings must be copyed from previous rgb_backlight_settings.h file
|
//pervious settings must be copyed from previous rgb_backlight_settings.h file
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ typedef struct {
|
|||||||
float brightness;
|
float brightness;
|
||||||
|
|
||||||
// static gradient mode settings
|
// static gradient mode settings
|
||||||
bool individual_led;
|
|
||||||
uint8_t led_2_color_index;
|
uint8_t led_2_color_index;
|
||||||
uint8_t led_1_color_index;
|
uint8_t led_1_color_index;
|
||||||
uint8_t led_0_color_index;
|
uint8_t led_0_color_index;
|
||||||
|
|||||||
@@ -175,16 +175,6 @@ const uint32_t rgb_backlight_rainbow_wide_value[RGB_BACKLIGHT_RAINBOW_WIDE_COUNT
|
|||||||
50,
|
50,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define RGB_BACKLIGHT_INDIVIDUAL_LED_COUNT 2
|
|
||||||
const char* const rgb_backlight_individual_led_text[RGB_BACKLIGHT_INDIVIDUAL_LED_COUNT] = {
|
|
||||||
"OFF",
|
|
||||||
"ON",
|
|
||||||
};
|
|
||||||
const bool rgb_backlight_individual_value[RGB_BACKLIGHT_INDIVIDUAL_LED_COUNT] = {
|
|
||||||
false,
|
|
||||||
true,
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
MainViewId,
|
MainViewId,
|
||||||
RGBViewId,
|
RGBViewId,
|
||||||
@@ -301,7 +291,7 @@ static void rgb_backlight_installed_changed(VariableItem* item) {
|
|||||||
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
|
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
|
||||||
slide = 1;
|
slide = 1;
|
||||||
}
|
}
|
||||||
for(int i = slide; i < (slide + 9); i++) {
|
for(int i = slide; i < (slide + 8); i++) {
|
||||||
VariableItem* t_item = variable_item_list_get(app->variable_item_list_rgb, i);
|
VariableItem* t_item = variable_item_list_get(app->variable_item_list_rgb, i);
|
||||||
if(index == 0) {
|
if(index == 0) {
|
||||||
variable_item_set_locked(t_item, true, "RGB\nOFF!");
|
variable_item_set_locked(t_item, true, "RGB\nOFF!");
|
||||||
@@ -311,32 +301,6 @@ static void rgb_backlight_installed_changed(VariableItem* item) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void individual_led_changed (VariableItem* item){
|
|
||||||
NotificationAppSettings* app = variable_item_get_context(item);
|
|
||||||
uint8_t index = variable_item_get_current_value_index(item);
|
|
||||||
|
|
||||||
variable_item_set_current_value_text (item,rgb_backlight_individual_led_text[index]);
|
|
||||||
app->notification->rgb_srv->settings->individual_led = index;
|
|
||||||
|
|
||||||
// if individual led OFF - set led0 and led1 colors indexes as led2 index
|
|
||||||
if (index == 0) {
|
|
||||||
app->notification->rgb_srv->settings->led_1_color_index = app->notification->rgb_srv->settings->led_2_color_index;
|
|
||||||
app->notification->rgb_srv->settings->led_0_color_index = app->notification->rgb_srv->settings->led_2_color_index;
|
|
||||||
}
|
|
||||||
|
|
||||||
// enable/disable led0 and led1 color settings
|
|
||||||
for(int i = 2; i < 4; i++) {
|
|
||||||
VariableItem* t_item = variable_item_list_get(app->variable_item_list_rgb, i);
|
|
||||||
if(index == 0) {
|
|
||||||
variable_item_set_locked(t_item, true, "Individual\nleds OFF!");
|
|
||||||
} else {
|
|
||||||
variable_item_set_locked(t_item, false, "Individual\nleds OFF!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
rgb_backlight_update(app->notification->rgb_srv->settings->brightness);
|
|
||||||
//rgb_backlight_settings_save(app->notification->rgb_srv->settings);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void led_2_color_changed(VariableItem* item) {
|
static void led_2_color_changed(VariableItem* item) {
|
||||||
NotificationAppSettings* app = variable_item_get_context(item);
|
NotificationAppSettings* app = variable_item_get_context(item);
|
||||||
uint8_t index = variable_item_get_current_value_index(item);
|
uint8_t index = variable_item_get_current_value_index(item);
|
||||||
@@ -586,22 +550,6 @@ static NotificationAppSettings* alloc_settings(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We (humans) are numbering LEDs from left to right as 1..3, but hardware have another order from right to left 2..0
|
// We (humans) are numbering LEDs from left to right as 1..3, but hardware have another order from right to left 2..0
|
||||||
|
|
||||||
// Individual led color switch
|
|
||||||
item = variable_item_list_add(
|
|
||||||
app->variable_item_list_rgb,
|
|
||||||
"Individual leds colors",
|
|
||||||
RGB_BACKLIGHT_INDIVIDUAL_LED_COUNT,
|
|
||||||
individual_led_changed,
|
|
||||||
app);
|
|
||||||
value_index = app->notification->rgb_srv->settings->individual_led;
|
|
||||||
variable_item_set_current_value_index(item, value_index);
|
|
||||||
variable_item_set_current_value_text(item, rgb_backlight_individual_led_text[value_index]);
|
|
||||||
variable_item_set_locked(
|
|
||||||
item,
|
|
||||||
(app->notification->rgb_srv->settings->rgb_backlight_installed == 0),
|
|
||||||
"RGB MOD \nOFF!");
|
|
||||||
|
|
||||||
// led_1 color
|
// led_1 color
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
app->variable_item_list_rgb,
|
app->variable_item_list_rgb,
|
||||||
@@ -631,10 +579,6 @@ static NotificationAppSettings* alloc_settings(void) {
|
|||||||
item,
|
item,
|
||||||
(app->notification->rgb_srv->settings->rgb_backlight_installed == 0),
|
(app->notification->rgb_srv->settings->rgb_backlight_installed == 0),
|
||||||
"RGB MOD \nOFF!");
|
"RGB MOD \nOFF!");
|
||||||
variable_item_set_locked(
|
|
||||||
item,
|
|
||||||
(!app->notification->rgb_srv->settings->individual_led),
|
|
||||||
"Individual\nleds OFF!");
|
|
||||||
|
|
||||||
// led 3 color
|
// led 3 color
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
@@ -650,15 +594,11 @@ static NotificationAppSettings* alloc_settings(void) {
|
|||||||
item,
|
item,
|
||||||
(app->notification->rgb_srv->settings->rgb_backlight_installed == 0),
|
(app->notification->rgb_srv->settings->rgb_backlight_installed == 0),
|
||||||
"RGB MOD \nOFF!");
|
"RGB MOD \nOFF!");
|
||||||
variable_item_set_locked(
|
|
||||||
item,
|
|
||||||
(!app->notification->rgb_srv->settings->individual_led),
|
|
||||||
"Individual\nleds OFF!");
|
|
||||||
|
|
||||||
// Rainbow mode
|
// Rainbow mode
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
app->variable_item_list_rgb,
|
app->variable_item_list_rgb,
|
||||||
"Dynamic colors mode",
|
"Rainbow mode",
|
||||||
RGB_BACKLIGHT_RAINBOW_MODE_COUNT,
|
RGB_BACKLIGHT_RAINBOW_MODE_COUNT,
|
||||||
rgb_backlight_rainbow_changed,
|
rgb_backlight_rainbow_changed,
|
||||||
app);
|
app);
|
||||||
@@ -675,7 +615,7 @@ static NotificationAppSettings* alloc_settings(void) {
|
|||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
app->variable_item_list_rgb,
|
app->variable_item_list_rgb,
|
||||||
"Mode speed",
|
"Rainbow speed",
|
||||||
RGB_BACKLIGHT_RAINBOW_SPEED_COUNT,
|
RGB_BACKLIGHT_RAINBOW_SPEED_COUNT,
|
||||||
rgb_backlight_rainbow_speed_changed,
|
rgb_backlight_rainbow_speed_changed,
|
||||||
app);
|
app);
|
||||||
@@ -692,7 +632,7 @@ static NotificationAppSettings* alloc_settings(void) {
|
|||||||
|
|
||||||
item = variable_item_list_add(
|
item = variable_item_list_add(
|
||||||
app->variable_item_list_rgb,
|
app->variable_item_list_rgb,
|
||||||
"Colors step",
|
"Rainbow step",
|
||||||
RGB_BACKLIGHT_RAINBOW_STEP_COUNT,
|
RGB_BACKLIGHT_RAINBOW_STEP_COUNT,
|
||||||
rgb_backlight_rainbow_step_changed,
|
rgb_backlight_rainbow_step_changed,
|
||||||
app);
|
app);
|
||||||
|
|||||||
Reference in New Issue
Block a user