mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-27 06:50:21 +00:00
20c4121f25
* Use static mutex * Add static_assert checks * Use static semaphore * Fix formatting * Use static stream buffer * Use static timer * Use static event group * Increase allocation size for stream buffer * Remove recursive bit from the mutex before freeing * Prevent service tasks from ever returning * Use static threads * Do not realloc memory when changing stack size * Use FuriSemaphore instead of raw FreeRTOS one in rpc_test * Remove redundant includes * Abolish FreeRTOS dynamic allocation * Improve FuriMutex * Improve FuriMessageQueue * Remove redundant comments and parentheses * Clean up code more * Create service threads via a dedicated constructor * Minor code improvements * Update docs for FuriThread, FuriTimer * Fix doxygen typo * Use a bigger buffer for static StreamBuffer * Furi: remove timer control block only when timer thread have completed all operations --------- Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
43 lines
1.3 KiB
C
43 lines
1.3 KiB
C
#include <furi.h>
|
|
#include <gui/scene_manager.h>
|
|
|
|
#include "../desktop_i.h"
|
|
#include "../views/desktop_view_pin_timeout.h"
|
|
#include "desktop_scene.h"
|
|
|
|
static void desktop_scene_pin_timeout_callback(void* context) {
|
|
Desktop* desktop = (Desktop*)context;
|
|
view_dispatcher_send_custom_event(desktop->view_dispatcher, DesktopPinTimeoutExit);
|
|
}
|
|
|
|
void desktop_scene_pin_timeout_on_enter(void* context) {
|
|
Desktop* desktop = (Desktop*)context;
|
|
|
|
uint32_t timeout =
|
|
scene_manager_get_scene_state(desktop->scene_manager, DesktopScenePinTimeout);
|
|
desktop_view_pin_timeout_start(desktop->pin_timeout_view, timeout);
|
|
desktop_view_pin_timeout_set_callback(
|
|
desktop->pin_timeout_view, desktop_scene_pin_timeout_callback, desktop);
|
|
|
|
view_dispatcher_switch_to_view(desktop->view_dispatcher, DesktopViewIdPinTimeout);
|
|
}
|
|
|
|
bool desktop_scene_pin_timeout_on_event(void* context, SceneManagerEvent event) {
|
|
Desktop* desktop = (Desktop*)context;
|
|
bool consumed = false;
|
|
|
|
if(event.type == SceneManagerEventTypeCustom) {
|
|
switch(event.event) {
|
|
case DesktopPinTimeoutExit:
|
|
scene_manager_previous_scene(desktop->scene_manager);
|
|
consumed = true;
|
|
break;
|
|
}
|
|
}
|
|
|
|
return consumed;
|
|
}
|
|
|
|
void desktop_scene_pin_timeout_on_exit(void* context) {
|
|
UNUSED(context);
|
|
}
|