mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-29 16:00:22 +00:00
Merge remote-tracking branch 'OFW/dev' into dev
This commit is contained in:
commit
55d6711a80
1 changed files with 24 additions and 18 deletions
|
@ -32,11 +32,6 @@ typedef enum {
|
||||||
} AnimationManagerState;
|
} AnimationManagerState;
|
||||||
|
|
||||||
struct AnimationManager {
|
struct AnimationManager {
|
||||||
bool sd_show_url;
|
|
||||||
bool sd_shown_no_db;
|
|
||||||
bool sd_shown_sd_ok;
|
|
||||||
bool levelup_pending;
|
|
||||||
bool levelup_active;
|
|
||||||
AnimationManagerState state;
|
AnimationManagerState state;
|
||||||
FuriPubSubSubscription* pubsub_subscription_storage;
|
FuriPubSubSubscription* pubsub_subscription_storage;
|
||||||
FuriPubSubSubscription* pubsub_subscription_dolphin;
|
FuriPubSubSubscription* pubsub_subscription_dolphin;
|
||||||
|
@ -51,7 +46,14 @@ struct AnimationManager {
|
||||||
FuriString* freezed_animation_name;
|
FuriString* freezed_animation_name;
|
||||||
int32_t freezed_animation_time_left;
|
int32_t freezed_animation_time_left;
|
||||||
ViewStack* view_stack;
|
ViewStack* view_stack;
|
||||||
bool dummy_mode;
|
|
||||||
|
bool dummy_mode : 1;
|
||||||
|
bool blocking_shown_url : 1;
|
||||||
|
bool blocking_shown_sd_bad : 1;
|
||||||
|
bool blocking_shown_no_db : 1;
|
||||||
|
bool blocking_shown_sd_ok : 1;
|
||||||
|
bool levelup_pending : 1;
|
||||||
|
bool levelup_active : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
static StorageAnimation*
|
static StorageAnimation*
|
||||||
|
@ -214,27 +216,31 @@ static bool animation_manager_check_blocking(AnimationManager* animation_manager
|
||||||
FS_Error sd_status = storage_sd_status(storage);
|
FS_Error sd_status = storage_sd_status(storage);
|
||||||
|
|
||||||
if(sd_status == FSE_INTERNAL) {
|
if(sd_status == FSE_INTERNAL) {
|
||||||
blocking_animation = animation_storage_find_animation(BAD_SD_ANIMATION_NAME);
|
if(!animation_manager->blocking_shown_sd_bad) {
|
||||||
furi_assert(blocking_animation);
|
blocking_animation = animation_storage_find_animation(BAD_SD_ANIMATION_NAME);
|
||||||
|
furi_assert(blocking_animation);
|
||||||
|
animation_manager->blocking_shown_sd_bad = true;
|
||||||
|
}
|
||||||
} else if(sd_status == FSE_NOT_READY) {
|
} else if(sd_status == FSE_NOT_READY) {
|
||||||
animation_manager->sd_shown_sd_ok = false;
|
animation_manager->blocking_shown_sd_bad = false;
|
||||||
animation_manager->sd_shown_no_db = false;
|
animation_manager->blocking_shown_sd_ok = false;
|
||||||
|
animation_manager->blocking_shown_no_db = false;
|
||||||
} else if(sd_status == FSE_OK) {
|
} else if(sd_status == FSE_OK) {
|
||||||
if(!animation_manager->sd_shown_sd_ok) {
|
if(!animation_manager->blocking_shown_sd_ok) {
|
||||||
blocking_animation = animation_storage_find_animation(SD_OK_ANIMATION_NAME);
|
blocking_animation = animation_storage_find_animation(SD_OK_ANIMATION_NAME);
|
||||||
furi_assert(blocking_animation);
|
furi_assert(blocking_animation);
|
||||||
animation_manager->sd_shown_sd_ok = true;
|
animation_manager->blocking_shown_sd_ok = true;
|
||||||
} else if(!animation_manager->sd_shown_no_db) {
|
} else if(!animation_manager->blocking_shown_no_db) {
|
||||||
if(!storage_file_exists(storage, EXT_PATH("Manifest"))) {
|
if(!storage_file_exists(storage, EXT_PATH("Manifest"))) {
|
||||||
blocking_animation = animation_storage_find_animation(NO_DB_ANIMATION_NAME);
|
blocking_animation = animation_storage_find_animation(NO_DB_ANIMATION_NAME);
|
||||||
furi_assert(blocking_animation);
|
furi_assert(blocking_animation);
|
||||||
animation_manager->sd_shown_no_db = true;
|
animation_manager->blocking_shown_no_db = true;
|
||||||
animation_manager->sd_show_url = true;
|
animation_manager->blocking_shown_url = true;
|
||||||
}
|
}
|
||||||
} else if(animation_manager->sd_show_url) {
|
} else if(animation_manager->blocking_shown_url) {
|
||||||
blocking_animation = animation_storage_find_animation(URL_ANIMATION_NAME);
|
blocking_animation = animation_storage_find_animation(URL_ANIMATION_NAME);
|
||||||
furi_assert(blocking_animation);
|
furi_assert(blocking_animation);
|
||||||
animation_manager->sd_show_url = false;
|
animation_manager->blocking_shown_url = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -299,7 +305,7 @@ AnimationManager* animation_manager_alloc(void) {
|
||||||
dolphin_get_pubsub(dolphin), animation_manager_check_blocking_callback, animation_manager);
|
dolphin_get_pubsub(dolphin), animation_manager_check_blocking_callback, animation_manager);
|
||||||
furi_record_close(RECORD_DOLPHIN);
|
furi_record_close(RECORD_DOLPHIN);
|
||||||
|
|
||||||
animation_manager->sd_shown_sd_ok = true;
|
animation_manager->blocking_shown_sd_ok = true;
|
||||||
if(!animation_manager_check_blocking(animation_manager)) {
|
if(!animation_manager_check_blocking(animation_manager)) {
|
||||||
animation_manager_start_new_idle(animation_manager);
|
animation_manager_start_new_idle(animation_manager);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue