[FL-2152] New PIN lock (#989)

* [Fl-2152] New PIN Lock, part 1
* Fix errors & leaks, renaming
* Add support to f6
* Fix error, remove duplicate code
* Fix drawing corners of Lock Popup
* FuriHal: insomnia if usb connected
* Applications: cleanup timers use

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
Albert Kharisov
2022-02-10 22:17:41 +04:00
committed by GitHub
parent 2a52d2d620
commit 21ac37a6f6
81 changed files with 2461 additions and 1176 deletions

View File

@@ -0,0 +1,46 @@
#include <furi.h>
#include <FreeRTOS.h>
#include <portmacro.h>
#include <timer.h>
#include <gui/scene_manager.h>
#include "../desktop_i.h"
#include "../views/desktop_view_pin_timeout.h"
#include "desktop_scene.h"
#include "desktop_scene_i.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) {
}