1
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:
Dmitry422
2025-03-28 13:48:32 +07:00
parent cd28f7d232
commit 31b7c4a34f
3 changed files with 11 additions and 9 deletions

View File

@@ -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 {

View File

@@ -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();