Skip to content

Commit

Permalink
We can haz debugger support!!!!! Begone -Og
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Feb 10, 2024
1 parent 27ce00b commit 026eef7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
9 changes: 9 additions & 0 deletions applications/system/updater/util/update_task_worker_backup.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,15 @@ static bool update_task_post_update(UpdateTask* update_task) {

CHECK_RESULT(lfs_backup_unpack(update_task->storage, furi_string_get_cstr(file_path)));

#ifdef FURI_DEBUG
furi_hal_rtc_set_flag(FuriHalRtcFlagDebug);
#else
furi_hal_rtc_set_log_level(FuriLogLevelNone);
furi_hal_rtc_reset_flag(FuriHalRtcFlagDebug);
furi_hal_rtc_reset_flag(FuriHalRtcFlagLegacySleep);
furi_hal_rtc_set_heap_track_mode(FuriHalRtcHeapTrackModeNone);
#endif

if(update_task->state.groups & UpdateTaskStageGroupResources) {
TarUnpackProgress progress = {
.update_task = update_task,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,7 @@ int32_t update_task_worker_flash_writer(void* context) {
furi_hal_rtc_set_boot_mode(FuriHalRtcBootModePostUpdate);
// Format LFS before restoring backup on next boot
furi_hal_rtc_set_flag(FuriHalRtcFlagStorageFormatInternal);
#ifdef FURI_NDEBUG
// Production
furi_hal_rtc_set_log_level(FuriLogLevelNone);
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;
} while(false);
Expand Down
2 changes: 1 addition & 1 deletion site_scons/firmwareopts.scons
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if ENV["DEBUG"] and ENV["IS_BASE_FIRMWARE"]:
"NDEBUG",
],
CCFLAGS=[
"-Og",
"-Os" if ENV["COMPACT"] else "-Og",
],
)
elif ENV["COMPACT"]:
Expand Down

0 comments on commit 026eef7

Please sign in to comment.