mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-23 05:24:46 -07:00
"kostylling" )))
This commit is contained in:
@@ -295,8 +295,8 @@ void night_shift_demo_timer_callback(void* context) {
|
||||
}
|
||||
|
||||
// internal layer
|
||||
static void notification_apply_internal_led_layer(
|
||||
NotificationLedLayer * layer, uint8_t layer_value) {
|
||||
static void
|
||||
notification_apply_internal_led_layer(NotificationLedLayer* layer, uint8_t layer_value) {
|
||||
furi_assert(layer);
|
||||
furi_assert(layer->index < LayerMAX);
|
||||
|
||||
@@ -331,7 +331,8 @@ void night_shift_demo_timer_callback(void* context) {
|
||||
|
||||
// notification layer
|
||||
static void notification_apply_notification_led_layer(
|
||||
NotificationLedLayer * layer, const uint8_t layer_value) {
|
||||
NotificationLedLayer* layer,
|
||||
const uint8_t layer_value) {
|
||||
furi_assert(layer);
|
||||
furi_assert(layer->index < LayerMAX);
|
||||
|
||||
@@ -362,7 +363,9 @@ void night_shift_demo_timer_callback(void* context) {
|
||||
}
|
||||
|
||||
static void notification_reset_notification_layer(
|
||||
NotificationApp * app, uint8_t reset_mask, float display_brightness_set) {
|
||||
NotificationApp* app,
|
||||
uint8_t reset_mask,
|
||||
float display_brightness_set) {
|
||||
if(reset_mask & reset_blink_mask) {
|
||||
furi_hal_light_blink_stop();
|
||||
}
|
||||
@@ -394,8 +397,7 @@ void night_shift_demo_timer_callback(void* context) {
|
||||
}
|
||||
}
|
||||
|
||||
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++) {
|
||||
notification_apply_notification_led_layer(
|
||||
&app->led[i], notification_settings_get_rgb_led_brightness(app, values[i]));
|
||||
@@ -407,8 +409,7 @@ void night_shift_demo_timer_callback(void* context) {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -452,7 +453,8 @@ void night_shift_demo_timer_callback(void* context) {
|
||||
|
||||
// message processing
|
||||
static void notification_process_notification_message(
|
||||
NotificationApp * app, NotificationAppMessage * message) {
|
||||
NotificationApp* app,
|
||||
NotificationAppMessage* message) {
|
||||
uint32_t notification_message_index = 0;
|
||||
bool force_volume = false;
|
||||
bool force_vibro = false;
|
||||
@@ -673,8 +675,8 @@ void night_shift_demo_timer_callback(void* context) {
|
||||
}
|
||||
}
|
||||
|
||||
static void notification_process_internal_message(
|
||||
NotificationApp * app, NotificationAppMessage * message) {
|
||||
static void
|
||||
notification_process_internal_message(NotificationApp* app, NotificationAppMessage* message) {
|
||||
uint32_t notification_message_index = 0;
|
||||
const NotificationMessage* notification_message;
|
||||
notification_message = (*message->sequence)[notification_message_index];
|
||||
@@ -743,10 +745,7 @@ void night_shift_demo_timer_callback(void* context) {
|
||||
if(fs_result) {
|
||||
if(settings.version != NOTIFICATION_SETTINGS_VERSION) {
|
||||
FURI_LOG_E(
|
||||
TAG,
|
||||
"version(%d != %d) mismatch",
|
||||
settings.version,
|
||||
NOTIFICATION_SETTINGS_VERSION);
|
||||
TAG, "version(%d != %d) mismatch", settings.version, NOTIFICATION_SETTINGS_VERSION);
|
||||
} else {
|
||||
furi_kernel_lock();
|
||||
memcpy(&app->settings, &settings, settings_size);
|
||||
@@ -760,6 +759,9 @@ void night_shift_demo_timer_callback(void* context) {
|
||||
storage_file_free(file);
|
||||
furi_record_close(RECORD_STORAGE);
|
||||
|
||||
// "kostyl" for update old setting to new without change settings version
|
||||
if(app->settings.display_off_delay_ms < 2000) app->settings.display_off_delay_ms = 2000;
|
||||
|
||||
return fs_result;
|
||||
}
|
||||
|
||||
@@ -972,8 +974,7 @@ void night_shift_demo_timer_callback(void* context) {
|
||||
|
||||
NotificationAppMessage message;
|
||||
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) {
|
||||
case NotificationLayerMessage:
|
||||
|
||||
@@ -39,7 +39,7 @@ typedef struct {
|
||||
Light light;
|
||||
} NotificationLedLayer;
|
||||
|
||||
#define NOTIFICATION_SETTINGS_VERSION 0x06
|
||||
#define NOTIFICATION_SETTINGS_VERSION 0x05
|
||||
#define NOTIFICATION_SETTINGS_PATH INT_PATH(NOTIFICATION_SETTINGS_FILE_NAME)
|
||||
|
||||
typedef struct {
|
||||
|
||||
Reference in New Issue
Block a user