mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-12 12:42:30 +04:00
Night shift done.
This commit is contained in:
@@ -53,7 +53,8 @@ void night_shift_timer_callback(void* context) {
|
||||
NotificationApp* app = context;
|
||||
DateTime current_date_time;
|
||||
|
||||
// save current night_shift;
|
||||
// IN DEVELOPMENT
|
||||
// // save current night_shift;
|
||||
// float old_night_shift = app->current_night_shift;
|
||||
|
||||
// take system time and convert to minutes
|
||||
@@ -70,6 +71,7 @@ void night_shift_timer_callback(void* context) {
|
||||
app->rgb_srv->current_night_shift = app->settings.night_shift;
|
||||
}
|
||||
|
||||
// IN DEVELOPMENT
|
||||
// // if night shift was changed then update stock and rgb backlight to new value
|
||||
// if(old_night_shift != app->current_night_shift) {
|
||||
// notification_message(app, &sequence_display_backlight_on);
|
||||
@@ -177,7 +179,7 @@ static void notification_reset_notification_layer(
|
||||
// --- NIGHT SHIFT ---
|
||||
furi_hal_light_set(
|
||||
LightBacklight,
|
||||
app->settings.display_brightness * 0xFF * app->current_night_shift);
|
||||
app->settings.display_brightness * 0xFF * app->current_night_shift * 1.0f);
|
||||
// --- NIGHT SHIFT END---
|
||||
}
|
||||
furi_timer_start(app->display_timer, notification_settings_display_off_delay_ticks(app));
|
||||
@@ -268,7 +270,7 @@ static void notification_process_notification_message(
|
||||
notification_apply_notification_led_layer(
|
||||
&app->display,
|
||||
notification_message->data.led.value * display_brightness_setting *
|
||||
app->current_night_shift);
|
||||
app->current_night_shift * 1.0f);
|
||||
reset_mask |= reset_display_mask;
|
||||
|
||||
//start rgb_mod_rainbow_timer when display backlight is ON and all corresponding settings is ON too
|
||||
@@ -294,7 +296,7 @@ static void notification_process_notification_message(
|
||||
notification_apply_internal_led_layer(
|
||||
&app->display,
|
||||
notification_message->data.led.value * display_brightness_setting *
|
||||
app->current_night_shift);
|
||||
app->current_night_shift * 1.0f);
|
||||
}
|
||||
break;
|
||||
case NotificationMessageTypeLedDisplayBacklightEnforceAuto:
|
||||
@@ -304,7 +306,7 @@ static void notification_process_notification_message(
|
||||
notification_apply_internal_led_layer(
|
||||
&app->display,
|
||||
notification_message->data.led.value * display_brightness_setting *
|
||||
app->current_night_shift);
|
||||
app->current_night_shift * 1.0f);
|
||||
}
|
||||
// --- NIGHT SHIFT END ---
|
||||
} else {
|
||||
|
||||
@@ -137,9 +137,9 @@ void rgb_backlight_update(float brightness) {
|
||||
|
||||
if(app->settings->rgb_backlight_installed) {
|
||||
for(uint8_t i = 0; i < SK6805_get_led_count(); i++) {
|
||||
uint8_t r = current_led[i].red * brightness;
|
||||
uint8_t g = current_led[i].green * brightness;
|
||||
uint8_t b = current_led[i].blue * brightness;
|
||||
uint8_t r = current_led[i].red * brightness * 1.0f;
|
||||
uint8_t g = current_led[i].green * brightness * 1.0f;
|
||||
uint8_t b = current_led[i].blue * brightness * 1.0f;
|
||||
SK6805_set_led_color(i, r, g, b);
|
||||
}
|
||||
SK6805_update();
|
||||
|
||||
@@ -30,7 +30,7 @@ typedef struct {
|
||||
uint16_t rainbow_step;
|
||||
uint8_t rainbow_saturation;
|
||||
uint8_t rainbow_wide;
|
||||
|
||||
|
||||
} RGBBacklightSettingsPrevious;
|
||||
|
||||
void rgb_backlight_settings_load(RGBBacklightSettings* settings) {
|
||||
|
||||
Reference in New Issue
Block a user