1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-13 05:06:30 +04:00

remove overkill service

This commit is contained in:
MX
2025-03-16 05:24:20 +03:00
parent edd75a9b01
commit b48e00928a
4 changed files with 12 additions and 71 deletions

View File

@@ -12,6 +12,5 @@ App(
"power",
"namechanger_srv",
"rgb_backlight",
"rgb_backlight_startup",
],
)

View File

@@ -8,13 +8,3 @@ App(
order=95,
sdk_headers=["rgb_backlight.h"],
)
App(
appid="rgb_backlight_startup",
name="RgbBackLightBootSrv",
apptype=FlipperAppType.STARTUP,
targets=["f7"],
entry_point="rgb_backlight_on_system_start",
cdefines=["SRV_RGB_BACKLIGHT"],
order=270,
)

View File

@@ -208,10 +208,18 @@ int32_t rgb_backlight_srv(void* p) {
rgb_backlight_update(app->settings->brightness);
}
// if rgb mod not installed - set default static orange color (index=0)
} //else {
// rgb_backlight_set_static_color(0);
// rgb_backlight_update(app->settings->brightness);
//}
} else {
//rgb_backlight_set_static_color(0);
//rgb_backlight_update(app->settings->brightness);
rgb_backlight_set_static_color(0);
for(uint8_t i = 0; i < SK6805_get_led_count(); i++) {
uint8_t r = app->current_red * (1.0f / 1.0f);
uint8_t g = app->current_green * (1.0f / 1.0f);
uint8_t b = app->current_blue * (1.0f / 1.0f);
SK6805_set_led_color(i, r, g, b);
}
SK6805_update();
}
while(1) {
// place for message queue and other future options

View File

@@ -1,56 +0,0 @@
#include <furi.h>
#include <storage/storage.h>
#include "applications/services/rgb_backlight/rgb_backlight.h"
static int32_t boot_rgb_backlight_update(void* context) {
UNUSED(context);
RGBBacklightApp* app = furi_record_open(RECORD_RGB_BACKLIGHT);
if(!app->settings->rgb_mod_installed) {
rgb_backlight_set_static_color(0);
for(uint8_t i = 0; i < SK6805_get_led_count(); i++) {
uint8_t r = app->current_red * (1.0f / 1.0f);
uint8_t g = app->current_green * (1.0f / 1.0f);
uint8_t b = app->current_blue * (1.0f / 1.0f);
SK6805_set_led_color(i, r, g, b);
}
SK6805_update();
}
furi_record_close(RECORD_RGB_BACKLIGHT);
return 0;
}
static void
rgb_boot_loader_release_callback(FuriThread* thread, FuriThreadState state, void* context) {
UNUSED(context);
if(state == FuriThreadStateStopped) {
furi_thread_free(thread);
}
}
static void rgb_boot_storage_callback(const void* message, void* context) {
UNUSED(context);
const StorageEvent* event = message;
if(event->type == StorageEventTypeCardMount) {
FuriThread* loader = furi_thread_alloc_ex(NULL, 2048, boot_rgb_backlight_update, NULL);
furi_thread_set_state_callback(loader, rgb_boot_loader_release_callback);
furi_thread_start(loader);
}
}
int32_t rgb_backlight_on_system_start(void* p) {
UNUSED(p);
Storage* storage = furi_record_open(RECORD_STORAGE);
furi_pubsub_subscribe(storage_get_pubsub(storage), rgb_boot_storage_callback, NULL);
if(storage_sd_status(storage) != FSE_OK) {
FURI_LOG_D("RGB_Boot_Init", "SD Card not ready, skipping rgb backlight init");
return 0;
}
boot_rgb_backlight_update(NULL);
return 0;
}