mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-11-23 19:00:43 +03: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:
parent
1ceacc6555
commit
cbc0231461
@ -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) {
|
||||
|
@ -27,9 +27,7 @@ static uint32_t expansion_settings_app_exit(void* context) {
|
||||
static ExpansionSettingsApp* expansion_settings_app_alloc() {
|
||||
ExpansionSettingsApp* app = malloc(sizeof(ExpansionSettingsApp));
|
||||
|
||||
if(!expansion_settings_load(&app->settings)) {
|
||||
expansion_settings_save(&app->settings);
|
||||
}
|
||||
expansion_settings_load(&app->settings);
|
||||
|
||||
app->gui = furi_record_open(RECORD_GUI);
|
||||
app->expansion = furi_record_open(RECORD_EXPANSION);
|
||||
|
@ -28,6 +28,10 @@ static void storage_move_to_sd_remove_region() {
|
||||
if(storage_common_exists(storage, INT_PATH(".region_data"))) {
|
||||
storage_common_remove(storage, INT_PATH(".region_data"));
|
||||
}
|
||||
// No expansion modules yet
|
||||
if(storage_common_exists(storage, INT_PATH(".expansion.settings"))) {
|
||||
storage_common_remove(storage, INT_PATH(".expansion.settings"));
|
||||
}
|
||||
|
||||
furi_record_close(RECORD_STORAGE);
|
||||
}
|
||||
|
@ -348,6 +348,8 @@ int32_t update_task_worker_flash_writer(void* context) {
|
||||
// Production
|
||||
furi_hal_rtc_set_log_level(FuriLogLevelDefault);
|
||||
furi_hal_rtc_reset_flag(FuriHalRtcFlagDebug);
|
||||
furi_hal_rtc_reset_flag(FuriHalRtcFlagLegacySleep);
|
||||
furi_hal_rtc_set_heap_track_mode(FuriHalRtcHeapTrackModeNone);
|
||||
#endif
|
||||
update_task_set_progress(update_task, UpdateTaskStageCompleted, 100);
|
||||
success = true;
|
||||
|
Loading…
Reference in New Issue
Block a user