mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-23 13:03:13 +00:00
Merge remote-tracking branch 'OFW/dev' into dev
This commit is contained in:
commit
7c6541e513
3 changed files with 20 additions and 7 deletions
|
@ -20,12 +20,17 @@ void nfc_scene_mf_ultralight_unlock_menu_on_enter(void* context) {
|
||||||
uint32_t state =
|
uint32_t state =
|
||||||
scene_manager_get_scene_state(nfc->scene_manager, NfcSceneMfUltralightUnlockMenu);
|
scene_manager_get_scene_state(nfc->scene_manager, NfcSceneMfUltralightUnlockMenu);
|
||||||
if(nfc_device_get_protocol(nfc->nfc_device) == NfcProtocolMfUltralight) {
|
if(nfc_device_get_protocol(nfc->nfc_device) == NfcProtocolMfUltralight) {
|
||||||
submenu_add_item(
|
const MfUltralightData* mfu_data =
|
||||||
submenu,
|
nfc_device_get_data(nfc->nfc_device, NfcProtocolMfUltralight);
|
||||||
"Unlock With Reader",
|
// Hide for MFU-C since it uses 3DES
|
||||||
SubmenuIndexMfUlUnlockMenuReader,
|
if(mfu_data->type != MfUltralightTypeMfulC) {
|
||||||
nfc_scene_mf_ultralight_unlock_menu_submenu_callback,
|
submenu_add_item(
|
||||||
nfc);
|
submenu,
|
||||||
|
"Unlock With Reader",
|
||||||
|
SubmenuIndexMfUlUnlockMenuReader,
|
||||||
|
nfc_scene_mf_ultralight_unlock_menu_submenu_callback,
|
||||||
|
nfc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
submenu_add_item(
|
submenu_add_item(
|
||||||
submenu,
|
submenu,
|
||||||
|
|
|
@ -34,10 +34,12 @@ static void desktop_loader_callback(const void* message, void* context) {
|
||||||
|
|
||||||
if(event->type == LoaderEventTypeApplicationStarted) {
|
if(event->type == LoaderEventTypeApplicationStarted) {
|
||||||
view_dispatcher_send_custom_event(desktop->view_dispatcher, DesktopGlobalBeforeAppStarted);
|
view_dispatcher_send_custom_event(desktop->view_dispatcher, DesktopGlobalBeforeAppStarted);
|
||||||
|
furi_check(furi_semaphore_acquire(desktop->animation_semaphore, 3000) == FuriStatusOk);
|
||||||
} else if(event->type == LoaderEventTypeApplicationStopped) {
|
} else if(event->type == LoaderEventTypeApplicationStopped) {
|
||||||
view_dispatcher_send_custom_event(desktop->view_dispatcher, DesktopGlobalAfterAppFinished);
|
view_dispatcher_send_custom_event(desktop->view_dispatcher, DesktopGlobalAfterAppFinished);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void desktop_lock_icon_draw_callback(Canvas* canvas, void* context) {
|
static void desktop_lock_icon_draw_callback(Canvas* canvas, void* context) {
|
||||||
UNUSED(context);
|
UNUSED(context);
|
||||||
furi_assert(canvas);
|
furi_assert(canvas);
|
||||||
|
@ -120,8 +122,11 @@ static bool desktop_custom_event_callback(void* context, uint32_t event) {
|
||||||
|
|
||||||
switch(event) {
|
switch(event) {
|
||||||
case DesktopGlobalBeforeAppStarted:
|
case DesktopGlobalBeforeAppStarted:
|
||||||
animation_manager_unload_and_stall_animation(desktop->animation_manager);
|
if(animation_manager_is_animation_loaded(desktop->animation_manager)) {
|
||||||
|
animation_manager_unload_and_stall_animation(desktop->animation_manager);
|
||||||
|
}
|
||||||
desktop_auto_lock_inhibit(desktop);
|
desktop_auto_lock_inhibit(desktop);
|
||||||
|
furi_semaphore_release(desktop->animation_semaphore);
|
||||||
return true;
|
return true;
|
||||||
case DesktopGlobalAfterAppFinished:
|
case DesktopGlobalAfterAppFinished:
|
||||||
animation_manager_load_and_continue_animation(desktop->animation_manager);
|
animation_manager_load_and_continue_animation(desktop->animation_manager);
|
||||||
|
@ -271,6 +276,7 @@ void desktop_set_stealth_mode_state(Desktop* desktop, bool enabled) {
|
||||||
Desktop* desktop_alloc(void) {
|
Desktop* desktop_alloc(void) {
|
||||||
Desktop* desktop = malloc(sizeof(Desktop));
|
Desktop* desktop = malloc(sizeof(Desktop));
|
||||||
|
|
||||||
|
desktop->animation_semaphore = furi_semaphore_alloc(1, 0);
|
||||||
desktop->animation_manager = animation_manager_alloc();
|
desktop->animation_manager = animation_manager_alloc();
|
||||||
desktop->gui = furi_record_open(RECORD_GUI);
|
desktop->gui = furi_record_open(RECORD_GUI);
|
||||||
desktop->scene_thread = furi_thread_alloc();
|
desktop->scene_thread = furi_thread_alloc();
|
||||||
|
|
|
@ -80,6 +80,8 @@ struct Desktop {
|
||||||
bool time_format_12 : 1; // 1 - 12 hour, 0 - 24H
|
bool time_format_12 : 1; // 1 - 12 hour, 0 - 24H
|
||||||
|
|
||||||
bool in_transition : 1;
|
bool in_transition : 1;
|
||||||
|
|
||||||
|
FuriSemaphore* animation_semaphore;
|
||||||
};
|
};
|
||||||
|
|
||||||
Desktop* desktop_alloc(void);
|
Desktop* desktop_alloc(void);
|
||||||
|
|
Loading…
Reference in a new issue