e3c7201a20
* Furi: rename and move core * Furi: drop CMSIS_OS header and unused api, partially refactor and cleanup the rest * Furi: CMSIS_OS drop and refactoring. * Furi: refactoring, remove cmsis legacy * Furi: fix incorrect assert on queue deallocation, cleanup timer * Furi: improve delay api, get rid of floats * hal: dropped furi_hal_crc * Furi: move DWT based delay to cortex HAL * Furi: update core documentation Co-authored-by: hedger <hedger@nanode.su>
38 lines
1.1 KiB
C++
38 lines
1.1 KiB
C++
#include "lfrfid_app_scene_rpc.h"
|
|
#include <core/common_defines.h>
|
|
#include <dolphin/dolphin.h>
|
|
|
|
void LfRfidAppSceneRpc::on_enter(LfRfidApp* app, bool /* need_restore */) {
|
|
auto popup = app->view_controller.get<PopupVM>();
|
|
|
|
popup->set_header("RPC Mode", 64, 30, AlignCenter, AlignTop);
|
|
|
|
app->view_controller.switch_to<PopupVM>();
|
|
|
|
notification_message(app->notification, &sequence_display_backlight_on);
|
|
}
|
|
|
|
bool LfRfidAppSceneRpc::on_event(LfRfidApp* app, LfRfidApp::Event* event) {
|
|
UNUSED(app);
|
|
UNUSED(event);
|
|
bool consumed = false;
|
|
|
|
if(event->type == LfRfidApp::EventType::Exit) {
|
|
consumed = true;
|
|
LfRfidApp::Event view_event;
|
|
view_event.type = LfRfidApp::EventType::Back;
|
|
app->view_controller.send_event(&view_event);
|
|
} else if(event->type == LfRfidApp::EventType::EmulateStart) {
|
|
consumed = true;
|
|
emulating = true;
|
|
}
|
|
return consumed;
|
|
}
|
|
|
|
void LfRfidAppSceneRpc::on_exit(LfRfidApp* app) {
|
|
if(emulating) {
|
|
app->worker.stop_emulate();
|
|
}
|
|
app->view_controller.get<PopupVM>()->clean();
|
|
}
|