mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-12 16:38:36 -07:00
disable expansion and reset some flags for release builds
there is no expansion modules yet, so we can disable uart listen for them being enabled 24/7 p.s. some parts of code was taken from Willy-JL's solution todo: revert force reset part if there are real use cases for expansion protocol appears
This commit is contained in:
@@ -395,9 +395,8 @@ void expansion_on_system_start(void* arg) {
|
||||
furi_record_create(RECORD_EXPANSION, instance);
|
||||
|
||||
ExpansionSettings settings = {};
|
||||
if(!expansion_settings_load(&settings)) {
|
||||
expansion_settings_save(&settings);
|
||||
} else if(settings.uart_index < FuriHalSerialIdMax) {
|
||||
expansion_settings_load(&settings);
|
||||
if(settings.uart_index < FuriHalSerialIdMax) {
|
||||
expansion_enable(instance, settings.uart_index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <storage/storage.h>
|
||||
#include <toolbox/saved_struct.h>
|
||||
#include <furi_hal_serial.h>
|
||||
|
||||
#include "expansion_settings_filename.h"
|
||||
|
||||
@@ -11,12 +12,15 @@
|
||||
|
||||
bool expansion_settings_load(ExpansionSettings* settings) {
|
||||
furi_assert(settings);
|
||||
return saved_struct_load(
|
||||
EXPANSION_SETTINGS_PATH,
|
||||
settings,
|
||||
sizeof(ExpansionSettings),
|
||||
EXPANSION_SETTINGS_MAGIC,
|
||||
EXPANSION_SETTINGS_VERSION);
|
||||
if(!saved_struct_load(
|
||||
EXPANSION_SETTINGS_PATH,
|
||||
settings,
|
||||
sizeof(ExpansionSettings),
|
||||
EXPANSION_SETTINGS_MAGIC,
|
||||
EXPANSION_SETTINGS_VERSION)) {
|
||||
settings->uart_index = FuriHalSerialIdMax;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool expansion_settings_save(ExpansionSettings* settings) {
|
||||
|
||||
Reference in New Issue
Block a user