Fix check for normal boot (fix bootloop on flash)

This commit is contained in:
Willy-JL
2023-04-30 18:49:26 +01:00
parent b4d6717706
commit 32ed4d3b31
5 changed files with 15 additions and 3 deletions

View File

@@ -8,6 +8,10 @@
bool normal_boot = false;
void furi_hal_set_is_normal_boot(bool value) {
normal_boot = value;
}
bool furi_hal_is_normal_boot() {
return normal_boot;
}
@@ -32,7 +36,6 @@ void furi_hal_deinit_early() {
}
void furi_hal_init() {
normal_boot = true;
furi_hal_mpu_init();
furi_hal_clock_init();
furi_hal_console_init();

View File

@@ -1415,6 +1415,7 @@ Function,+,furi_hal_rtc_set_pin_fails,void,uint32_t
Function,+,furi_hal_rtc_set_register,void,"FuriHalRtcRegister, uint32_t"
Function,+,furi_hal_rtc_sync_shadow,void,
Function,+,furi_hal_rtc_validate_datetime,_Bool,FuriHalRtcDateTime*
Function,-,furi_hal_set_is_normal_boot,void,_Bool
Function,+,furi_hal_speaker_acquire,_Bool,uint32_t
Function,-,furi_hal_speaker_deinit,void,
Function,-,furi_hal_speaker_init,void,
1 entry status name type params
1415 Function + furi_hal_rtc_set_register void FuriHalRtcRegister, uint32_t
1416 Function + furi_hal_rtc_sync_shadow void
1417 Function + furi_hal_rtc_validate_datetime _Bool FuriHalRtcDateTime*
1418 Function - furi_hal_set_is_normal_boot void _Bool
1419 Function + furi_hal_speaker_acquire _Bool uint32_t
1420 Function - furi_hal_speaker_deinit void
1421 Function - furi_hal_speaker_init void

View File

@@ -8,6 +8,10 @@
bool normal_boot = false;
void furi_hal_set_is_normal_boot(bool value) {
normal_boot = value;
}
bool furi_hal_is_normal_boot() {
return normal_boot;
}
@@ -32,7 +36,6 @@ void furi_hal_deinit_early() {
}
void furi_hal_init() {
normal_boot = true;
furi_hal_mpu_init();
furi_hal_clock_init();
furi_hal_console_init();

View File

@@ -26,6 +26,7 @@ int main() {
// Flipper critical FURI HAL
furi_hal_init_early();
furi_hal_set_is_normal_boot(false);
FuriThread* main_thread = furi_thread_alloc_ex("Init", 4096, init_task, NULL);
#ifdef FURI_RAM_EXEC
@@ -58,6 +59,7 @@ int main() {
furi_hal_power_reset();
} else {
furi_hal_light_sequence("rgb G");
furi_hal_set_is_normal_boot(true);
furi_thread_start(main_thread);
}
#endif

View File

@@ -42,7 +42,10 @@ struct STOP_EXTERNING_ME {};
extern "C" {
#endif
/** True if normally with all subsystems */
/** Set whether booting normally with all subsystems */
void furi_hal_set_is_normal_boot(bool value);
/** True if booting normally with all subsystems */
bool furi_hal_is_normal_boot();
/** Early FuriHal init, only essential subsystems */