|
|
|
|
@@ -134,21 +134,29 @@ const uint32_t rgb_backlight_rainbow_speed_value[RGB_BACKLIGHT_RAINBOW_SPEED_COU
|
|
|
|
|
100, 200, 300, 400, 500, 600, 700, 800, 900, 1000,
|
|
|
|
|
1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000};
|
|
|
|
|
|
|
|
|
|
#define RGB_BACKLIGHT_RAINBOW_STEP_COUNT 10
|
|
|
|
|
#define RGB_BACKLIGHT_RAINBOW_STEP_COUNT 3
|
|
|
|
|
const char* const rgb_backlight_rainbow_step_text[RGB_BACKLIGHT_RAINBOW_STEP_COUNT] = {
|
|
|
|
|
"1",
|
|
|
|
|
"2",
|
|
|
|
|
"3",
|
|
|
|
|
"4",
|
|
|
|
|
"5",
|
|
|
|
|
"6",
|
|
|
|
|
"7",
|
|
|
|
|
"8",
|
|
|
|
|
"9",
|
|
|
|
|
"10",
|
|
|
|
|
};
|
|
|
|
|
const uint32_t rgb_backlight_rainbow_step_value[RGB_BACKLIGHT_RAINBOW_STEP_COUNT] =
|
|
|
|
|
{1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
|
|
|
|
|
const uint32_t rgb_backlight_rainbow_step_value[RGB_BACKLIGHT_RAINBOW_STEP_COUNT] = {
|
|
|
|
|
1,
|
|
|
|
|
2,
|
|
|
|
|
3,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#define RGB_BACKLIGHT_RAINBOW_WIDE_COUNT 3
|
|
|
|
|
const char* const rgb_backlight_rainbow_wide_text[RGB_BACKLIGHT_RAINBOW_WIDE_COUNT] = {
|
|
|
|
|
"1",
|
|
|
|
|
"2",
|
|
|
|
|
"3",
|
|
|
|
|
};
|
|
|
|
|
const uint32_t rgb_backlight_rainbow_wide_value[RGB_BACKLIGHT_RAINBOW_WIDE_COUNT] = {
|
|
|
|
|
30,
|
|
|
|
|
40,
|
|
|
|
|
50,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
MainViewId,
|
|
|
|
|
@@ -234,26 +242,29 @@ static void rgb_backlight_installed_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_installed_text[index]);
|
|
|
|
|
app->notification->rgb_srv->settings->rgb_backlight_installed = rgb_backlight_installed_value[index];
|
|
|
|
|
app->notification->rgb_srv->settings->rgb_backlight_installed =
|
|
|
|
|
rgb_backlight_installed_value[index];
|
|
|
|
|
rgb_backlight_settings_save(app->notification->rgb_srv->settings);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// In case of user playing with rgb_backlight_installed swith:
|
|
|
|
|
// if user swith_off rgb_backlight_installed then force set default orange color
|
|
|
|
|
if (index == 0) {
|
|
|
|
|
rgb_backlight_set_led_static_color (2,0);
|
|
|
|
|
rgb_backlight_set_led_static_color (1,0);
|
|
|
|
|
rgb_backlight_set_led_static_color (0,0);
|
|
|
|
|
// if user swith_off rgb_backlight_installed then force set default orange color - defence from stupid.
|
|
|
|
|
if(index == 0) {
|
|
|
|
|
rgb_backlight_set_led_static_color(2, 0);
|
|
|
|
|
rgb_backlight_set_led_static_color(1, 0);
|
|
|
|
|
rgb_backlight_set_led_static_color(0, 0);
|
|
|
|
|
SK6805_update();
|
|
|
|
|
// if user swith_on rgb_backlight_installed then start rainbow if its ON or set saved static colors
|
|
|
|
|
// start rainbow (if its Enabled) or set saved static colors if user swith_on rgb_backlight_installed switch
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
if (app->notification->rgb_srv->settings->rainbow_mode >0) {
|
|
|
|
|
rainbow_timer_starter (app->notification->rgb_srv);
|
|
|
|
|
if(app->notification->rgb_srv->settings->rainbow_mode > 0) {
|
|
|
|
|
rainbow_timer_starter(app->notification->rgb_srv);
|
|
|
|
|
} else {
|
|
|
|
|
rgb_backlight_set_led_static_color (2,app->notification->rgb_srv->settings->led_2_color_index);
|
|
|
|
|
rgb_backlight_set_led_static_color (1,app->notification->rgb_srv->settings->led_1_color_index);
|
|
|
|
|
rgb_backlight_set_led_static_color (0,app->notification->rgb_srv->settings->led_0_color_index);
|
|
|
|
|
rgb_backlight_update (app->notification->settings.display_brightness);
|
|
|
|
|
rgb_backlight_set_led_static_color(
|
|
|
|
|
2, app->notification->rgb_srv->settings->led_2_color_index);
|
|
|
|
|
rgb_backlight_set_led_static_color(
|
|
|
|
|
1, app->notification->rgb_srv->settings->led_1_color_index);
|
|
|
|
|
rgb_backlight_set_led_static_color(
|
|
|
|
|
0, app->notification->rgb_srv->settings->led_0_color_index);
|
|
|
|
|
rgb_backlight_update(app->notification->settings.display_brightness);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -262,7 +273,7 @@ static void rgb_backlight_installed_changed(VariableItem* item) {
|
|
|
|
|
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
|
|
|
|
|
slide = 1;
|
|
|
|
|
}
|
|
|
|
|
for(int i = slide; i < (slide + 7); i++) {
|
|
|
|
|
for(int i = slide; i < (slide + 8); i++) {
|
|
|
|
|
VariableItem* t_item = variable_item_list_get(app->variable_item_list_rgb, i);
|
|
|
|
|
if(index == 0) {
|
|
|
|
|
variable_item_set_locked(t_item, true, "RGB\nOFF!");
|
|
|
|
|
@@ -279,13 +290,12 @@ static void led_2_color_changed(VariableItem* item) {
|
|
|
|
|
variable_item_set_current_value_text(item, rgb_backlight_get_color_text(index));
|
|
|
|
|
app->notification->rgb_srv->settings->led_2_color_index = index;
|
|
|
|
|
|
|
|
|
|
rgb_backlight_set_led_static_color(2,index);
|
|
|
|
|
rgb_backlight_update(app->notification->rgb_srv->settings->brightness);
|
|
|
|
|
|
|
|
|
|
// dont update display color if rainbow working
|
|
|
|
|
if (!furi_timer_is_running(app->notification->rgb_srv->rainbow_timer)) {
|
|
|
|
|
rgb_backlight_settings_save(app->notification->rgb_srv->settings);
|
|
|
|
|
//dont update screen color if rainbow timer working
|
|
|
|
|
if(!furi_timer_is_running(app->notification->rgb_srv->rainbow_timer)) {
|
|
|
|
|
rgb_backlight_set_led_static_color(2, index);
|
|
|
|
|
rgb_backlight_update(app->notification->rgb_srv->settings->brightness);
|
|
|
|
|
}
|
|
|
|
|
rgb_backlight_settings_save(app->notification->rgb_srv->settings);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void led_1_color_changed(VariableItem* item) {
|
|
|
|
|
@@ -295,13 +305,13 @@ static void led_1_color_changed(VariableItem* item) {
|
|
|
|
|
variable_item_set_current_value_text(item, rgb_backlight_get_color_text(index));
|
|
|
|
|
app->notification->rgb_srv->settings->led_1_color_index = index;
|
|
|
|
|
|
|
|
|
|
rgb_backlight_set_led_static_color(1,index);
|
|
|
|
|
rgb_backlight_settings_save(app->notification->rgb_srv->settings);
|
|
|
|
|
|
|
|
|
|
// dont update display color if rainbow working
|
|
|
|
|
if (!furi_timer_is_running(app->notification->rgb_srv->rainbow_timer)) {
|
|
|
|
|
rgb_backlight_settings_save(app->notification->rgb_srv->settings);
|
|
|
|
|
//dont update screen color if rainbow timer working
|
|
|
|
|
if(!furi_timer_is_running(app->notification->rgb_srv->rainbow_timer)) {
|
|
|
|
|
rgb_backlight_set_led_static_color(1, index);
|
|
|
|
|
rgb_backlight_update(app->notification->rgb_srv->settings->brightness);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rgb_backlight_settings_save(app->notification->rgb_srv->settings);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void led_0_color_changed(VariableItem* item) {
|
|
|
|
|
@@ -311,13 +321,13 @@ static void led_0_color_changed(VariableItem* item) {
|
|
|
|
|
variable_item_set_current_value_text(item, rgb_backlight_get_color_text(index));
|
|
|
|
|
app->notification->rgb_srv->settings->led_0_color_index = index;
|
|
|
|
|
|
|
|
|
|
rgb_backlight_set_led_static_color(0,index);
|
|
|
|
|
rgb_backlight_settings_save(app->notification->rgb_srv->settings);
|
|
|
|
|
|
|
|
|
|
// dont update display color if rainbow working
|
|
|
|
|
if (!furi_timer_is_running(app->notification->rgb_srv->rainbow_timer)) {
|
|
|
|
|
rgb_backlight_settings_save(app->notification->rgb_srv->settings);
|
|
|
|
|
//dont update screen color if rainbow timer working
|
|
|
|
|
if(!furi_timer_is_running(app->notification->rgb_srv->rainbow_timer)) {
|
|
|
|
|
rgb_backlight_set_led_static_color(0, index);
|
|
|
|
|
rgb_backlight_update(app->notification->rgb_srv->settings->brightness);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rgb_backlight_settings_save(app->notification->rgb_srv->settings);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rgb_backlight_rainbow_changed(VariableItem* item) {
|
|
|
|
|
@@ -332,9 +342,12 @@ static void rgb_backlight_rainbow_changed(VariableItem* item) {
|
|
|
|
|
|
|
|
|
|
// restore saved rgb backlight settings if we switch_off rainbow mode
|
|
|
|
|
if(app->notification->rgb_srv->settings->rainbow_mode == 0) {
|
|
|
|
|
rgb_backlight_set_led_static_color (2,app->notification->rgb_srv->settings->led_2_color_index);
|
|
|
|
|
rgb_backlight_set_led_static_color (1,app->notification->rgb_srv->settings->led_1_color_index);
|
|
|
|
|
rgb_backlight_set_led_static_color (0,app->notification->rgb_srv->settings->led_0_color_index);
|
|
|
|
|
rgb_backlight_set_led_static_color(
|
|
|
|
|
2, app->notification->rgb_srv->settings->led_2_color_index);
|
|
|
|
|
rgb_backlight_set_led_static_color(
|
|
|
|
|
1, app->notification->rgb_srv->settings->led_1_color_index);
|
|
|
|
|
rgb_backlight_set_led_static_color(
|
|
|
|
|
0, app->notification->rgb_srv->settings->led_0_color_index);
|
|
|
|
|
rgb_backlight_update(app->notification->rgb_srv->settings->brightness);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -362,294 +375,324 @@ static void rgb_backlight_rainbow_step_changed(VariableItem* item) {
|
|
|
|
|
rgb_backlight_settings_save(app->notification->rgb_srv->settings);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rgb_backlight_rainbow_saturation_changed (VariableItem* item) {
|
|
|
|
|
static void rgb_backlight_rainbow_saturation_changed(VariableItem* item) {
|
|
|
|
|
NotificationAppSettings* app = variable_item_get_context(item);
|
|
|
|
|
|
|
|
|
|
//saturation must be 1..255, so (0..254)+1
|
|
|
|
|
uint8_t index = variable_item_get_current_value_index(item)+1;
|
|
|
|
|
//saturation must be 1..255, so we do (0..254)+1
|
|
|
|
|
uint8_t index = variable_item_get_current_value_index(item) + 1;
|
|
|
|
|
char valtext[4] = {};
|
|
|
|
|
snprintf(valtext, sizeof(valtext), "%d", index);
|
|
|
|
|
variable_item_set_current_value_text(item, valtext);
|
|
|
|
|
app->notification->rgb_srv->settings->rainbow_saturation = index;
|
|
|
|
|
rgb_backlight_settings_save(app->notification->rgb_srv->settings);
|
|
|
|
|
}
|
|
|
|
|
// open rgb_settings_view if user press OK on first (index=0) menu string and (debug mode or rgb_backlight_installed is true)
|
|
|
|
|
void variable_item_list_enter_callback(void* context, uint32_t index) {
|
|
|
|
|
UNUSED(context);
|
|
|
|
|
NotificationAppSettings* app = context;
|
|
|
|
|
|
|
|
|
|
if(((app->notification->rgb_srv->settings->rgb_backlight_installed) ||
|
|
|
|
|
(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug))) &&
|
|
|
|
|
(index == 0)) {
|
|
|
|
|
view_dispatcher_switch_to_view(app->view_dispatcher, RGBViewId);
|
|
|
|
|
}
|
|
|
|
|
static void rgb_backlight_rainbow_wide_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_rainbow_wide_text[index]);
|
|
|
|
|
app->notification->rgb_srv->settings->rainbow_wide = rgb_backlight_rainbow_wide_value[index];
|
|
|
|
|
|
|
|
|
|
//save settings and restart timer with new speed value
|
|
|
|
|
rgb_backlight_settings_save(app->notification->rgb_srv->settings);
|
|
|
|
|
rainbow_timer_starter(app->notification->rgb_srv);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// open rgb_settings_view if user press OK on first (index=0) menu string and (debug mode or rgb_backlight_installed is true)
|
|
|
|
|
void variable_item_list_enter_callback(void* context, uint32_t index) {
|
|
|
|
|
UNUSED(context);
|
|
|
|
|
NotificationAppSettings* app = context;
|
|
|
|
|
|
|
|
|
|
if(((app->notification->rgb_srv->settings->rgb_backlight_installed) ||
|
|
|
|
|
(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug))) &&
|
|
|
|
|
(index == 0)) {
|
|
|
|
|
view_dispatcher_switch_to_view(app->view_dispatcher, RGBViewId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// switch to main view on exit from rgb_settings_view
|
|
|
|
|
static uint32_t notification_app_rgb_settings_exit(void* context) {
|
|
|
|
|
UNUSED(context);
|
|
|
|
|
return MainViewId;
|
|
|
|
|
// switch to main view on exit from rgb_settings_view
|
|
|
|
|
static uint32_t notification_app_rgb_settings_exit(void* context) {
|
|
|
|
|
UNUSED(context);
|
|
|
|
|
return MainViewId;
|
|
|
|
|
}
|
|
|
|
|
//--- RGB BACKLIGHT END ---
|
|
|
|
|
|
|
|
|
|
static uint32_t notification_app_settings_exit(void* context) {
|
|
|
|
|
UNUSED(context);
|
|
|
|
|
return VIEW_NONE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static NotificationAppSettings* alloc_settings(void) {
|
|
|
|
|
NotificationAppSettings* app = malloc(sizeof(NotificationAppSettings));
|
|
|
|
|
app->notification = furi_record_open(RECORD_NOTIFICATION);
|
|
|
|
|
app->gui = furi_record_open(RECORD_GUI);
|
|
|
|
|
|
|
|
|
|
app->variable_item_list = variable_item_list_alloc();
|
|
|
|
|
View* view = variable_item_list_get_view(app->variable_item_list);
|
|
|
|
|
|
|
|
|
|
VariableItem* item;
|
|
|
|
|
uint8_t value_index;
|
|
|
|
|
|
|
|
|
|
//set callback for exit from main view
|
|
|
|
|
view_set_previous_callback(view, notification_app_settings_exit);
|
|
|
|
|
|
|
|
|
|
//--- RGB BACKLIGHT ---
|
|
|
|
|
// set callback for OK pressed in notification settings menu
|
|
|
|
|
variable_item_list_set_enter_callback(
|
|
|
|
|
app->variable_item_list, variable_item_list_enter_callback, app);
|
|
|
|
|
|
|
|
|
|
//Show RGB settings only when debug_mode or rgb_backlight_installed is active
|
|
|
|
|
if((app->notification->rgb_srv->settings->rgb_backlight_installed) ||
|
|
|
|
|
(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug))) {
|
|
|
|
|
item = variable_item_list_add(app->variable_item_list, "RGB settings", 0, NULL, app);
|
|
|
|
|
}
|
|
|
|
|
//--- RGB BACKLIGHT END ---
|
|
|
|
|
|
|
|
|
|
static uint32_t notification_app_settings_exit(void* context) {
|
|
|
|
|
UNUSED(context);
|
|
|
|
|
return VIEW_NONE;
|
|
|
|
|
}
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list, "LCD Contrast", CONTRAST_COUNT, contrast_changed, app);
|
|
|
|
|
value_index =
|
|
|
|
|
value_index_int32(app->notification->settings.contrast, contrast_value, CONTRAST_COUNT);
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, contrast_text[value_index]);
|
|
|
|
|
|
|
|
|
|
static NotificationAppSettings* alloc_settings(void) {
|
|
|
|
|
NotificationAppSettings* app = malloc(sizeof(NotificationAppSettings));
|
|
|
|
|
app->notification = furi_record_open(RECORD_NOTIFICATION);
|
|
|
|
|
app->gui = furi_record_open(RECORD_GUI);
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list, "LCD Backlight", BACKLIGHT_COUNT, backlight_changed, app);
|
|
|
|
|
value_index = value_index_float(
|
|
|
|
|
app->notification->settings.display_brightness, backlight_value, BACKLIGHT_COUNT);
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, backlight_text[value_index]);
|
|
|
|
|
|
|
|
|
|
app->variable_item_list = variable_item_list_alloc();
|
|
|
|
|
View* view = variable_item_list_get_view(app->variable_item_list);
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list, "Backlight Time", DELAY_COUNT, screen_changed, app);
|
|
|
|
|
value_index = value_index_uint32(
|
|
|
|
|
app->notification->settings.display_off_delay_ms, delay_value, DELAY_COUNT);
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, delay_text[value_index]);
|
|
|
|
|
|
|
|
|
|
VariableItem* item;
|
|
|
|
|
uint8_t value_index;
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list, "LED Brightness", BACKLIGHT_COUNT, led_changed, app);
|
|
|
|
|
value_index = value_index_float(
|
|
|
|
|
app->notification->settings.led_brightness, backlight_value, BACKLIGHT_COUNT);
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, backlight_text[value_index]);
|
|
|
|
|
|
|
|
|
|
//set callback for exit from main view
|
|
|
|
|
view_set_previous_callback(view, notification_app_settings_exit);
|
|
|
|
|
|
|
|
|
|
//--- RGB BACKLIGHT ---
|
|
|
|
|
// set callback for OK pressed in notification settings menu
|
|
|
|
|
variable_item_list_set_enter_callback(
|
|
|
|
|
app->variable_item_list, variable_item_list_enter_callback, app);
|
|
|
|
|
|
|
|
|
|
//Show RGB settings only when debug_mode or rgb_backlight_installed is active
|
|
|
|
|
if((app->notification->rgb_srv->settings->rgb_backlight_installed) ||
|
|
|
|
|
(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug))) {
|
|
|
|
|
item = variable_item_list_add(app->variable_item_list, "RGB settings", 0, NULL, app);
|
|
|
|
|
}
|
|
|
|
|
//--- RGB BACKLIGHT END ---
|
|
|
|
|
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list, "LCD Contrast", CONTRAST_COUNT, contrast_changed, app);
|
|
|
|
|
value_index = value_index_int32(
|
|
|
|
|
app->notification->settings.contrast, contrast_value, CONTRAST_COUNT);
|
|
|
|
|
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagStealthMode)) {
|
|
|
|
|
item = variable_item_list_add(app->variable_item_list, "Volume", 1, NULL, app);
|
|
|
|
|
value_index = 0;
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, contrast_text[value_index]);
|
|
|
|
|
|
|
|
|
|
variable_item_set_current_value_text(item, "Stealth");
|
|
|
|
|
} else {
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list, "LCD Backlight", BACKLIGHT_COUNT, backlight_changed, app);
|
|
|
|
|
app->variable_item_list, "Volume", VOLUME_COUNT, volume_changed, app);
|
|
|
|
|
value_index = value_index_float(
|
|
|
|
|
app->notification->settings.display_brightness, backlight_value, BACKLIGHT_COUNT);
|
|
|
|
|
app->notification->settings.speaker_volume, volume_value, VOLUME_COUNT);
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, backlight_text[value_index]);
|
|
|
|
|
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list, "Backlight Time", DELAY_COUNT, screen_changed, app);
|
|
|
|
|
value_index = value_index_uint32(
|
|
|
|
|
app->notification->settings.display_off_delay_ms, delay_value, DELAY_COUNT);
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, delay_text[value_index]);
|
|
|
|
|
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list, "LED Brightness", BACKLIGHT_COUNT, led_changed, app);
|
|
|
|
|
value_index = value_index_float(
|
|
|
|
|
app->notification->settings.led_brightness, backlight_value, BACKLIGHT_COUNT);
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, backlight_text[value_index]);
|
|
|
|
|
|
|
|
|
|
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagStealthMode)) {
|
|
|
|
|
item = variable_item_list_add(app->variable_item_list, "Volume", 1, NULL, app);
|
|
|
|
|
value_index = 0;
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, "Stealth");
|
|
|
|
|
} else {
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list, "Volume", VOLUME_COUNT, volume_changed, app);
|
|
|
|
|
value_index = value_index_float(
|
|
|
|
|
app->notification->settings.speaker_volume, volume_value, VOLUME_COUNT);
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, volume_text[value_index]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagStealthMode)) {
|
|
|
|
|
item = variable_item_list_add(app->variable_item_list, "Vibro", 1, NULL, app);
|
|
|
|
|
value_index = 0;
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, "Stealth");
|
|
|
|
|
} else {
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list, "Vibro", VIBRO_COUNT, vibro_changed, app);
|
|
|
|
|
value_index =
|
|
|
|
|
value_index_bool(app->notification->settings.vibro_on, vibro_value, VIBRO_COUNT);
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, vibro_text[value_index]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--- RGB BACKLIGHT ---
|
|
|
|
|
|
|
|
|
|
app->variable_item_list_rgb = variable_item_list_alloc();
|
|
|
|
|
View* view_rgb = variable_item_list_get_view(app->variable_item_list_rgb);
|
|
|
|
|
|
|
|
|
|
// set callback for exit from rgb_settings_menu
|
|
|
|
|
view_set_previous_callback(view_rgb, notification_app_rgb_settings_exit);
|
|
|
|
|
|
|
|
|
|
// // Show rgb_backlight_Installed_Swith only in Debug mode
|
|
|
|
|
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list_rgb,
|
|
|
|
|
"RGB backlight installed",
|
|
|
|
|
RGB_BACKLIGHT_INSTALLED_COUNT,
|
|
|
|
|
rgb_backlight_installed_changed,
|
|
|
|
|
app);
|
|
|
|
|
value_index = value_index_bool(
|
|
|
|
|
app->notification->rgb_srv->settings->rgb_backlight_installed,
|
|
|
|
|
rgb_backlight_installed_value,
|
|
|
|
|
RGB_BACKLIGHT_INSTALLED_COUNT);
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, rgb_backlight_installed_text[value_index]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// led_1 color
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list_rgb,
|
|
|
|
|
"LED 1 Color",
|
|
|
|
|
rgb_backlight_get_color_count(),
|
|
|
|
|
led_2_color_changed,
|
|
|
|
|
app);
|
|
|
|
|
value_index = app->notification->rgb_srv->settings->led_2_color_index;
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, rgb_backlight_get_color_text(value_index));
|
|
|
|
|
variable_item_set_locked(
|
|
|
|
|
item,
|
|
|
|
|
(app->notification->rgb_srv->settings->rgb_backlight_installed == 0),
|
|
|
|
|
"RGB MOD \nOFF!");
|
|
|
|
|
|
|
|
|
|
// led_2 color
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list_rgb,
|
|
|
|
|
"LED 2 Color",
|
|
|
|
|
rgb_backlight_get_color_count(),
|
|
|
|
|
led_1_color_changed,
|
|
|
|
|
app);
|
|
|
|
|
value_index = app->notification->rgb_srv->settings->led_1_color_index;
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, rgb_backlight_get_color_text(value_index));
|
|
|
|
|
variable_item_set_locked(
|
|
|
|
|
item,
|
|
|
|
|
(app->notification->rgb_srv->settings->rgb_backlight_installed == 0),
|
|
|
|
|
"RGB MOD \nOFF!");
|
|
|
|
|
|
|
|
|
|
// led 3 color
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list_rgb,
|
|
|
|
|
"LED 3 Color",
|
|
|
|
|
rgb_backlight_get_color_count(),
|
|
|
|
|
led_0_color_changed,
|
|
|
|
|
app);
|
|
|
|
|
value_index = app->notification->rgb_srv->settings->led_0_color_index;
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, rgb_backlight_get_color_text(value_index));
|
|
|
|
|
variable_item_set_locked(
|
|
|
|
|
item,
|
|
|
|
|
(app->notification->rgb_srv->settings->rgb_backlight_installed == 0),
|
|
|
|
|
"RGB MOD \nOFF!");
|
|
|
|
|
|
|
|
|
|
// Rainbow mode
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list_rgb,
|
|
|
|
|
"Rainbow mode",
|
|
|
|
|
RGB_BACKLIGHT_RAINBOW_MODE_COUNT,
|
|
|
|
|
rgb_backlight_rainbow_changed,
|
|
|
|
|
app);
|
|
|
|
|
value_index = value_index_uint32(
|
|
|
|
|
app->notification->rgb_srv->settings->rainbow_mode,
|
|
|
|
|
rgb_backlight_rainbow_mode_value,
|
|
|
|
|
RGB_BACKLIGHT_RAINBOW_MODE_COUNT);
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, rgb_backlight_rainbow_mode_text[value_index]);
|
|
|
|
|
variable_item_set_locked(
|
|
|
|
|
item,
|
|
|
|
|
(app->notification->rgb_srv->settings->rgb_backlight_installed == 0),
|
|
|
|
|
"RGB MOD \nOFF!");
|
|
|
|
|
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list_rgb,
|
|
|
|
|
"Rainbow speed",
|
|
|
|
|
RGB_BACKLIGHT_RAINBOW_SPEED_COUNT,
|
|
|
|
|
rgb_backlight_rainbow_speed_changed,
|
|
|
|
|
app);
|
|
|
|
|
value_index = value_index_uint32(
|
|
|
|
|
app->notification->rgb_srv->settings->rainbow_speed_ms,
|
|
|
|
|
rgb_backlight_rainbow_speed_value,
|
|
|
|
|
RGB_BACKLIGHT_RAINBOW_SPEED_COUNT);
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, rgb_backlight_rainbow_speed_text[value_index]);
|
|
|
|
|
variable_item_set_locked(
|
|
|
|
|
item,
|
|
|
|
|
(app->notification->rgb_srv->settings->rgb_backlight_installed == 0),
|
|
|
|
|
"RGB MOD \nOFF!");
|
|
|
|
|
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list_rgb,
|
|
|
|
|
"Rainbow step",
|
|
|
|
|
RGB_BACKLIGHT_RAINBOW_STEP_COUNT,
|
|
|
|
|
rgb_backlight_rainbow_step_changed,
|
|
|
|
|
app);
|
|
|
|
|
value_index = value_index_uint32(
|
|
|
|
|
app->notification->rgb_srv->settings->rainbow_step,
|
|
|
|
|
rgb_backlight_rainbow_step_value,
|
|
|
|
|
RGB_BACKLIGHT_RAINBOW_SPEED_COUNT);
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, rgb_backlight_rainbow_step_text[value_index]);
|
|
|
|
|
variable_item_set_locked(
|
|
|
|
|
item,
|
|
|
|
|
(app->notification->rgb_srv->settings->rgb_backlight_installed == 0),
|
|
|
|
|
"RGB MOD \nOFF!");
|
|
|
|
|
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list_rgb,
|
|
|
|
|
"Saturation",
|
|
|
|
|
255,
|
|
|
|
|
rgb_backlight_rainbow_saturation_changed,
|
|
|
|
|
app);
|
|
|
|
|
value_index = app->notification->rgb_srv->settings->rainbow_saturation;
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
char valtext[4] = {};
|
|
|
|
|
snprintf(valtext, sizeof(valtext), "%d", value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, valtext);
|
|
|
|
|
variable_item_set_locked(
|
|
|
|
|
item,
|
|
|
|
|
(app->notification->rgb_srv->settings->rgb_backlight_installed == 0),
|
|
|
|
|
"RGB MOD \nOFF!");
|
|
|
|
|
|
|
|
|
|
//--- RGB BACKLIGHT END ---
|
|
|
|
|
|
|
|
|
|
app->view_dispatcher = view_dispatcher_alloc();
|
|
|
|
|
view_dispatcher_attach_to_gui(
|
|
|
|
|
app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
|
|
|
|
|
view_dispatcher_add_view(app->view_dispatcher, MainViewId, view);
|
|
|
|
|
view_dispatcher_add_view(app->view_dispatcher, RGBViewId, view_rgb);
|
|
|
|
|
view_dispatcher_switch_to_view(app->view_dispatcher, MainViewId);
|
|
|
|
|
return app;
|
|
|
|
|
variable_item_set_current_value_text(item, volume_text[value_index]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void free_settings(NotificationAppSettings * app) {
|
|
|
|
|
view_dispatcher_remove_view(app->view_dispatcher, MainViewId);
|
|
|
|
|
view_dispatcher_remove_view(app->view_dispatcher, RGBViewId);
|
|
|
|
|
variable_item_list_free(app->variable_item_list);
|
|
|
|
|
variable_item_list_free(app->variable_item_list_rgb);
|
|
|
|
|
view_dispatcher_free(app->view_dispatcher);
|
|
|
|
|
|
|
|
|
|
furi_record_close(RECORD_GUI);
|
|
|
|
|
furi_record_close(RECORD_NOTIFICATION);
|
|
|
|
|
free(app);
|
|
|
|
|
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagStealthMode)) {
|
|
|
|
|
item = variable_item_list_add(app->variable_item_list, "Vibro", 1, NULL, app);
|
|
|
|
|
value_index = 0;
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, "Stealth");
|
|
|
|
|
} else {
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list, "Vibro", VIBRO_COUNT, vibro_changed, app);
|
|
|
|
|
value_index =
|
|
|
|
|
value_index_bool(app->notification->settings.vibro_on, vibro_value, VIBRO_COUNT);
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, vibro_text[value_index]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int32_t notification_settings_app(void* p) {
|
|
|
|
|
UNUSED(p);
|
|
|
|
|
NotificationAppSettings* app = alloc_settings();
|
|
|
|
|
view_dispatcher_run(app->view_dispatcher);
|
|
|
|
|
notification_message_save_settings(app->notification);
|
|
|
|
|
//--- RGB BACKLIGHT ---
|
|
|
|
|
|
|
|
|
|
// Automaticaly switch_off debug_mode when user exit from settings with enabled rgb_backlight_installed
|
|
|
|
|
// if(app->notification->settings.rgb_backlight_installed) {
|
|
|
|
|
// furi_hal_rtc_reset_flag(FuriHalRtcFlagDebug);
|
|
|
|
|
// }
|
|
|
|
|
app->variable_item_list_rgb = variable_item_list_alloc();
|
|
|
|
|
View* view_rgb = variable_item_list_get_view(app->variable_item_list_rgb);
|
|
|
|
|
|
|
|
|
|
free_settings(app);
|
|
|
|
|
return 0;
|
|
|
|
|
// set callback for exit from rgb_settings_menu
|
|
|
|
|
view_set_previous_callback(view_rgb, notification_app_rgb_settings_exit);
|
|
|
|
|
|
|
|
|
|
// // Show rgb_backlight_installed swith only in Debug mode
|
|
|
|
|
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list_rgb,
|
|
|
|
|
"RGB backlight installed",
|
|
|
|
|
RGB_BACKLIGHT_INSTALLED_COUNT,
|
|
|
|
|
rgb_backlight_installed_changed,
|
|
|
|
|
app);
|
|
|
|
|
value_index = value_index_bool(
|
|
|
|
|
app->notification->rgb_srv->settings->rgb_backlight_installed,
|
|
|
|
|
rgb_backlight_installed_value,
|
|
|
|
|
RGB_BACKLIGHT_INSTALLED_COUNT);
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, rgb_backlight_installed_text[value_index]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// We (humans) are numbering LEDs from left to right as 1..3, but hardware have another order from right to left 2..0
|
|
|
|
|
// led_1 color
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list_rgb,
|
|
|
|
|
"LED 1 Color",
|
|
|
|
|
rgb_backlight_get_color_count(),
|
|
|
|
|
led_2_color_changed,
|
|
|
|
|
app);
|
|
|
|
|
value_index = app->notification->rgb_srv->settings->led_2_color_index;
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, rgb_backlight_get_color_text(value_index));
|
|
|
|
|
variable_item_set_locked(
|
|
|
|
|
item,
|
|
|
|
|
(app->notification->rgb_srv->settings->rgb_backlight_installed == 0),
|
|
|
|
|
"RGB MOD \nOFF!");
|
|
|
|
|
|
|
|
|
|
// led_2 color
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list_rgb,
|
|
|
|
|
"LED 2 Color",
|
|
|
|
|
rgb_backlight_get_color_count(),
|
|
|
|
|
led_1_color_changed,
|
|
|
|
|
app);
|
|
|
|
|
value_index = app->notification->rgb_srv->settings->led_1_color_index;
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, rgb_backlight_get_color_text(value_index));
|
|
|
|
|
variable_item_set_locked(
|
|
|
|
|
item,
|
|
|
|
|
(app->notification->rgb_srv->settings->rgb_backlight_installed == 0),
|
|
|
|
|
"RGB MOD \nOFF!");
|
|
|
|
|
|
|
|
|
|
// led 3 color
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list_rgb,
|
|
|
|
|
"LED 3 Color",
|
|
|
|
|
rgb_backlight_get_color_count(),
|
|
|
|
|
led_0_color_changed,
|
|
|
|
|
app);
|
|
|
|
|
value_index = app->notification->rgb_srv->settings->led_0_color_index;
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, rgb_backlight_get_color_text(value_index));
|
|
|
|
|
variable_item_set_locked(
|
|
|
|
|
item,
|
|
|
|
|
(app->notification->rgb_srv->settings->rgb_backlight_installed == 0),
|
|
|
|
|
"RGB MOD \nOFF!");
|
|
|
|
|
|
|
|
|
|
// Rainbow mode
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list_rgb,
|
|
|
|
|
"Rainbow mode",
|
|
|
|
|
RGB_BACKLIGHT_RAINBOW_MODE_COUNT,
|
|
|
|
|
rgb_backlight_rainbow_changed,
|
|
|
|
|
app);
|
|
|
|
|
value_index = value_index_uint32(
|
|
|
|
|
app->notification->rgb_srv->settings->rainbow_mode,
|
|
|
|
|
rgb_backlight_rainbow_mode_value,
|
|
|
|
|
RGB_BACKLIGHT_RAINBOW_MODE_COUNT);
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, rgb_backlight_rainbow_mode_text[value_index]);
|
|
|
|
|
variable_item_set_locked(
|
|
|
|
|
item,
|
|
|
|
|
(app->notification->rgb_srv->settings->rgb_backlight_installed == 0),
|
|
|
|
|
"RGB MOD \nOFF!");
|
|
|
|
|
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list_rgb,
|
|
|
|
|
"Rainbow speed",
|
|
|
|
|
RGB_BACKLIGHT_RAINBOW_SPEED_COUNT,
|
|
|
|
|
rgb_backlight_rainbow_speed_changed,
|
|
|
|
|
app);
|
|
|
|
|
value_index = value_index_uint32(
|
|
|
|
|
app->notification->rgb_srv->settings->rainbow_speed_ms,
|
|
|
|
|
rgb_backlight_rainbow_speed_value,
|
|
|
|
|
RGB_BACKLIGHT_RAINBOW_SPEED_COUNT);
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, rgb_backlight_rainbow_speed_text[value_index]);
|
|
|
|
|
variable_item_set_locked(
|
|
|
|
|
item,
|
|
|
|
|
(app->notification->rgb_srv->settings->rgb_backlight_installed == 0),
|
|
|
|
|
"RGB MOD \nOFF!");
|
|
|
|
|
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list_rgb,
|
|
|
|
|
"Rainbow step",
|
|
|
|
|
RGB_BACKLIGHT_RAINBOW_STEP_COUNT,
|
|
|
|
|
rgb_backlight_rainbow_step_changed,
|
|
|
|
|
app);
|
|
|
|
|
value_index = value_index_uint32(
|
|
|
|
|
app->notification->rgb_srv->settings->rainbow_step,
|
|
|
|
|
rgb_backlight_rainbow_step_value,
|
|
|
|
|
RGB_BACKLIGHT_RAINBOW_STEP_COUNT);
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, rgb_backlight_rainbow_step_text[value_index]);
|
|
|
|
|
variable_item_set_locked(
|
|
|
|
|
item,
|
|
|
|
|
(app->notification->rgb_srv->settings->rgb_backlight_installed == 0),
|
|
|
|
|
"RGB MOD \nOFF!");
|
|
|
|
|
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list_rgb,
|
|
|
|
|
"Saturation",
|
|
|
|
|
255,
|
|
|
|
|
rgb_backlight_rainbow_saturation_changed,
|
|
|
|
|
app);
|
|
|
|
|
value_index = app->notification->rgb_srv->settings->rainbow_saturation;
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
char valtext[4] = {};
|
|
|
|
|
snprintf(valtext, sizeof(valtext), "%d", value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, valtext);
|
|
|
|
|
variable_item_set_locked(
|
|
|
|
|
item,
|
|
|
|
|
(app->notification->rgb_srv->settings->rgb_backlight_installed == 0),
|
|
|
|
|
"RGB MOD \nOFF!");
|
|
|
|
|
|
|
|
|
|
item = variable_item_list_add(
|
|
|
|
|
app->variable_item_list_rgb,
|
|
|
|
|
"Wave wide",
|
|
|
|
|
RGB_BACKLIGHT_RAINBOW_WIDE_COUNT,
|
|
|
|
|
rgb_backlight_rainbow_wide_changed,
|
|
|
|
|
app);
|
|
|
|
|
value_index = value_index_uint32(
|
|
|
|
|
app->notification->rgb_srv->settings->rainbow_wide,
|
|
|
|
|
rgb_backlight_rainbow_wide_value,
|
|
|
|
|
RGB_BACKLIGHT_RAINBOW_WIDE_COUNT);
|
|
|
|
|
variable_item_set_current_value_index(item, value_index);
|
|
|
|
|
variable_item_set_current_value_text(item, rgb_backlight_rainbow_wide_text[value_index]);
|
|
|
|
|
variable_item_set_locked(
|
|
|
|
|
item,
|
|
|
|
|
(app->notification->rgb_srv->settings->rgb_backlight_installed == 0),
|
|
|
|
|
"RGB MOD \nOFF!");
|
|
|
|
|
|
|
|
|
|
//--- RGB BACKLIGHT END ---
|
|
|
|
|
|
|
|
|
|
app->view_dispatcher = view_dispatcher_alloc();
|
|
|
|
|
view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
|
|
|
|
|
view_dispatcher_add_view(app->view_dispatcher, MainViewId, view);
|
|
|
|
|
view_dispatcher_add_view(app->view_dispatcher, RGBViewId, view_rgb);
|
|
|
|
|
view_dispatcher_switch_to_view(app->view_dispatcher, MainViewId);
|
|
|
|
|
return app;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void free_settings(NotificationAppSettings* app) {
|
|
|
|
|
view_dispatcher_remove_view(app->view_dispatcher, MainViewId);
|
|
|
|
|
view_dispatcher_remove_view(app->view_dispatcher, RGBViewId);
|
|
|
|
|
variable_item_list_free(app->variable_item_list);
|
|
|
|
|
variable_item_list_free(app->variable_item_list_rgb);
|
|
|
|
|
view_dispatcher_free(app->view_dispatcher);
|
|
|
|
|
|
|
|
|
|
furi_record_close(RECORD_GUI);
|
|
|
|
|
furi_record_close(RECORD_NOTIFICATION);
|
|
|
|
|
free(app);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int32_t notification_settings_app(void* p) {
|
|
|
|
|
UNUSED(p);
|
|
|
|
|
NotificationAppSettings* app = alloc_settings();
|
|
|
|
|
view_dispatcher_run(app->view_dispatcher);
|
|
|
|
|
notification_message_save_settings(app->notification);
|
|
|
|
|
|
|
|
|
|
// Automaticaly switch_off debug_mode when user exit from settings with enabled rgb_backlight_installed
|
|
|
|
|
// if(app->notification->settings.rgb_backlight_installed) {
|
|
|
|
|
// furi_hal_rtc_reset_flag(FuriHalRtcFlagDebug);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
free_settings(app);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|