This commit is contained in:
Willy-JL
2023-04-13 04:21:24 +01:00
19 changed files with 45 additions and 19 deletions
+1 -1
View File
@@ -123,7 +123,7 @@ Note: This repo is always updated with OFW & Unleashed. No need to mention all t
- Custom subghz presets
- Multiple NFC protocols
- Multiple Sub-Ghz protocols | Merged from Unleashed, thanks @xMasterX
- Subghz and IR signal replication via gpio | Credits to @ankris812
- Subghz and IR signal replication via gpio | Credits to @xMasterX
- New API Routes for Locale settings
```
+1 -1
View File
@@ -469,7 +469,7 @@ int32_t bt_srv(void* p) {
UNUSED(p);
Bt* bt = bt_alloc();
if(furi_hal_rtc_get_boot_mode() != FuriHalRtcBootModeNormal) {
if(!furi_hal_is_normal_boot()) {
FURI_LOG_W(TAG, "Skipping start in special boot mode");
ble_glue_wait_for_c2_start(FURI_HAL_BT_C2_START_TIMEOUT);
furi_record_create(RECORD_BT, bt);
+1 -1
View File
@@ -460,7 +460,7 @@ int32_t cli_srv(void* p) {
furi_thread_set_stdout_callback(NULL);
}
if(furi_hal_rtc_get_boot_mode() == FuriHalRtcBootModeNormal) {
if(furi_hal_is_normal_boot()) {
cli_session_open(cli, &cli_vcp);
} else {
FURI_LOG_W(TAG, "Skipping start in special boot mode");
+9 -1
View File
@@ -304,11 +304,19 @@ static bool desktop_check_file_flag(const char* flag_path) {
int32_t desktop_srv(void* p) {
UNUSED(p);
if(furi_hal_rtc_get_boot_mode() != FuriHalRtcBootModeNormal) {
if(!furi_hal_is_normal_boot()) {
FURI_LOG_W(TAG, "Skipping start in special boot mode");
return 0;
}
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagResetPin)) {
Storage* storage = furi_record_open(RECORD_STORAGE);
storage_common_remove(storage, DESKTOP_SETTINGS_PATH);
storage_common_remove(storage, DESKTOP_SETTINGS_OLD_PATH);
furi_record_close(RECORD_STORAGE);
furi_hal_rtc_reset_flag(FuriHalRtcFlagResetPin);
}
Desktop* desktop = desktop_alloc();
bool loaded = DESKTOP_SETTINGS_LOAD(&desktop->settings);
+1 -1
View File
@@ -161,7 +161,7 @@ static void dolphin_update_clear_limits_timer_period(Dolphin* dolphin) {
int32_t dolphin_srv(void* p) {
UNUSED(p);
if(furi_hal_rtc_get_boot_mode() != FuriHalRtcBootModeNormal) {
if(!furi_hal_is_normal_boot()) {
FURI_LOG_W(TAG, "Skipping start in special boot mode");
return 0;
}
@@ -4,7 +4,7 @@
#include <flipper_format/flipper_format.h>
void namechanger_on_system_start() {
if(furi_hal_rtc_get_boot_mode() != FuriHalRtcBootModeNormal) {
if(!furi_hal_is_normal_boot()) {
FURI_LOG_W(TAG, "NameChangerSRV load skipped. Device is in special startup mode.");
} else {
Storage* storage = furi_record_open(RECORD_STORAGE);
@@ -515,7 +515,7 @@ static void power_check_battery_level_change(Power* power) {
int32_t power_srv(void* p) {
UNUSED(p);
if(furi_hal_rtc_get_boot_mode() != FuriHalRtcBootModeNormal) {
if(!furi_hal_is_normal_boot()) {
FURI_LOG_W(TAG, "Skipping start in special boot mode");
return 0;
}
@@ -63,8 +63,7 @@ const char* rgb_backlight_get_color_text(uint8_t index) {
void rgb_backlight_load_settings(void) {
//Не загружать данные из внутренней памяти при загрузке в режиме DFU
FuriHalRtcBootMode bm = furi_hal_rtc_get_boot_mode();
if(bm == FuriHalRtcBootModeDfu) {
if(!furi_hal_is_normal_boot()) {
rgb_settings.settings_is_loaded = true;
return;
}
+1 -1
View File
@@ -143,7 +143,7 @@ void XTREME_ASSETS_LOAD() {
xtreme_assets->I_Connected_62x31 = &I_Connected_62x31;
xtreme_assets->I_Error_62x31 = &I_Error_62x31;
if(furi_hal_rtc_get_boot_mode() != FuriHalRtcBootModeNormal) {
if(!furi_hal_is_normal_boot()) {
FURI_LOG_W(TAG, "Load skipped. Device is in special startup mode.");
return;
}
+2 -3
View File
@@ -15,9 +15,8 @@ void XTREME_SETTINGS_LOAD() {
if(xtreme_settings == NULL) {
xtreme_settings = malloc(sizeof(XtremeSettings));
bool loaded = false;
bool skip = furi_hal_rtc_get_boot_mode() != FuriHalRtcBootModeNormal;
if(skip) {
if(!furi_hal_is_normal_boot()) {
FURI_LOG_W(TAG, "Load skipped. Device is in special startup mode.");
loaded = false;
} else {
@@ -74,7 +73,7 @@ bool XTREME_SETTINGS_SAVE() {
XTREME_SETTINGS_LOAD();
}
if(furi_hal_rtc_get_boot_mode() != FuriHalRtcBootModeNormal) {
if(!furi_hal_is_normal_boot()) {
return true;
}
@@ -16,9 +16,9 @@ BtSettingsApp* bt_settings_app_alloc() {
BtSettingsApp* app = malloc(sizeof(BtSettingsApp));
// Load settings
bt_settings_load(&app->settings);
app->gui = furi_record_open(RECORD_GUI);
app->bt = furi_record_open(RECORD_BT);
bt_settings_load(&app->bt->bt_settings);
// View Dispatcher and Scene Manager
app->view_dispatcher = view_dispatcher_alloc();
@@ -79,7 +79,7 @@ extern int32_t bt_settings_app(void* p) {
UNUSED(p);
BtSettingsApp* app = bt_settings_app_alloc();
view_dispatcher_run(app->view_dispatcher);
bt_settings_save(&app->settings);
bt_settings_save(&app->bt->bt_settings);
bt_settings_app_free(app);
return 0;
}
@@ -2,6 +2,7 @@
#include <furi.h>
#include <bt/bt_service/bt.h>
#include <bt/bt_service/bt_i.h>
#include <gui/gui.h>
#include <gui/view.h>
#include <gui/view_dispatcher.h>
@@ -24,7 +25,6 @@ enum BtSettingsCustomEvent {
};
typedef struct {
BtSettings settings;
Bt* bt;
Gui* gui;
SceneManager* scene_manager;
@@ -46,7 +46,7 @@ void bt_settings_scene_start_on_enter(void* context) {
BtSettingNum,
bt_settings_scene_start_var_list_change_callback,
app);
if(app->settings.enabled) {
if(app->bt->bt_settings.enabled) {
variable_item_set_current_value_index(item, BtSettingOn);
variable_item_set_current_value_text(item, bt_settings_text[BtSettingOn]);
} else {
@@ -71,10 +71,10 @@ bool bt_settings_scene_start_on_event(void* context, SceneManagerEvent event) {
if(event.type == SceneManagerEventTypeCustom) {
if(event.event == BtSettingOn) {
furi_hal_bt_start_advertising();
app->settings.enabled = true;
app->bt->bt_settings.enabled = true;
consumed = true;
} else if(event.event == BtSettingOff) {
app->settings.enabled = false;
app->bt->bt_settings.enabled = false;
furi_hal_bt_stop_advertising();
consumed = true;
} else if(event.event == BtSettingsCustomEventForgetDevices) {
+7
View File
@@ -6,6 +6,12 @@
#define TAG "FuriHal"
bool normal_boot = false;
bool furi_hal_is_normal_boot() {
return normal_boot;
}
void furi_hal_init_early() {
furi_hal_cortex_init_early();
furi_hal_clock_init_early();
@@ -26,6 +32,7 @@ void furi_hal_deinit_early() {
}
void furi_hal_init() {
normal_boot = true;
furi_hal_mpu_init();
furi_hal_clock_init();
furi_hal_console_init();
+1
View File
@@ -1261,6 +1261,7 @@ Function,-,furi_hal_init_early,void,
Function,-,furi_hal_interrupt_init,void,
Function,+,furi_hal_interrupt_set_isr,void,"FuriHalInterruptId, FuriHalInterruptISR, void*"
Function,+,furi_hal_interrupt_set_isr_ex,void,"FuriHalInterruptId, uint16_t, FuriHalInterruptISR, void*"
Function,-,furi_hal_is_normal_boot,_Bool,
Function,+,furi_hal_light_blink_set_color,void,Light
Function,+,furi_hal_light_blink_start,void,"Light, uint8_t, uint16_t, uint16_t"
Function,+,furi_hal_light_blink_stop,void,
1 entry status name type params
1261 Function - furi_hal_interrupt_init void
1262 Function + furi_hal_interrupt_set_isr void FuriHalInterruptId, FuriHalInterruptISR, void*
1263 Function + furi_hal_interrupt_set_isr_ex void FuriHalInterruptId, uint16_t, FuriHalInterruptISR, void*
1264 Function - furi_hal_is_normal_boot _Bool
1265 Function + furi_hal_light_blink_set_color void Light
1266 Function + furi_hal_light_blink_start void Light, uint8_t, uint16_t, uint16_t
1267 Function + furi_hal_light_blink_stop void
+7
View File
@@ -6,6 +6,12 @@
#define TAG "FuriHal"
bool normal_boot = false;
bool furi_hal_is_normal_boot() {
return normal_boot;
}
void furi_hal_init_early() {
furi_hal_cortex_init_early();
furi_hal_clock_init_early();
@@ -26,6 +32,7 @@ void furi_hal_deinit_early() {
}
void furi_hal_init() {
normal_boot = true;
furi_hal_mpu_init();
furi_hal_clock_init();
furi_hal_console_init();
+1
View File
@@ -56,6 +56,7 @@ void flipper_boot_recovery_exec() {
}
if(!counter) {
furi_hal_rtc_set_flag(FuriHalRtcFlagResetPin);
furi_hal_rtc_set_flag(FuriHalRtcFlagFactoryReset);
furi_hal_rtc_set_pin_fails(0);
furi_hal_rtc_reset_flag(FuriHalRtcFlagLock);
@@ -42,6 +42,9 @@ struct STOP_EXTERNING_ME {};
extern "C" {
#endif
/** True if normally with all subsystems */
bool furi_hal_is_normal_boot();
/** Early FuriHal init, only essential subsystems */
void furi_hal_init_early();
@@ -30,6 +30,7 @@ typedef enum {
FuriHalRtcFlagLock = (1 << 2),
FuriHalRtcFlagC2Update = (1 << 3),
FuriHalRtcFlagHandOrient = (1 << 4),
FuriHalRtcFlagResetPin = (1 << 5),
} FuriHalRtcFlag;
typedef enum {