mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-22 05:14:46 -07:00
Rework night shift setting demo
This commit is contained in:
@@ -248,7 +248,7 @@ void night_shift_timer_start(NotificationApp* app) {
|
|||||||
if(furi_timer_is_running(app->night_shift_timer)) {
|
if(furi_timer_is_running(app->night_shift_timer)) {
|
||||||
furi_timer_stop(app->night_shift_timer);
|
furi_timer_stop(app->night_shift_timer);
|
||||||
}
|
}
|
||||||
furi_timer_start(app->night_shift_timer, furi_ms_to_ticks(2000));
|
furi_timer_start(app->night_shift_timer, furi_ms_to_ticks(1000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -277,20 +277,26 @@ void night_shift_timer_callback(void* context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- NIGHT SHIFT END ---
|
// force backlight ON when night_shift_demo_timer will be ended
|
||||||
|
void night_shift_demo_timer_callback(void* context) {
|
||||||
|
furi_assert(context);
|
||||||
|
NotificationApp* app = context;
|
||||||
|
notification_message(app, &sequence_display_backlight_force_on);
|
||||||
|
}
|
||||||
|
// --- NIGHT SHIFT END ---
|
||||||
|
|
||||||
void notification_message_save_settings(NotificationApp* app) {
|
void notification_message_save_settings(NotificationApp * app) {
|
||||||
NotificationAppMessage m = {
|
NotificationAppMessage m = {
|
||||||
.type = SaveSettingsMessage, .back_event = furi_event_flag_alloc()};
|
.type = SaveSettingsMessage, .back_event = furi_event_flag_alloc()};
|
||||||
furi_check(furi_message_queue_put(app->queue, &m, FuriWaitForever) == FuriStatusOk);
|
furi_check(furi_message_queue_put(app->queue, &m, FuriWaitForever) == FuriStatusOk);
|
||||||
furi_event_flag_wait(
|
furi_event_flag_wait(
|
||||||
m.back_event, NOTIFICATION_EVENT_COMPLETE, FuriFlagWaitAny, FuriWaitForever);
|
m.back_event, NOTIFICATION_EVENT_COMPLETE, FuriFlagWaitAny, FuriWaitForever);
|
||||||
furi_event_flag_free(m.back_event);
|
furi_event_flag_free(m.back_event);
|
||||||
}
|
}
|
||||||
|
|
||||||
// internal layer
|
// internal layer
|
||||||
static void
|
static void notification_apply_internal_led_layer(
|
||||||
notification_apply_internal_led_layer(NotificationLedLayer* layer, uint8_t layer_value) {
|
NotificationLedLayer * layer, uint8_t layer_value) {
|
||||||
furi_assert(layer);
|
furi_assert(layer);
|
||||||
furi_assert(layer->index < LayerMAX);
|
furi_assert(layer->index < LayerMAX);
|
||||||
|
|
||||||
@@ -301,15 +307,15 @@ static void
|
|||||||
if(layer->index == LayerInternal) {
|
if(layer->index == LayerInternal) {
|
||||||
furi_hal_light_set(layer->light, layer->value[LayerInternal]);
|
furi_hal_light_set(layer->light, layer->value[LayerInternal]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void notification_apply_lcd_contrast(NotificationApp* app) {
|
static void notification_apply_lcd_contrast(NotificationApp * app) {
|
||||||
Gui* gui = furi_record_open(RECORD_GUI);
|
Gui* gui = furi_record_open(RECORD_GUI);
|
||||||
u8x8_d_st756x_set_contrast(&gui->canvas->fb.u8x8, app->settings.contrast);
|
u8x8_d_st756x_set_contrast(&gui->canvas->fb.u8x8, app->settings.contrast);
|
||||||
furi_record_close(RECORD_GUI);
|
furi_record_close(RECORD_GUI);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool notification_is_any_led_layer_internal_and_not_empty(NotificationApp* app) {
|
static bool notification_is_any_led_layer_internal_and_not_empty(NotificationApp * app) {
|
||||||
bool result = false;
|
bool result = false;
|
||||||
if((app->led[0].index == LayerInternal) || (app->led[1].index == LayerInternal) ||
|
if((app->led[0].index == LayerInternal) || (app->led[1].index == LayerInternal) ||
|
||||||
(app->led[2].index == LayerInternal)) {
|
(app->led[2].index == LayerInternal)) {
|
||||||
@@ -321,12 +327,11 @@ static bool notification_is_any_led_layer_internal_and_not_empty(NotificationApp
|
|||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// notification layer
|
// notification layer
|
||||||
static void notification_apply_notification_led_layer(
|
static void notification_apply_notification_led_layer(
|
||||||
NotificationLedLayer* layer,
|
NotificationLedLayer * layer, const uint8_t layer_value) {
|
||||||
const uint8_t layer_value) {
|
|
||||||
furi_assert(layer);
|
furi_assert(layer);
|
||||||
furi_assert(layer->index < LayerMAX);
|
furi_assert(layer->index < LayerMAX);
|
||||||
|
|
||||||
@@ -341,9 +346,9 @@ static void notification_apply_notification_led_layer(
|
|||||||
|
|
||||||
// apply
|
// apply
|
||||||
furi_hal_light_set(layer->light, layer->value[LayerNotification]);
|
furi_hal_light_set(layer->light, layer->value[LayerNotification]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void notification_reset_notification_led_layer(NotificationLedLayer* layer) {
|
static void notification_reset_notification_led_layer(NotificationLedLayer * layer) {
|
||||||
furi_assert(layer);
|
furi_assert(layer);
|
||||||
furi_assert(layer->index < LayerMAX);
|
furi_assert(layer->index < LayerMAX);
|
||||||
|
|
||||||
@@ -354,12 +359,10 @@ static void notification_reset_notification_led_layer(NotificationLedLayer* laye
|
|||||||
|
|
||||||
// apply
|
// apply
|
||||||
furi_hal_light_set(layer->light, layer->value[LayerInternal]);
|
furi_hal_light_set(layer->light, layer->value[LayerInternal]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void notification_reset_notification_layer(
|
static void notification_reset_notification_layer(
|
||||||
NotificationApp* app,
|
NotificationApp * app, uint8_t reset_mask, float display_brightness_set) {
|
||||||
uint8_t reset_mask,
|
|
||||||
float display_brightness_set) {
|
|
||||||
if(reset_mask & reset_blink_mask) {
|
if(reset_mask & reset_blink_mask) {
|
||||||
furi_hal_light_blink_stop();
|
furi_hal_light_blink_stop();
|
||||||
}
|
}
|
||||||
@@ -389,66 +392,67 @@ static void notification_reset_notification_layer(
|
|||||||
app->display_timer, notification_settings_display_off_delay_ticks(app));
|
app->display_timer, notification_settings_display_off_delay_ticks(app));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void notification_apply_notification_leds(NotificationApp* app, const uint8_t* values) {
|
static void notification_apply_notification_leds(
|
||||||
|
NotificationApp * app, const uint8_t* values) {
|
||||||
for(uint8_t i = 0; i < NOTIFICATION_LED_COUNT; i++) {
|
for(uint8_t i = 0; i < NOTIFICATION_LED_COUNT; i++) {
|
||||||
notification_apply_notification_led_layer(
|
notification_apply_notification_led_layer(
|
||||||
&app->led[i], notification_settings_get_rgb_led_brightness(app, values[i]));
|
&app->led[i], notification_settings_get_rgb_led_brightness(app, values[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// settings
|
// settings
|
||||||
uint8_t notification_settings_get_display_brightness(NotificationApp* app, uint8_t value) {
|
uint8_t notification_settings_get_display_brightness(NotificationApp * app, uint8_t value) {
|
||||||
return value * app->settings.display_brightness;
|
return value * app->settings.display_brightness;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint8_t notification_settings_get_rgb_led_brightness(NotificationApp* app, uint8_t value) {
|
static uint8_t notification_settings_get_rgb_led_brightness(
|
||||||
|
NotificationApp * app, uint8_t value) {
|
||||||
return value * app->settings.led_brightness;
|
return value * app->settings.led_brightness;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t notification_settings_display_off_delay_ticks(NotificationApp* app) {
|
static uint32_t notification_settings_display_off_delay_ticks(NotificationApp * app) {
|
||||||
return (float)(app->settings.display_off_delay_ms) /
|
return (float)(app->settings.display_off_delay_ms) /
|
||||||
(1000.0f / furi_kernel_get_tick_frequency());
|
(1000.0f / furi_kernel_get_tick_frequency());
|
||||||
}
|
}
|
||||||
|
|
||||||
// generics
|
// generics
|
||||||
static void notification_vibro_on(bool force) {
|
static void notification_vibro_on(bool force) {
|
||||||
if(!furi_hal_rtc_is_flag_set(FuriHalRtcFlagStealthMode) || force) {
|
if(!furi_hal_rtc_is_flag_set(FuriHalRtcFlagStealthMode) || force) {
|
||||||
furi_hal_vibro_on(true);
|
furi_hal_vibro_on(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void notification_vibro_off(void) {
|
static void notification_vibro_off(void) {
|
||||||
furi_hal_vibro_on(false);
|
furi_hal_vibro_on(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void notification_sound_on(float freq, float volume, bool force) {
|
static void notification_sound_on(float freq, float volume, bool force) {
|
||||||
if(!furi_hal_rtc_is_flag_set(FuriHalRtcFlagStealthMode) || force) {
|
if(!furi_hal_rtc_is_flag_set(FuriHalRtcFlagStealthMode) || force) {
|
||||||
if(furi_hal_speaker_is_mine() || furi_hal_speaker_acquire(30)) {
|
if(furi_hal_speaker_is_mine() || furi_hal_speaker_acquire(30)) {
|
||||||
furi_hal_speaker_start(freq, volume);
|
furi_hal_speaker_start(freq, volume);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void notification_sound_off(void) {
|
static void notification_sound_off(void) {
|
||||||
if(furi_hal_speaker_is_mine()) {
|
if(furi_hal_speaker_is_mine()) {
|
||||||
furi_hal_speaker_stop();
|
furi_hal_speaker_stop();
|
||||||
furi_hal_speaker_release();
|
furi_hal_speaker_release();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// display timer
|
// display timer
|
||||||
static void notification_display_timer(void* ctx) {
|
static void notification_display_timer(void* ctx) {
|
||||||
furi_assert(ctx);
|
furi_assert(ctx);
|
||||||
NotificationApp* app = ctx;
|
NotificationApp* app = ctx;
|
||||||
notification_message(app, &sequence_display_backlight_off);
|
notification_message(app, &sequence_display_backlight_off);
|
||||||
}
|
}
|
||||||
|
|
||||||
// message processing
|
// message processing
|
||||||
static void notification_process_notification_message(
|
static void notification_process_notification_message(
|
||||||
NotificationApp* app,
|
NotificationApp * app, NotificationAppMessage * message) {
|
||||||
NotificationAppMessage* message) {
|
|
||||||
uint32_t notification_message_index = 0;
|
uint32_t notification_message_index = 0;
|
||||||
bool force_volume = false;
|
bool force_volume = false;
|
||||||
bool force_vibro = false;
|
bool force_vibro = false;
|
||||||
@@ -667,10 +671,10 @@ static void notification_process_notification_message(
|
|||||||
if(reset_notifications) {
|
if(reset_notifications) {
|
||||||
notification_reset_notification_layer(app, reset_mask, display_brightness_setting);
|
notification_reset_notification_layer(app, reset_mask, display_brightness_setting);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void notification_process_internal_message(
|
||||||
notification_process_internal_message(NotificationApp* app, NotificationAppMessage* message) {
|
NotificationApp * app, NotificationAppMessage * message) {
|
||||||
uint32_t notification_message_index = 0;
|
uint32_t notification_message_index = 0;
|
||||||
const NotificationMessage* notification_message;
|
const NotificationMessage* notification_message;
|
||||||
notification_message = (*message->sequence)[notification_message_index];
|
notification_message = (*message->sequence)[notification_message_index];
|
||||||
@@ -717,9 +721,9 @@ static void
|
|||||||
notification_message_index++;
|
notification_message_index++;
|
||||||
notification_message = (*message->sequence)[notification_message_index];
|
notification_message = (*message->sequence)[notification_message_index];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool notification_load_settings(NotificationApp* app) {
|
static bool notification_load_settings(NotificationApp * app) {
|
||||||
NotificationSettings settings;
|
NotificationSettings settings;
|
||||||
File* file = storage_file_alloc(furi_record_open(RECORD_STORAGE));
|
File* file = storage_file_alloc(furi_record_open(RECORD_STORAGE));
|
||||||
const size_t settings_size = sizeof(NotificationSettings);
|
const size_t settings_size = sizeof(NotificationSettings);
|
||||||
@@ -739,7 +743,10 @@ static bool notification_load_settings(NotificationApp* app) {
|
|||||||
if(fs_result) {
|
if(fs_result) {
|
||||||
if(settings.version != NOTIFICATION_SETTINGS_VERSION) {
|
if(settings.version != NOTIFICATION_SETTINGS_VERSION) {
|
||||||
FURI_LOG_E(
|
FURI_LOG_E(
|
||||||
TAG, "version(%d != %d) mismatch", settings.version, NOTIFICATION_SETTINGS_VERSION);
|
TAG,
|
||||||
|
"version(%d != %d) mismatch",
|
||||||
|
settings.version,
|
||||||
|
NOTIFICATION_SETTINGS_VERSION);
|
||||||
} else {
|
} else {
|
||||||
furi_kernel_lock();
|
furi_kernel_lock();
|
||||||
memcpy(&app->settings, &settings, settings_size);
|
memcpy(&app->settings, &settings, settings_size);
|
||||||
@@ -754,9 +761,9 @@ static bool notification_load_settings(NotificationApp* app) {
|
|||||||
furi_record_close(RECORD_STORAGE);
|
furi_record_close(RECORD_STORAGE);
|
||||||
|
|
||||||
return fs_result;
|
return fs_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool notification_save_settings(NotificationApp* app) {
|
static bool notification_save_settings(NotificationApp * app) {
|
||||||
NotificationSettings settings;
|
NotificationSettings settings;
|
||||||
File* file = storage_file_alloc(furi_record_open(RECORD_STORAGE));
|
File* file = storage_file_alloc(furi_record_open(RECORD_STORAGE));
|
||||||
const size_t settings_size = sizeof(NotificationSettings);
|
const size_t settings_size = sizeof(NotificationSettings);
|
||||||
@@ -788,17 +795,17 @@ static bool notification_save_settings(NotificationApp* app) {
|
|||||||
furi_record_close(RECORD_STORAGE);
|
furi_record_close(RECORD_STORAGE);
|
||||||
|
|
||||||
return fs_result;
|
return fs_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void input_event_callback(const void* value, void* context) {
|
static void input_event_callback(const void* value, void* context) {
|
||||||
furi_assert(value);
|
furi_assert(value);
|
||||||
furi_assert(context);
|
furi_assert(context);
|
||||||
NotificationApp* app = context;
|
NotificationApp* app = context;
|
||||||
notification_message(app, &sequence_display_backlight_on);
|
notification_message(app, &sequence_display_backlight_on);
|
||||||
}
|
}
|
||||||
|
|
||||||
// App alloc
|
// App alloc
|
||||||
static NotificationApp* notification_app_alloc(void) {
|
static NotificationApp* notification_app_alloc(void) {
|
||||||
NotificationApp* app = malloc(sizeof(NotificationApp));
|
NotificationApp* app = malloc(sizeof(NotificationApp));
|
||||||
app->queue = furi_message_queue_alloc(8, sizeof(NotificationAppMessage));
|
app->queue = furi_message_queue_alloc(8, sizeof(NotificationAppMessage));
|
||||||
app->display_timer = furi_timer_alloc(notification_display_timer, FuriTimerTypeOnce, app);
|
app->display_timer = furi_timer_alloc(notification_display_timer, FuriTimerTypeOnce, app);
|
||||||
@@ -864,9 +871,9 @@ static NotificationApp* notification_app_alloc(void) {
|
|||||||
app->settings.lcd_inversion = false;
|
app->settings.lcd_inversion = false;
|
||||||
|
|
||||||
return app;
|
return app;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void notification_storage_callback(const void* message, void* context) {
|
static void notification_storage_callback(const void* message, void* context) {
|
||||||
furi_assert(context);
|
furi_assert(context);
|
||||||
NotificationApp* app = context;
|
NotificationApp* app = context;
|
||||||
const StorageEvent* event = message;
|
const StorageEvent* event = message;
|
||||||
@@ -878,9 +885,9 @@ static void notification_storage_callback(const void* message, void* context) {
|
|||||||
|
|
||||||
furi_check(furi_message_queue_put(app->queue, &m, FuriWaitForever) == FuriStatusOk);
|
furi_check(furi_message_queue_put(app->queue, &m, FuriWaitForever) == FuriStatusOk);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void notification_apply_settings(NotificationApp* app) {
|
static void notification_apply_settings(NotificationApp * app) {
|
||||||
if(!notification_load_settings(app)) {
|
if(!notification_load_settings(app)) {
|
||||||
notification_save_settings(app);
|
notification_save_settings(app);
|
||||||
}
|
}
|
||||||
@@ -900,9 +907,9 @@ static void notification_apply_settings(NotificationApp* app) {
|
|||||||
u8x8_d_st756x_set_inversion(&gui->canvas->fb.u8x8, app->settings.lcd_inversion);
|
u8x8_d_st756x_set_inversion(&gui->canvas->fb.u8x8, app->settings.lcd_inversion);
|
||||||
furi_record_close(RECORD_GUI);
|
furi_record_close(RECORD_GUI);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void notification_init_settings(NotificationApp* app) {
|
static void notification_init_settings(NotificationApp * app) {
|
||||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||||
furi_pubsub_subscribe(storage_get_pubsub(storage), notification_storage_callback, app);
|
furi_pubsub_subscribe(storage_get_pubsub(storage), notification_storage_callback, app);
|
||||||
|
|
||||||
@@ -912,10 +919,10 @@ static void notification_init_settings(NotificationApp* app) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
notification_apply_settings(app);
|
notification_apply_settings(app);
|
||||||
}
|
}
|
||||||
|
|
||||||
// App
|
// App
|
||||||
int32_t notification_srv(void* p) {
|
int32_t notification_srv(void* p) {
|
||||||
UNUSED(p);
|
UNUSED(p);
|
||||||
NotificationApp* app = notification_app_alloc();
|
NotificationApp* app = notification_app_alloc();
|
||||||
|
|
||||||
@@ -938,6 +945,11 @@ int32_t notification_srv(void* p) {
|
|||||||
// define rainbow_timer and they callback
|
// define rainbow_timer and they callback
|
||||||
app->rainbow_timer = furi_timer_alloc(rainbow_timer_callback, FuriTimerTypePeriodic, app);
|
app->rainbow_timer = furi_timer_alloc(rainbow_timer_callback, FuriTimerTypePeriodic, app);
|
||||||
|
|
||||||
|
// define night_shift_demo_timer and they callback.
|
||||||
|
// used for Setting menu to demonstrate night_shift_backlight when user change value
|
||||||
|
app->night_shift_demo_timer =
|
||||||
|
furi_timer_alloc(night_shift_demo_timer_callback, FuriTimerTypeOnce, app);
|
||||||
|
|
||||||
// if rgb_backlight_installed then start rainbow or set leds colors from saved settings (default index = 0)
|
// if rgb_backlight_installed then start rainbow or set leds colors from saved settings (default index = 0)
|
||||||
if(app->settings.rgb.rgb_backlight_installed) {
|
if(app->settings.rgb.rgb_backlight_installed) {
|
||||||
if(app->settings.rgb.rainbow_mode > 0) {
|
if(app->settings.rgb.rainbow_mode > 0) {
|
||||||
@@ -960,7 +972,8 @@ int32_t notification_srv(void* p) {
|
|||||||
|
|
||||||
NotificationAppMessage message;
|
NotificationAppMessage message;
|
||||||
while(1) {
|
while(1) {
|
||||||
furi_check(furi_message_queue_get(app->queue, &message, FuriWaitForever) == FuriStatusOk);
|
furi_check(
|
||||||
|
furi_message_queue_get(app->queue, &message, FuriWaitForever) == FuriStatusOk);
|
||||||
|
|
||||||
switch(message.type) {
|
switch(message.type) {
|
||||||
case NotificationLayerMessage:
|
case NotificationLayerMessage:
|
||||||
@@ -983,4 +996,4 @@ int32_t notification_srv(void* p) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ struct NotificationApp {
|
|||||||
NotificationSettings settings;
|
NotificationSettings settings;
|
||||||
|
|
||||||
FuriTimer* night_shift_timer;
|
FuriTimer* night_shift_timer;
|
||||||
|
FuriTimer* night_shift_demo_timer;
|
||||||
float current_night_shift;
|
float current_night_shift;
|
||||||
|
|
||||||
FuriTimer* rainbow_timer;
|
FuriTimer* rainbow_timer;
|
||||||
|
|||||||
@@ -558,10 +558,6 @@ static void night_shift_changed(VariableItem* item) {
|
|||||||
variable_item_set_current_value_text(item, night_shift_text[index]);
|
variable_item_set_current_value_text(item, night_shift_text[index]);
|
||||||
app->notification->settings.night_shift = night_shift_value[index];
|
app->notification->settings.night_shift = night_shift_value[index];
|
||||||
|
|
||||||
// force demo night_shift brightness to rgb backlight and stock backlight
|
|
||||||
// app->notification->current_night_shift = night_shift_value[index];
|
|
||||||
// notification_message(app->notification, &sequence_display_backlight_force_on);
|
|
||||||
|
|
||||||
for(int i = 4; i < 6; i++) {
|
for(int i = 4; i < 6; i++) {
|
||||||
VariableItem* t_item = variable_item_list_get(app->variable_item_list, i);
|
VariableItem* t_item = variable_item_list_get(app->variable_item_list, i);
|
||||||
if(index == 0) {
|
if(index == 0) {
|
||||||
@@ -571,10 +567,22 @@ static void night_shift_changed(VariableItem* item) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// force demo night_shift brightness to rgb backlight and stock backlight for 1,2 sec
|
||||||
|
// while 1,2 seconds are running, there is another timer "night_shift_timer" can change current_night_shift to day or night value
|
||||||
|
// so when night_shift_demo_timer ended backlight force ON to day or night brightness
|
||||||
|
app->notification->current_night_shift = night_shift_value[index];
|
||||||
|
notification_message(app->notification, &sequence_display_backlight_force_on);
|
||||||
|
|
||||||
if(night_shift_value[index] != 1) {
|
if(night_shift_value[index] != 1) {
|
||||||
night_shift_timer_start(app->notification);
|
night_shift_timer_start(app->notification);
|
||||||
|
if(furi_timer_is_running(app->notification->night_shift_demo_timer)) {
|
||||||
|
furi_timer_stop(app->notification->night_shift_demo_timer);
|
||||||
|
}
|
||||||
|
furi_timer_start(app->notification->night_shift_demo_timer, furi_ms_to_ticks(1200));
|
||||||
} else {
|
} else {
|
||||||
night_shift_timer_stop(app->notification);
|
night_shift_timer_stop(app->notification);
|
||||||
|
if(furi_timer_is_running(app->notification->night_shift_demo_timer))
|
||||||
|
furi_timer_stop(app->notification->night_shift_demo_timer);
|
||||||
}
|
}
|
||||||
|
|
||||||
notification_message_save_settings(app->notification);
|
notification_message_save_settings(app->notification);
|
||||||
|
|||||||
Reference in New Issue
Block a user