RGB Backlight: Load settings on SD insert

This commit is contained in:
Willy-JL
2024-08-21 05:32:23 +02:00
parent af6d0731b3
commit fadc217b01
2 changed files with 10 additions and 5 deletions
+1 -1
View File
@@ -10,7 +10,7 @@
- Settings: Show free flash amount in internal storage info (by @Willy-JL)
- Services:
- OFW: On SD insert load BT, Desktop, Dolphin, Expansion, Notification, Region files (by @gsurkov)
- On SD insert also load Momentum Settings, Asset Packs, FindMy Flipper, NameSpoof, Power, SubGHz options, and migrate files (by @Willy-JL)
- On SD insert also load Momentum Settings, Asset Packs, FindMy Flipper, NameSpoof, RGB Backlight, Power, SubGHz options, and migrate files (by @Willy-JL)
- Furi: Re-enabled `FURI_TRACE` since LFS removal frees DFU, will get better crash messages with source code path (by @Willy-JL)
- OFW: Sub-GHz: Add Dickert MAHS garage door protocol (by @OevreFlataeker)
- OFW: RFID: Add GProxII support (by @BarTenderNZ)
+9 -4
View File
@@ -62,11 +62,16 @@ static struct {
};
void rgb_backlight_load_settings(bool enabled) {
if(rgb_state.settings_loaded) return;
rgb_state.enabled = enabled;
rgb_state.mutex = furi_mutex_alloc(FuriMutexTypeRecursive);
// This function is called from momentum_settings_load()
// No need to setup storage pubsub, just expect multiple calls
// Do not load data from internal memory when booting in DFU mode
rgb_state.settings_loaded = false;
rgb_state.enabled = enabled;
if(!rgb_state.mutex) {
rgb_state.mutex = furi_mutex_alloc(FuriMutexTypeRecursive);
}
// Do not load and apply settings when booting in update/RAM mode
if(!furi_hal_is_normal_boot()) {
rgb_state.settings_loaded = true;
return;