mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-24 13:52:38 +03:00
Merge branch 'ofw-dev' into dev
This commit is contained in:
commit
e9fc5f62a5
4
applications/external/hid_app/hid.c
vendored
4
applications/external/hid_app/hid.c
vendored
@ -414,7 +414,7 @@ int32_t hid_usb_app(void* p) {
|
|||||||
|
|
||||||
bt_hid_connection_status_changed_callback(BtStatusConnected, app);
|
bt_hid_connection_status_changed_callback(BtStatusConnected, app);
|
||||||
|
|
||||||
DOLPHIN_DEED(DolphinDeedPluginStart);
|
dolphin_deed(DolphinDeedPluginStart);
|
||||||
|
|
||||||
view_dispatcher_run(app->view_dispatcher);
|
view_dispatcher_run(app->view_dispatcher);
|
||||||
|
|
||||||
@ -454,7 +454,7 @@ int32_t hid_ble_app(void* p) {
|
|||||||
furi_hal_bt_start_advertising();
|
furi_hal_bt_start_advertising();
|
||||||
bt_set_status_changed_callback(app->bt, bt_hid_connection_status_changed_callback, app);
|
bt_set_status_changed_callback(app->bt, bt_hid_connection_status_changed_callback, app);
|
||||||
|
|
||||||
DOLPHIN_DEED(DolphinDeedPluginStart);
|
dolphin_deed(DolphinDeedPluginStart);
|
||||||
|
|
||||||
view_dispatcher_run(app->view_dispatcher);
|
view_dispatcher_run(app->view_dispatcher);
|
||||||
|
|
||||||
|
2
applications/external/mfkey32/mfkey32.c
vendored
2
applications/external/mfkey32/mfkey32.c
vendored
@ -1112,7 +1112,7 @@ void mfkey32(ProgramState* program_state) {
|
|||||||
}
|
}
|
||||||
if(keyarray_size > 0) {
|
if(keyarray_size > 0) {
|
||||||
// TODO: Should we use DolphinDeedNfcMfcAdd?
|
// TODO: Should we use DolphinDeedNfcMfcAdd?
|
||||||
DOLPHIN_DEED(DolphinDeedNfcMfcAdd);
|
dolphin_deed(DolphinDeedNfcMfcAdd);
|
||||||
}
|
}
|
||||||
napi_mf_classic_nonce_array_free(nonce_arr);
|
napi_mf_classic_nonce_array_free(nonce_arr);
|
||||||
napi_mf_classic_dict_free(user_dict);
|
napi_mf_classic_dict_free(user_dict);
|
||||||
|
@ -19,7 +19,7 @@ void picopass_scene_device_info_on_enter(void* context) {
|
|||||||
FuriString* wiegand_str = furi_string_alloc();
|
FuriString* wiegand_str = furi_string_alloc();
|
||||||
FuriString* sio_str = furi_string_alloc();
|
FuriString* sio_str = furi_string_alloc();
|
||||||
|
|
||||||
DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
|
dolphin_deed(DolphinDeedNfcReadSuccess);
|
||||||
|
|
||||||
// Setup view
|
// Setup view
|
||||||
PicopassBlock* AA1 = picopass->dev->dev_data.AA1;
|
PicopassBlock* AA1 = picopass->dev->dev_data.AA1;
|
||||||
|
@ -10,7 +10,7 @@ void picopass_read_card_worker_callback(PicopassWorkerEvent event, void* context
|
|||||||
|
|
||||||
void picopass_scene_read_card_on_enter(void* context) {
|
void picopass_scene_read_card_on_enter(void* context) {
|
||||||
Picopass* picopass = context;
|
Picopass* picopass = context;
|
||||||
DOLPHIN_DEED(DolphinDeedNfcRead);
|
dolphin_deed(DolphinDeedNfcRead);
|
||||||
|
|
||||||
// Setup view
|
// Setup view
|
||||||
Popup* popup = picopass->popup;
|
Popup* popup = picopass->popup;
|
||||||
|
@ -21,7 +21,7 @@ void picopass_scene_read_card_success_on_enter(void* context) {
|
|||||||
FuriString* wiegand_str = furi_string_alloc();
|
FuriString* wiegand_str = furi_string_alloc();
|
||||||
FuriString* sio_str = furi_string_alloc();
|
FuriString* sio_str = furi_string_alloc();
|
||||||
|
|
||||||
DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
|
dolphin_deed(DolphinDeedNfcReadSuccess);
|
||||||
|
|
||||||
// Send notification
|
// Send notification
|
||||||
notification_message(picopass->notifications, &sequence_success);
|
notification_message(picopass->notifications, &sequence_success);
|
||||||
|
@ -19,7 +19,7 @@ void picopass_scene_read_factory_success_on_enter(void* context) {
|
|||||||
FuriString* title = furi_string_alloc_set("Factory Default");
|
FuriString* title = furi_string_alloc_set("Factory Default");
|
||||||
FuriString* subtitle = furi_string_alloc_set("");
|
FuriString* subtitle = furi_string_alloc_set("");
|
||||||
|
|
||||||
DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
|
dolphin_deed(DolphinDeedNfcReadSuccess);
|
||||||
|
|
||||||
// Send notification
|
// Send notification
|
||||||
notification_message(picopass->notifications, &sequence_success);
|
notification_message(picopass->notifications, &sequence_success);
|
||||||
|
@ -8,7 +8,7 @@ void picopass_scene_save_success_popup_callback(void* context) {
|
|||||||
|
|
||||||
void picopass_scene_save_success_on_enter(void* context) {
|
void picopass_scene_save_success_on_enter(void* context) {
|
||||||
Picopass* picopass = context;
|
Picopass* picopass = context;
|
||||||
DOLPHIN_DEED(DolphinDeedNfcSave);
|
dolphin_deed(DolphinDeedNfcSave);
|
||||||
|
|
||||||
// Setup view
|
// Setup view
|
||||||
Popup* popup = picopass->popup;
|
Popup* popup = picopass->popup;
|
||||||
|
@ -9,7 +9,7 @@ void picopass_write_card_worker_callback(PicopassWorkerEvent event, void* contex
|
|||||||
|
|
||||||
void picopass_scene_write_card_on_enter(void* context) {
|
void picopass_scene_write_card_on_enter(void* context) {
|
||||||
Picopass* picopass = context;
|
Picopass* picopass = context;
|
||||||
DOLPHIN_DEED(DolphinDeedNfcSave);
|
dolphin_deed(DolphinDeedNfcSave);
|
||||||
|
|
||||||
// Setup view
|
// Setup view
|
||||||
Popup* popup = picopass->popup;
|
Popup* popup = picopass->popup;
|
||||||
|
@ -18,7 +18,7 @@ void picopass_scene_write_card_success_on_enter(void* context) {
|
|||||||
Widget* widget = picopass->widget;
|
Widget* widget = picopass->widget;
|
||||||
FuriString* str = furi_string_alloc_set("Write Success!");
|
FuriString* str = furi_string_alloc_set("Write Success!");
|
||||||
|
|
||||||
DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
|
dolphin_deed(DolphinDeedNfcReadSuccess);
|
||||||
|
|
||||||
// Send notification
|
// Send notification
|
||||||
notification_message(picopass->notifications, &sequence_success);
|
notification_message(picopass->notifications, &sequence_success);
|
||||||
|
@ -9,7 +9,7 @@ void picopass_write_key_worker_callback(PicopassWorkerEvent event, void* context
|
|||||||
|
|
||||||
void picopass_scene_write_key_on_enter(void* context) {
|
void picopass_scene_write_key_on_enter(void* context) {
|
||||||
Picopass* picopass = context;
|
Picopass* picopass = context;
|
||||||
DOLPHIN_DEED(DolphinDeedNfcSave);
|
dolphin_deed(DolphinDeedNfcSave);
|
||||||
|
|
||||||
// Setup view
|
// Setup view
|
||||||
Popup* popup = picopass->popup;
|
Popup* popup = picopass->popup;
|
||||||
|
@ -344,7 +344,7 @@ int32_t snake_game_app(void* p) {
|
|||||||
|
|
||||||
notification_message_block(notification, &sequence_display_backlight_enforce_on);
|
notification_message_block(notification, &sequence_display_backlight_enforce_on);
|
||||||
|
|
||||||
DOLPHIN_DEED(DolphinDeedPluginGameStart);
|
dolphin_deed(DolphinDeedPluginGameStart);
|
||||||
|
|
||||||
SnakeEvent event;
|
SnakeEvent event;
|
||||||
for(bool processing = true; processing;) {
|
for(bool processing = true; processing;) {
|
||||||
|
@ -426,7 +426,7 @@ static int32_t bad_usb_worker(void* context) {
|
|||||||
if(flags & WorkerEvtEnd) {
|
if(flags & WorkerEvtEnd) {
|
||||||
break;
|
break;
|
||||||
} else if(flags & WorkerEvtStartStop) { // Start executing script
|
} else if(flags & WorkerEvtStartStop) { // Start executing script
|
||||||
DOLPHIN_DEED(DolphinDeedBadUsbPlayScript);
|
dolphin_deed(DolphinDeedBadUsbPlayScript);
|
||||||
delay_val = 0;
|
delay_val = 0;
|
||||||
bad_usb->buf_len = 0;
|
bad_usb->buf_len = 0;
|
||||||
bad_usb->st.line_cur = 0;
|
bad_usb->st.line_cur = 0;
|
||||||
@ -449,7 +449,7 @@ static int32_t bad_usb_worker(void* context) {
|
|||||||
if(flags & WorkerEvtEnd) {
|
if(flags & WorkerEvtEnd) {
|
||||||
break;
|
break;
|
||||||
} else if(flags & WorkerEvtConnect) { // Start executing script
|
} else if(flags & WorkerEvtConnect) { // Start executing script
|
||||||
DOLPHIN_DEED(DolphinDeedBadUsbPlayScript);
|
dolphin_deed(DolphinDeedBadUsbPlayScript);
|
||||||
delay_val = 0;
|
delay_val = 0;
|
||||||
bad_usb->buf_len = 0;
|
bad_usb->buf_len = 0;
|
||||||
bad_usb->st.line_cur = 0;
|
bad_usb->st.line_cur = 0;
|
||||||
|
@ -89,7 +89,7 @@ bool gpio_scene_start_on_event(void* context, SceneManagerEvent event) {
|
|||||||
} else if(event.event == GpioStartEventUsbUart) {
|
} else if(event.event == GpioStartEventUsbUart) {
|
||||||
scene_manager_set_scene_state(app->scene_manager, GpioSceneStart, GpioItemUsbUart);
|
scene_manager_set_scene_state(app->scene_manager, GpioSceneStart, GpioItemUsbUart);
|
||||||
if(!furi_hal_usb_is_locked()) {
|
if(!furi_hal_usb_is_locked()) {
|
||||||
DOLPHIN_DEED(DolphinDeedGpioUartBridge);
|
dolphin_deed(DolphinDeedGpioUartBridge);
|
||||||
scene_manager_next_scene(app->scene_manager, GpioSceneUsbUart);
|
scene_manager_next_scene(app->scene_manager, GpioSceneUsbUart);
|
||||||
} else {
|
} else {
|
||||||
scene_manager_next_scene(app->scene_manager, GpioSceneUsbUartCloseRpc);
|
scene_manager_next_scene(app->scene_manager, GpioSceneUsbUartCloseRpc);
|
||||||
|
@ -282,14 +282,14 @@ int32_t ibutton_app(void* arg) {
|
|||||||
view_dispatcher_attach_to_gui(
|
view_dispatcher_attach_to_gui(
|
||||||
ibutton->view_dispatcher, ibutton->gui, ViewDispatcherTypeDesktop);
|
ibutton->view_dispatcher, ibutton->gui, ViewDispatcherTypeDesktop);
|
||||||
scene_manager_next_scene(ibutton->scene_manager, iButtonSceneRpc);
|
scene_manager_next_scene(ibutton->scene_manager, iButtonSceneRpc);
|
||||||
DOLPHIN_DEED(DolphinDeedIbuttonEmulate);
|
dolphin_deed(DolphinDeedIbuttonEmulate);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
view_dispatcher_attach_to_gui(
|
view_dispatcher_attach_to_gui(
|
||||||
ibutton->view_dispatcher, ibutton->gui, ViewDispatcherTypeFullscreen);
|
ibutton->view_dispatcher, ibutton->gui, ViewDispatcherTypeFullscreen);
|
||||||
if(key_loaded) { //-V547
|
if(key_loaded) { //-V547
|
||||||
scene_manager_next_scene(ibutton->scene_manager, iButtonSceneEmulate);
|
scene_manager_next_scene(ibutton->scene_manager, iButtonSceneEmulate);
|
||||||
DOLPHIN_DEED(DolphinDeedIbuttonEmulate);
|
dolphin_deed(DolphinDeedIbuttonEmulate);
|
||||||
} else {
|
} else {
|
||||||
scene_manager_next_scene(ibutton->scene_manager, iButtonSceneStart);
|
scene_manager_next_scene(ibutton->scene_manager, iButtonSceneStart);
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ bool ibutton_scene_read_on_event(void* context, SceneManagerEvent event) {
|
|||||||
ibutton_notification_message(ibutton, iButtonNotificationMessageSuccess);
|
ibutton_notification_message(ibutton, iButtonNotificationMessageSuccess);
|
||||||
scene_manager_next_scene(scene_manager, iButtonSceneReadSuccess);
|
scene_manager_next_scene(scene_manager, iButtonSceneReadSuccess);
|
||||||
|
|
||||||
DOLPHIN_DEED(DolphinDeedIbuttonReadSuccess);
|
dolphin_deed(DolphinDeedIbuttonReadSuccess);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
scene_manager_next_scene(scene_manager, iButtonSceneReadError);
|
scene_manager_next_scene(scene_manager, iButtonSceneReadError);
|
||||||
|
@ -75,7 +75,7 @@ bool ibutton_scene_read_key_menu_on_event(void* context, SceneManagerEvent event
|
|||||||
scene_manager_next_scene(scene_manager, iButtonSceneSaveName);
|
scene_manager_next_scene(scene_manager, iButtonSceneSaveName);
|
||||||
} else if(event.event == SubmenuIndexEmulate) {
|
} else if(event.event == SubmenuIndexEmulate) {
|
||||||
scene_manager_next_scene(scene_manager, iButtonSceneEmulate);
|
scene_manager_next_scene(scene_manager, iButtonSceneEmulate);
|
||||||
DOLPHIN_DEED(DolphinDeedIbuttonEmulate);
|
dolphin_deed(DolphinDeedIbuttonEmulate);
|
||||||
} else if(event.event == SubmenuIndexViewData) {
|
} else if(event.event == SubmenuIndexViewData) {
|
||||||
scene_manager_next_scene(scene_manager, iButtonSceneViewData);
|
scene_manager_next_scene(scene_manager, iButtonSceneViewData);
|
||||||
} else if(event.event == SubmenuIndexWriteBlank) {
|
} else if(event.event == SubmenuIndexWriteBlank) {
|
||||||
|
@ -58,9 +58,9 @@ bool ibutton_scene_save_name_on_event(void* context, SceneManagerEvent event) {
|
|||||||
// Nothing, do not count editing as saving
|
// Nothing, do not count editing as saving
|
||||||
} else if(scene_manager_has_previous_scene(
|
} else if(scene_manager_has_previous_scene(
|
||||||
ibutton->scene_manager, iButtonSceneAddType)) {
|
ibutton->scene_manager, iButtonSceneAddType)) {
|
||||||
DOLPHIN_DEED(DolphinDeedIbuttonAdd);
|
dolphin_deed(DolphinDeedIbuttonAdd);
|
||||||
} else {
|
} else {
|
||||||
DOLPHIN_DEED(DolphinDeedIbuttonSave);
|
dolphin_deed(DolphinDeedIbuttonSave);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -48,7 +48,7 @@ bool ibutton_scene_saved_key_menu_on_event(void* context, SceneManagerEvent even
|
|||||||
consumed = true;
|
consumed = true;
|
||||||
if(event.event == SubmenuIndexEmulate) {
|
if(event.event == SubmenuIndexEmulate) {
|
||||||
scene_manager_next_scene(scene_manager, iButtonSceneEmulate);
|
scene_manager_next_scene(scene_manager, iButtonSceneEmulate);
|
||||||
DOLPHIN_DEED(DolphinDeedIbuttonEmulate);
|
dolphin_deed(DolphinDeedIbuttonEmulate);
|
||||||
} else if(event.event == SubmenuIndexWriteBlank) {
|
} else if(event.event == SubmenuIndexWriteBlank) {
|
||||||
ibutton->write_mode = iButtonWriteModeBlank;
|
ibutton->write_mode = iButtonWriteModeBlank;
|
||||||
scene_manager_next_scene(scene_manager, iButtonSceneWrite);
|
scene_manager_next_scene(scene_manager, iButtonSceneWrite);
|
||||||
|
@ -33,7 +33,7 @@ bool ibutton_scene_start_on_event(void* context, SceneManagerEvent event) {
|
|||||||
consumed = true;
|
consumed = true;
|
||||||
if(event.event == SubmenuIndexRead) {
|
if(event.event == SubmenuIndexRead) {
|
||||||
scene_manager_next_scene(ibutton->scene_manager, iButtonSceneRead);
|
scene_manager_next_scene(ibutton->scene_manager, iButtonSceneRead);
|
||||||
DOLPHIN_DEED(DolphinDeedIbuttonRead);
|
dolphin_deed(DolphinDeedIbuttonRead);
|
||||||
} else if(event.event == SubmenuIndexSaved) {
|
} else if(event.event == SubmenuIndexSaved) {
|
||||||
scene_manager_next_scene(ibutton->scene_manager, iButtonSceneSelectKey);
|
scene_manager_next_scene(ibutton->scene_manager, iButtonSceneSelectKey);
|
||||||
} else if(event.event == SubmenuIndexAdd) {
|
} else if(event.event == SubmenuIndexAdd) {
|
||||||
|
@ -333,7 +333,7 @@ void infrared_tx_start_signal(Infrared* infrared, InfraredSignal* signal) {
|
|||||||
infrared_worker_set_decoded_signal(infrared->worker, message);
|
infrared_worker_set_decoded_signal(infrared->worker, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
DOLPHIN_DEED(DolphinDeedIrSend);
|
dolphin_deed(DolphinDeedIrSend);
|
||||||
infrared_play_notification_message(infrared, InfraredNotificationMessageBlinkStartSend);
|
infrared_play_notification_message(infrared, InfraredNotificationMessageBlinkStartSend);
|
||||||
|
|
||||||
infrared_worker_tx_set_get_signal_callback(
|
infrared_worker_tx_set_get_signal_callback(
|
||||||
|
@ -70,7 +70,7 @@ bool infrared_scene_universal_common_on_event(void* context, SceneManagerEvent e
|
|||||||
uint32_t record_count;
|
uint32_t record_count;
|
||||||
if(infrared_brute_force_start(
|
if(infrared_brute_force_start(
|
||||||
brute_force, infrared_custom_event_get_value(event.event), &record_count)) {
|
brute_force, infrared_custom_event_get_value(event.event), &record_count)) {
|
||||||
DOLPHIN_DEED(DolphinDeedIrSend);
|
dolphin_deed(DolphinDeedIrSend);
|
||||||
infrared_scene_universal_common_show_popup(infrared, record_count);
|
infrared_scene_universal_common_show_popup(infrared, record_count);
|
||||||
} else {
|
} else {
|
||||||
scene_manager_next_scene(scene_manager, InfraredSceneErrorDatabases);
|
scene_manager_next_scene(scene_manager, InfraredSceneErrorDatabases);
|
||||||
|
@ -28,7 +28,7 @@ bool infrared_scene_learn_on_event(void* context, SceneManagerEvent event) {
|
|||||||
if(event.event == InfraredCustomEventTypeSignalReceived) {
|
if(event.event == InfraredCustomEventTypeSignalReceived) {
|
||||||
infrared_play_notification_message(infrared, InfraredNotificationMessageSuccess);
|
infrared_play_notification_message(infrared, InfraredNotificationMessageSuccess);
|
||||||
scene_manager_next_scene(infrared->scene_manager, InfraredSceneLearnSuccess);
|
scene_manager_next_scene(infrared->scene_manager, InfraredSceneLearnSuccess);
|
||||||
DOLPHIN_DEED(DolphinDeedIrLearnSuccess);
|
dolphin_deed(DolphinDeedIrLearnSuccess);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ bool infrared_scene_learn_enter_name_on_event(void* context, SceneManagerEvent e
|
|||||||
|
|
||||||
if(success) {
|
if(success) {
|
||||||
scene_manager_next_scene(scene_manager, InfraredSceneLearnDone);
|
scene_manager_next_scene(scene_manager, InfraredSceneLearnDone);
|
||||||
DOLPHIN_DEED(DolphinDeedIrSave);
|
dolphin_deed(DolphinDeedIrSave);
|
||||||
} else {
|
} else {
|
||||||
dialog_message_show_storage_error(infrared->dialogs, "Failed to save file");
|
dialog_message_show_storage_error(infrared->dialogs, "Failed to save file");
|
||||||
const uint32_t possible_scenes[] = {InfraredSceneRemoteList, InfraredSceneStart};
|
const uint32_t possible_scenes[] = {InfraredSceneRemoteList, InfraredSceneStart};
|
||||||
|
@ -183,7 +183,7 @@ int32_t lfrfid_app(void* p) {
|
|||||||
view_dispatcher_attach_to_gui(
|
view_dispatcher_attach_to_gui(
|
||||||
app->view_dispatcher, app->gui, ViewDispatcherTypeDesktop);
|
app->view_dispatcher, app->gui, ViewDispatcherTypeDesktop);
|
||||||
scene_manager_next_scene(app->scene_manager, LfRfidSceneRpc);
|
scene_manager_next_scene(app->scene_manager, LfRfidSceneRpc);
|
||||||
DOLPHIN_DEED(DolphinDeedRfidEmulate);
|
dolphin_deed(DolphinDeedRfidEmulate);
|
||||||
} else {
|
} else {
|
||||||
furi_string_set(app->file_path, args);
|
furi_string_set(app->file_path, args);
|
||||||
if(lfrfid_load_key_data(app, app->file_path, true)) {
|
if(lfrfid_load_key_data(app, app->file_path, true)) {
|
||||||
|
@ -72,12 +72,12 @@ bool lfrfid_scene_extra_actions_on_event(void* context, SceneManagerEvent event)
|
|||||||
if(event.event == SubmenuIndexASK) {
|
if(event.event == SubmenuIndexASK) {
|
||||||
app->read_type = LFRFIDWorkerReadTypeASKOnly;
|
app->read_type = LFRFIDWorkerReadTypeASKOnly;
|
||||||
scene_manager_next_scene(app->scene_manager, LfRfidSceneRead);
|
scene_manager_next_scene(app->scene_manager, LfRfidSceneRead);
|
||||||
DOLPHIN_DEED(DolphinDeedRfidRead);
|
dolphin_deed(DolphinDeedRfidRead);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
} else if(event.event == SubmenuIndexPSK) {
|
} else if(event.event == SubmenuIndexPSK) {
|
||||||
app->read_type = LFRFIDWorkerReadTypePSKOnly;
|
app->read_type = LFRFIDWorkerReadTypePSKOnly;
|
||||||
scene_manager_next_scene(app->scene_manager, LfRfidSceneRead);
|
scene_manager_next_scene(app->scene_manager, LfRfidSceneRead);
|
||||||
DOLPHIN_DEED(DolphinDeedRfidRead);
|
dolphin_deed(DolphinDeedRfidRead);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
} else if(event.event == SubmenuIndexClearT5577) {
|
} else if(event.event == SubmenuIndexClearT5577) {
|
||||||
scene_manager_next_scene(app->scene_manager, LfRfidSceneClearT5577Confirm);
|
scene_manager_next_scene(app->scene_manager, LfRfidSceneClearT5577Confirm);
|
||||||
|
@ -81,7 +81,7 @@ bool lfrfid_scene_read_on_event(void* context, SceneManagerEvent event) {
|
|||||||
notification_message(app->notifications, &sequence_success);
|
notification_message(app->notifications, &sequence_success);
|
||||||
furi_string_reset(app->file_name);
|
furi_string_reset(app->file_name);
|
||||||
scene_manager_next_scene(app->scene_manager, LfRfidSceneReadSuccess);
|
scene_manager_next_scene(app->scene_manager, LfRfidSceneReadSuccess);
|
||||||
DOLPHIN_DEED(DolphinDeedRfidReadSuccess);
|
dolphin_deed(DolphinDeedRfidReadSuccess);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
} else if(event.event == LfRfidEventReadStartPSK) {
|
} else if(event.event == LfRfidEventReadStartPSK) {
|
||||||
if(app->read_type == LFRFIDWorkerReadTypeAuto) {
|
if(app->read_type == LFRFIDWorkerReadTypeAuto) {
|
||||||
|
@ -44,7 +44,7 @@ bool lfrfid_scene_read_key_menu_on_event(void* context, SceneManagerEvent event)
|
|||||||
consumed = true;
|
consumed = true;
|
||||||
} else if(event.event == SubmenuIndexEmulate) {
|
} else if(event.event == SubmenuIndexEmulate) {
|
||||||
scene_manager_next_scene(app->scene_manager, LfRfidSceneEmulate);
|
scene_manager_next_scene(app->scene_manager, LfRfidSceneEmulate);
|
||||||
DOLPHIN_DEED(DolphinDeedRfidEmulate);
|
dolphin_deed(DolphinDeedRfidEmulate);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
}
|
}
|
||||||
scene_manager_set_scene_state(app->scene_manager, LfRfidSceneReadKeyMenu, event.event);
|
scene_manager_set_scene_state(app->scene_manager, LfRfidSceneReadKeyMenu, event.event);
|
||||||
|
@ -59,9 +59,9 @@ bool lfrfid_scene_save_name_on_event(void* context, SceneManagerEvent event) {
|
|||||||
if(scene_manager_has_previous_scene(scene_manager, LfRfidSceneSavedKeyMenu)) {
|
if(scene_manager_has_previous_scene(scene_manager, LfRfidSceneSavedKeyMenu)) {
|
||||||
// Nothing, do not count editing as saving
|
// Nothing, do not count editing as saving
|
||||||
} else if(scene_manager_has_previous_scene(scene_manager, LfRfidSceneSaveType)) {
|
} else if(scene_manager_has_previous_scene(scene_manager, LfRfidSceneSaveType)) {
|
||||||
DOLPHIN_DEED(DolphinDeedRfidAdd);
|
dolphin_deed(DolphinDeedRfidAdd);
|
||||||
} else {
|
} else {
|
||||||
DOLPHIN_DEED(DolphinDeedRfidSave);
|
dolphin_deed(DolphinDeedRfidSave);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
scene_manager_search_and_switch_to_previous_scene(
|
scene_manager_search_and_switch_to_previous_scene(
|
||||||
|
@ -43,7 +43,7 @@ bool lfrfid_scene_saved_key_menu_on_event(void* context, SceneManagerEvent event
|
|||||||
if(event.type == SceneManagerEventTypeCustom) {
|
if(event.type == SceneManagerEventTypeCustom) {
|
||||||
if(event.event == SubmenuIndexEmulate) {
|
if(event.event == SubmenuIndexEmulate) {
|
||||||
scene_manager_next_scene(app->scene_manager, LfRfidSceneEmulate);
|
scene_manager_next_scene(app->scene_manager, LfRfidSceneEmulate);
|
||||||
DOLPHIN_DEED(DolphinDeedRfidEmulate);
|
dolphin_deed(DolphinDeedRfidEmulate);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
} else if(event.event == SubmenuIndexWrite) {
|
} else if(event.event == SubmenuIndexWrite) {
|
||||||
scene_manager_next_scene(app->scene_manager, LfRfidSceneWrite);
|
scene_manager_next_scene(app->scene_manager, LfRfidSceneWrite);
|
||||||
|
@ -49,7 +49,7 @@ bool lfrfid_scene_start_on_event(void* context, SceneManagerEvent event) {
|
|||||||
if(event.event == SubmenuIndexRead) {
|
if(event.event == SubmenuIndexRead) {
|
||||||
scene_manager_set_scene_state(app->scene_manager, LfRfidSceneStart, SubmenuIndexRead);
|
scene_manager_set_scene_state(app->scene_manager, LfRfidSceneStart, SubmenuIndexRead);
|
||||||
scene_manager_next_scene(app->scene_manager, LfRfidSceneRead);
|
scene_manager_next_scene(app->scene_manager, LfRfidSceneRead);
|
||||||
DOLPHIN_DEED(DolphinDeedRfidRead);
|
dolphin_deed(DolphinDeedRfidRead);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
} else if(event.event == SubmenuIndexSaved) {
|
} else if(event.event == SubmenuIndexSaved) {
|
||||||
// Like in the other apps, explicitly save the scene state
|
// Like in the other apps, explicitly save the scene state
|
||||||
|
@ -286,16 +286,16 @@ int32_t nfc_app(void* p) {
|
|||||||
if(nfc_device_load(nfc->dev, p, true)) {
|
if(nfc_device_load(nfc->dev, p, true)) {
|
||||||
if(nfc->dev->format == NfcDeviceSaveFormatMifareUl) {
|
if(nfc->dev->format == NfcDeviceSaveFormatMifareUl) {
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfUltralightEmulate);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfUltralightEmulate);
|
||||||
DOLPHIN_DEED(DolphinDeedNfcEmulate);
|
dolphin_deed(DolphinDeedNfcEmulate);
|
||||||
} else if(nfc->dev->format == NfcDeviceSaveFormatMifareClassic) {
|
} else if(nfc->dev->format == NfcDeviceSaveFormatMifareClassic) {
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfClassicEmulate);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfClassicEmulate);
|
||||||
DOLPHIN_DEED(DolphinDeedNfcEmulate);
|
dolphin_deed(DolphinDeedNfcEmulate);
|
||||||
} else if(nfc->dev->format == NfcDeviceSaveFormatNfcV) {
|
} else if(nfc->dev->format == NfcDeviceSaveFormatNfcV) {
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneNfcVEmulate);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneNfcVEmulate);
|
||||||
DOLPHIN_DEED(DolphinDeedNfcEmulate);
|
DOLPHIN_DEED(DolphinDeedNfcEmulate);
|
||||||
} else {
|
} else {
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneEmulateUid);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneEmulateUid);
|
||||||
DOLPHIN_DEED(DolphinDeedNfcEmulate);
|
dolphin_deed(DolphinDeedNfcEmulate);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Exit app
|
// Exit app
|
||||||
|
@ -111,7 +111,7 @@ bool nfc_scene_mf_classic_dict_attack_on_event(void* context, SceneManagerEvent
|
|||||||
} else {
|
} else {
|
||||||
notification_message(nfc->notifications, &sequence_success);
|
notification_message(nfc->notifications, &sequence_success);
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfClassicReadSuccess);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfClassicReadSuccess);
|
||||||
DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
|
dolphin_deed(DolphinDeedNfcReadSuccess);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
}
|
}
|
||||||
} else if(event.event == NfcWorkerEventAborted) {
|
} else if(event.event == NfcWorkerEventAborted) {
|
||||||
@ -123,7 +123,7 @@ bool nfc_scene_mf_classic_dict_attack_on_event(void* context, SceneManagerEvent
|
|||||||
notification_message(nfc->notifications, &sequence_success);
|
notification_message(nfc->notifications, &sequence_success);
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfClassicReadSuccess);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfClassicReadSuccess);
|
||||||
// Counting failed attempts too
|
// Counting failed attempts too
|
||||||
DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
|
dolphin_deed(DolphinDeedNfcReadSuccess);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
}
|
}
|
||||||
} else if(event.event == NfcWorkerEventCardDetected) {
|
} else if(event.event == NfcWorkerEventCardDetected) {
|
||||||
|
@ -37,7 +37,7 @@ bool nfc_scene_mf_classic_keys_add_on_event(void* context, SceneManagerEvent eve
|
|||||||
nfc->scene_manager, NfcSceneMfClassicKeysWarnDuplicate);
|
nfc->scene_manager, NfcSceneMfClassicKeysWarnDuplicate);
|
||||||
} else if(mf_classic_dict_add_key(dict, nfc->byte_input_store)) {
|
} else if(mf_classic_dict_add_key(dict, nfc->byte_input_store)) {
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneSaveSuccess);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneSaveSuccess);
|
||||||
DOLPHIN_DEED(DolphinDeedNfcMfcAdd);
|
dolphin_deed(DolphinDeedNfcMfcAdd);
|
||||||
} else {
|
} else {
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneDictNotFound);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneDictNotFound);
|
||||||
}
|
}
|
||||||
|
@ -54,14 +54,14 @@ bool nfc_scene_mf_classic_menu_on_event(void* context, SceneManagerEvent event)
|
|||||||
} else if(event.event == SubmenuIndexEmulate) {
|
} else if(event.event == SubmenuIndexEmulate) {
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfClassicEmulate);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfClassicEmulate);
|
||||||
if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSetType)) {
|
if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSetType)) {
|
||||||
DOLPHIN_DEED(DolphinDeedNfcAddEmulate);
|
dolphin_deed(DolphinDeedNfcAddEmulate);
|
||||||
} else {
|
} else {
|
||||||
DOLPHIN_DEED(DolphinDeedNfcEmulate);
|
dolphin_deed(DolphinDeedNfcEmulate);
|
||||||
}
|
}
|
||||||
consumed = true;
|
consumed = true;
|
||||||
} else if(event.event == SubmenuIndexDetectReader) {
|
} else if(event.event == SubmenuIndexDetectReader) {
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneDetectReader);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneDetectReader);
|
||||||
DOLPHIN_DEED(DolphinDeedNfcDetectReader);
|
dolphin_deed(DolphinDeedNfcDetectReader);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
} else if(event.event == SubmenuIndexInfo) {
|
} else if(event.event == SubmenuIndexInfo) {
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneNfcDataInfo);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneNfcDataInfo);
|
||||||
|
@ -34,7 +34,7 @@ static void nfc_scene_mf_classic_update_setup_view(Nfc* nfc) {
|
|||||||
|
|
||||||
void nfc_scene_mf_classic_update_on_enter(void* context) {
|
void nfc_scene_mf_classic_update_on_enter(void* context) {
|
||||||
Nfc* nfc = context;
|
Nfc* nfc = context;
|
||||||
DOLPHIN_DEED(DolphinDeedNfcEmulate);
|
dolphin_deed(DolphinDeedNfcEmulate);
|
||||||
|
|
||||||
scene_manager_set_scene_state(
|
scene_manager_set_scene_state(
|
||||||
nfc->scene_manager, NfcSceneMfClassicUpdate, NfcSceneMfClassicUpdateStateCardSearch);
|
nfc->scene_manager, NfcSceneMfClassicUpdate, NfcSceneMfClassicUpdateStateCardSearch);
|
||||||
|
@ -8,7 +8,7 @@ void nfc_scene_mf_classic_update_success_popup_callback(void* context) {
|
|||||||
|
|
||||||
void nfc_scene_mf_classic_update_success_on_enter(void* context) {
|
void nfc_scene_mf_classic_update_success_on_enter(void* context) {
|
||||||
Nfc* nfc = context;
|
Nfc* nfc = context;
|
||||||
DOLPHIN_DEED(DolphinDeedNfcSave);
|
dolphin_deed(DolphinDeedNfcSave);
|
||||||
|
|
||||||
notification_message(nfc->notifications, &sequence_success);
|
notification_message(nfc->notifications, &sequence_success);
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ static void nfc_scene_mf_classic_write_setup_view(Nfc* nfc) {
|
|||||||
|
|
||||||
void nfc_scene_mf_classic_write_on_enter(void* context) {
|
void nfc_scene_mf_classic_write_on_enter(void* context) {
|
||||||
Nfc* nfc = context;
|
Nfc* nfc = context;
|
||||||
DOLPHIN_DEED(DolphinDeedNfcEmulate);
|
dolphin_deed(DolphinDeedNfcEmulate);
|
||||||
|
|
||||||
scene_manager_set_scene_state(
|
scene_manager_set_scene_state(
|
||||||
nfc->scene_manager, NfcSceneMfClassicWrite, NfcSceneMfClassicWriteStateCardSearch);
|
nfc->scene_manager, NfcSceneMfClassicWrite, NfcSceneMfClassicWriteStateCardSearch);
|
||||||
|
@ -8,7 +8,7 @@ void nfc_scene_mf_classic_write_success_popup_callback(void* context) {
|
|||||||
|
|
||||||
void nfc_scene_mf_classic_write_success_on_enter(void* context) {
|
void nfc_scene_mf_classic_write_success_on_enter(void* context) {
|
||||||
Nfc* nfc = context;
|
Nfc* nfc = context;
|
||||||
DOLPHIN_DEED(DolphinDeedNfcSave);
|
dolphin_deed(DolphinDeedNfcSave);
|
||||||
|
|
||||||
notification_message(nfc->notifications, &sequence_success);
|
notification_message(nfc->notifications, &sequence_success);
|
||||||
|
|
||||||
|
@ -50,9 +50,9 @@ bool nfc_scene_mf_desfire_menu_on_event(void* context, SceneManagerEvent event)
|
|||||||
} else if(event.event == SubmenuIndexEmulateUid) {
|
} else if(event.event == SubmenuIndexEmulateUid) {
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneEmulateUid);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneEmulateUid);
|
||||||
if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSetType)) {
|
if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSetType)) {
|
||||||
DOLPHIN_DEED(DolphinDeedNfcAddEmulate);
|
dolphin_deed(DolphinDeedNfcAddEmulate);
|
||||||
} else {
|
} else {
|
||||||
DOLPHIN_DEED(DolphinDeedNfcEmulate);
|
dolphin_deed(DolphinDeedNfcEmulate);
|
||||||
}
|
}
|
||||||
consumed = true;
|
consumed = true;
|
||||||
} else if(event.event == SubmenuIndexInfo) {
|
} else if(event.event == SubmenuIndexInfo) {
|
||||||
|
@ -60,9 +60,9 @@ bool nfc_scene_mf_ultralight_menu_on_event(void* context, SceneManagerEvent even
|
|||||||
} else if(event.event == SubmenuIndexEmulate) {
|
} else if(event.event == SubmenuIndexEmulate) {
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfUltralightEmulate);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfUltralightEmulate);
|
||||||
if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSetType)) {
|
if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSetType)) {
|
||||||
DOLPHIN_DEED(DolphinDeedNfcAddEmulate);
|
dolphin_deed(DolphinDeedNfcAddEmulate);
|
||||||
} else {
|
} else {
|
||||||
DOLPHIN_DEED(DolphinDeedNfcEmulate);
|
dolphin_deed(DolphinDeedNfcEmulate);
|
||||||
}
|
}
|
||||||
consumed = true;
|
consumed = true;
|
||||||
} else if(event.event == SubmenuIndexUnlock) {
|
} else if(event.event == SubmenuIndexUnlock) {
|
||||||
|
@ -61,7 +61,7 @@ bool nfc_scene_mf_ultralight_unlock_warn_on_event(void* context, SceneManagerEve
|
|||||||
if(event.type == SceneManagerEventTypeCustom) {
|
if(event.type == SceneManagerEventTypeCustom) {
|
||||||
if(event.event == DialogExResultRight) {
|
if(event.event == DialogExResultRight) {
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfUltralightReadAuth);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfUltralightReadAuth);
|
||||||
DOLPHIN_DEED(DolphinDeedNfcRead);
|
dolphin_deed(DolphinDeedNfcRead);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
} else if(event.event == DialogExResultLeft) {
|
} else if(event.event == DialogExResultLeft) {
|
||||||
if(auth_method == MfUltralightAuthMethodAuto) {
|
if(auth_method == MfUltralightAuthMethodAuto) {
|
||||||
@ -79,7 +79,7 @@ bool nfc_scene_mf_ultralight_unlock_warn_on_event(void* context, SceneManagerEve
|
|||||||
if(event.type == SceneManagerEventTypeCustom) {
|
if(event.type == SceneManagerEventTypeCustom) {
|
||||||
if(event.event == DialogExResultCenter) {
|
if(event.event == DialogExResultCenter) {
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfUltralightReadAuth);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfUltralightReadAuth);
|
||||||
DOLPHIN_DEED(DolphinDeedNfcRead);
|
dolphin_deed(DolphinDeedNfcRead);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,9 +43,9 @@ bool nfc_scene_nfca_menu_on_event(void* context, SceneManagerEvent event) {
|
|||||||
} else if(event.event == SubmenuIndexEmulateUid) {
|
} else if(event.event == SubmenuIndexEmulateUid) {
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneEmulateUid);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneEmulateUid);
|
||||||
if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSetType)) {
|
if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSetType)) {
|
||||||
DOLPHIN_DEED(DolphinDeedNfcAddEmulate);
|
dolphin_deed(DolphinDeedNfcAddEmulate);
|
||||||
} else {
|
} else {
|
||||||
DOLPHIN_DEED(DolphinDeedNfcEmulate);
|
dolphin_deed(DolphinDeedNfcEmulate);
|
||||||
}
|
}
|
||||||
consumed = true;
|
consumed = true;
|
||||||
} else if(event.event == SubmenuIndexInfo) {
|
} else if(event.event == SubmenuIndexInfo) {
|
||||||
|
@ -32,7 +32,7 @@ bool nfc_scene_nfcv_key_input_on_event(void* context, SceneManagerEvent event) {
|
|||||||
if(event.type == SceneManagerEventTypeCustom) {
|
if(event.type == SceneManagerEventTypeCustom) {
|
||||||
if(event.event == NfcCustomEventByteInputDone) {
|
if(event.event == NfcCustomEventByteInputDone) {
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneNfcVUnlock);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneNfcVUnlock);
|
||||||
DOLPHIN_DEED(DolphinDeedNfcRead);
|
dolphin_deed(DolphinDeedNfcRead);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,9 +42,9 @@ bool nfc_scene_nfcv_menu_on_event(void* context, SceneManagerEvent event) {
|
|||||||
} else if(event.event == SubmenuIndexEmulate) {
|
} else if(event.event == SubmenuIndexEmulate) {
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneNfcVEmulate);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneNfcVEmulate);
|
||||||
if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSetType)) {
|
if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSetType)) {
|
||||||
DOLPHIN_DEED(DolphinDeedNfcAddEmulate);
|
dolphin_deed(DolphinDeedNfcAddEmulate);
|
||||||
} else {
|
} else {
|
||||||
DOLPHIN_DEED(DolphinDeedNfcEmulate);
|
dolphin_deed(DolphinDeedNfcEmulate);
|
||||||
}
|
}
|
||||||
consumed = true;
|
consumed = true;
|
||||||
} else if(event.event == SubmenuIndexInfo) {
|
} else if(event.event == SubmenuIndexInfo) {
|
||||||
|
@ -76,7 +76,7 @@ void nfc_scene_nfcv_unlock_set_state(Nfc* nfc, NfcSceneNfcVUnlockState state) {
|
|||||||
popup_set_timeout(popup, 1500);
|
popup_set_timeout(popup, 1500);
|
||||||
|
|
||||||
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewPopup);
|
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewPopup);
|
||||||
DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
|
dolphin_deed(DolphinDeedNfcReadSuccess);
|
||||||
|
|
||||||
} else if(state == NfcSceneNfcVUnlockStateAlreadyUnlocked) {
|
} else if(state == NfcSceneNfcVUnlockStateAlreadyUnlocked) {
|
||||||
popup_reset(popup);
|
popup_reset(popup);
|
||||||
|
@ -45,7 +45,7 @@ bool nfc_scene_nfcv_unlock_menu_on_event(void* context, SceneManagerEvent event)
|
|||||||
} else if(event.event == SubmenuIndexNfcVUnlockMenuTonieBox) {
|
} else if(event.event == SubmenuIndexNfcVUnlockMenuTonieBox) {
|
||||||
nfc->dev->dev_data.nfcv_data.auth_method = NfcVAuthMethodTonieBox;
|
nfc->dev->dev_data.nfcv_data.auth_method = NfcVAuthMethodTonieBox;
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneNfcVUnlock);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneNfcVUnlock);
|
||||||
DOLPHIN_DEED(DolphinDeedNfcRead);
|
dolphin_deed(DolphinDeedNfcRead);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
}
|
}
|
||||||
scene_manager_set_scene_state(nfc->scene_manager, NfcSceneNfcVUnlockMenu, event.event);
|
scene_manager_set_scene_state(nfc->scene_manager, NfcSceneNfcVUnlockMenu, event.event);
|
||||||
|
@ -61,34 +61,34 @@ bool nfc_scene_read_on_event(void* context, SceneManagerEvent event) {
|
|||||||
(event.event == NfcWorkerEventReadUidNfcV)) {
|
(event.event == NfcWorkerEventReadUidNfcV)) {
|
||||||
notification_message(nfc->notifications, &sequence_success);
|
notification_message(nfc->notifications, &sequence_success);
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneReadCardSuccess);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneReadCardSuccess);
|
||||||
DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
|
dolphin_deed(DolphinDeedNfcReadSuccess);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
} else if(event.event == NfcWorkerEventReadUidNfcA) {
|
} else if(event.event == NfcWorkerEventReadUidNfcA) {
|
||||||
notification_message(nfc->notifications, &sequence_success);
|
notification_message(nfc->notifications, &sequence_success);
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneNfcaReadSuccess);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneNfcaReadSuccess);
|
||||||
DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
|
dolphin_deed(DolphinDeedNfcReadSuccess);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
} else if(event.event == NfcWorkerEventReadNfcV) {
|
} else if(event.event == NfcWorkerEventReadNfcV) {
|
||||||
notification_message(nfc->notifications, &sequence_success);
|
notification_message(nfc->notifications, &sequence_success);
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneNfcVReadSuccess);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneNfcVReadSuccess);
|
||||||
DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
|
dolphin_deed(DolphinDeedNfcReadSuccess);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
} else if(event.event == NfcWorkerEventReadMfUltralight) {
|
} else if(event.event == NfcWorkerEventReadMfUltralight) {
|
||||||
notification_message(nfc->notifications, &sequence_success);
|
notification_message(nfc->notifications, &sequence_success);
|
||||||
// Set unlock password input to 0xFFFFFFFF only on fresh read
|
// Set unlock password input to 0xFFFFFFFF only on fresh read
|
||||||
memset(nfc->byte_input_store, 0xFF, sizeof(nfc->byte_input_store));
|
memset(nfc->byte_input_store, 0xFF, sizeof(nfc->byte_input_store));
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfUltralightReadSuccess);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfUltralightReadSuccess);
|
||||||
DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
|
dolphin_deed(DolphinDeedNfcReadSuccess);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
} else if(event.event == NfcWorkerEventReadMfClassicDone) {
|
} else if(event.event == NfcWorkerEventReadMfClassicDone) {
|
||||||
notification_message(nfc->notifications, &sequence_success);
|
notification_message(nfc->notifications, &sequence_success);
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfClassicReadSuccess);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfClassicReadSuccess);
|
||||||
DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
|
dolphin_deed(DolphinDeedNfcReadSuccess);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
} else if(event.event == NfcWorkerEventReadMfDesfire) {
|
} else if(event.event == NfcWorkerEventReadMfDesfire) {
|
||||||
notification_message(nfc->notifications, &sequence_success);
|
notification_message(nfc->notifications, &sequence_success);
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfDesfireReadSuccess);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfDesfireReadSuccess);
|
||||||
DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
|
dolphin_deed(DolphinDeedNfcReadSuccess);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
} else if(event.event == NfcWorkerEventReadBankCard) {
|
} else if(event.event == NfcWorkerEventReadBankCard) {
|
||||||
notification_message(nfc->notifications, &sequence_success);
|
notification_message(nfc->notifications, &sequence_success);
|
||||||
|
@ -67,9 +67,9 @@ bool nfc_scene_save_name_on_event(void* context, SceneManagerEvent event) {
|
|||||||
if(!scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSavedMenu)) {
|
if(!scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSavedMenu)) {
|
||||||
// Nothing, do not count editing as saving
|
// Nothing, do not count editing as saving
|
||||||
} else if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSetType)) {
|
} else if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSetType)) {
|
||||||
DOLPHIN_DEED(DolphinDeedNfcAddSave);
|
dolphin_deed(DolphinDeedNfcAddSave);
|
||||||
} else {
|
} else {
|
||||||
DOLPHIN_DEED(DolphinDeedNfcSave);
|
dolphin_deed(DolphinDeedNfcSave);
|
||||||
}
|
}
|
||||||
consumed = true;
|
consumed = true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -125,11 +125,11 @@ bool nfc_scene_saved_menu_on_event(void* context, SceneManagerEvent event) {
|
|||||||
} else {
|
} else {
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneEmulateUid);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneEmulateUid);
|
||||||
}
|
}
|
||||||
DOLPHIN_DEED(DolphinDeedNfcEmulate);
|
dolphin_deed(DolphinDeedNfcEmulate);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
} else if(event.event == SubmenuIndexDetectReader) {
|
} else if(event.event == SubmenuIndexDetectReader) {
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneDetectReader);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneDetectReader);
|
||||||
DOLPHIN_DEED(DolphinDeedNfcDetectReader);
|
dolphin_deed(DolphinDeedNfcDetectReader);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
} else if(event.event == SubmenuIndexWrite) {
|
} else if(event.event == SubmenuIndexWrite) {
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfClassicWrite);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfClassicWrite);
|
||||||
|
@ -53,7 +53,7 @@ bool nfc_scene_start_on_event(void* context, SceneManagerEvent event) {
|
|||||||
scene_manager_set_scene_state(nfc->scene_manager, NfcSceneStart, SubmenuIndexRead);
|
scene_manager_set_scene_state(nfc->scene_manager, NfcSceneStart, SubmenuIndexRead);
|
||||||
nfc->dev->dev_data.read_mode = NfcReadModeAuto;
|
nfc->dev->dev_data.read_mode = NfcReadModeAuto;
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneRead);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneRead);
|
||||||
DOLPHIN_DEED(DolphinDeedNfcRead);
|
dolphin_deed(DolphinDeedNfcRead);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
} else if(event.event == SubmenuIndexDetectReader) {
|
} else if(event.event == SubmenuIndexDetectReader) {
|
||||||
scene_manager_set_scene_state(
|
scene_manager_set_scene_state(
|
||||||
@ -62,7 +62,7 @@ bool nfc_scene_start_on_event(void* context, SceneManagerEvent event) {
|
|||||||
if(sd_exist) {
|
if(sd_exist) {
|
||||||
nfc_device_data_clear(&nfc->dev->dev_data);
|
nfc_device_data_clear(&nfc->dev->dev_data);
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneDetectReader);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneDetectReader);
|
||||||
DOLPHIN_DEED(DolphinDeedNfcDetectReader);
|
dolphin_deed(DolphinDeedNfcDetectReader);
|
||||||
} else {
|
} else {
|
||||||
scene_manager_next_scene(nfc->scene_manager, NfcSceneDictNotFound);
|
scene_manager_next_scene(nfc->scene_manager, NfcSceneDictNotFound);
|
||||||
}
|
}
|
||||||
|
@ -213,7 +213,7 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
|
|||||||
} else {
|
} else {
|
||||||
if(scene_manager_has_previous_scene(subghz->scene_manager, SubGhzSceneSaved) ||
|
if(scene_manager_has_previous_scene(subghz->scene_manager, SubGhzSceneSaved) ||
|
||||||
!scene_manager_has_previous_scene(subghz->scene_manager, SubGhzSceneStart)) {
|
!scene_manager_has_previous_scene(subghz->scene_manager, SubGhzSceneStart)) {
|
||||||
DOLPHIN_DEED(DolphinDeedSubGhzSend);
|
dolphin_deed(DolphinDeedSubGhzSend);
|
||||||
}
|
}
|
||||||
// set callback end tx
|
// set callback end tx
|
||||||
subghz_txrx_set_raw_file_encoder_worker_callback_end(
|
subghz_txrx_set_raw_file_encoder_worker_callback_end(
|
||||||
@ -268,7 +268,7 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
|
|||||||
} else {
|
} else {
|
||||||
SubGhzRadioPreset preset = subghz_txrx_get_preset(subghz->txrx);
|
SubGhzRadioPreset preset = subghz_txrx_get_preset(subghz->txrx);
|
||||||
if(subghz_protocol_raw_save_to_file_init(decoder_raw, RAW_FILE_NAME, &preset)) {
|
if(subghz_protocol_raw_save_to_file_init(decoder_raw, RAW_FILE_NAME, &preset)) {
|
||||||
DOLPHIN_DEED(DolphinDeedSubGhzRawRec);
|
dolphin_deed(DolphinDeedSubGhzRawRec);
|
||||||
subghz_txrx_rx_start(subghz->txrx);
|
subghz_txrx_rx_start(subghz->txrx);
|
||||||
subghz->state_notifications = SubGhzNotificationStateRx;
|
subghz->state_notifications = SubGhzNotificationStateRx;
|
||||||
subghz_rx_key_state_set(subghz, SubGhzRxKeyStateAddKey);
|
subghz_rx_key_state_set(subghz, SubGhzRxKeyStateAddKey);
|
||||||
|
@ -223,7 +223,7 @@ bool subghz_scene_receiver_on_event(void* context, SceneManagerEvent event) {
|
|||||||
// Show file info, scene: receiver_info
|
// Show file info, scene: receiver_info
|
||||||
subghz->idx_menu_chosen = subghz_view_receiver_get_idx_menu(subghz->subghz_receiver);
|
subghz->idx_menu_chosen = subghz_view_receiver_get_idx_menu(subghz->subghz_receiver);
|
||||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneReceiverInfo);
|
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneReceiverInfo);
|
||||||
DOLPHIN_DEED(DolphinDeedSubGhzReceiverInfo);
|
dolphin_deed(DolphinDeedSubGhzReceiverInfo);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
break;
|
break;
|
||||||
case SubGhzCustomEventViewReceiverDeleteItem:
|
case SubGhzCustomEventViewReceiverDeleteItem:
|
||||||
|
@ -180,9 +180,9 @@ bool subghz_scene_save_name_on_event(void* context, SceneManagerEvent event) {
|
|||||||
// Ditto, for RAW signals
|
// Ditto, for RAW signals
|
||||||
} else if(scene_manager_has_previous_scene(
|
} else if(scene_manager_has_previous_scene(
|
||||||
subghz->scene_manager, SubGhzSceneSetType)) {
|
subghz->scene_manager, SubGhzSceneSetType)) {
|
||||||
DOLPHIN_DEED(DolphinDeedSubGhzAddManually);
|
dolphin_deed(DolphinDeedSubGhzAddManually);
|
||||||
} else {
|
} else {
|
||||||
DOLPHIN_DEED(DolphinDeedSubGhzSave);
|
dolphin_deed(DolphinDeedSubGhzSave);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -67,7 +67,7 @@ bool subghz_scene_transmitter_on_event(void* context, SceneManagerEvent event) {
|
|||||||
if(subghz_tx_start(subghz, subghz_txrx_get_fff_data(subghz->txrx))) {
|
if(subghz_tx_start(subghz, subghz_txrx_get_fff_data(subghz->txrx))) {
|
||||||
subghz->state_notifications = SubGhzNotificationStateTx;
|
subghz->state_notifications = SubGhzNotificationStateTx;
|
||||||
subghz_scene_transmitter_update_data_show(subghz);
|
subghz_scene_transmitter_update_data_show(subghz);
|
||||||
DOLPHIN_DEED(DolphinDeedSubGhzSend);
|
dolphin_deed(DolphinDeedSubGhzSend);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else if(event.event == SubGhzCustomEventViewTransmitterSendStop) {
|
} else if(event.event == SubGhzCustomEventViewTransmitterSendStop) {
|
||||||
|
@ -68,7 +68,7 @@ bool u2f_scene_main_on_event(void* context, SceneManagerEvent event) {
|
|||||||
notification_message(app->notifications, &sequence_blink_magenta_10);
|
notification_message(app->notifications, &sequence_blink_magenta_10);
|
||||||
} else if(event.event == U2fCustomEventAuthSuccess) {
|
} else if(event.event == U2fCustomEventAuthSuccess) {
|
||||||
notification_message_block(app->notifications, &sequence_set_green_255);
|
notification_message_block(app->notifications, &sequence_set_green_255);
|
||||||
DOLPHIN_DEED(DolphinDeedU2fAuthorized);
|
dolphin_deed(DolphinDeedU2fAuthorized);
|
||||||
furi_timer_start(app->timer, U2F_SUCCESS_TIMEOUT);
|
furi_timer_start(app->timer, U2F_SUCCESS_TIMEOUT);
|
||||||
app->event_cur = U2fCustomEventNone;
|
app->event_cur = U2fCustomEventNone;
|
||||||
u2f_view_set_state(app->u2f_view, U2fMsgSuccess);
|
u2f_view_set_state(app->u2f_view, U2fMsgSuccess);
|
||||||
|
@ -34,13 +34,13 @@ bool desktop_scene_debug_on_event(void* context, SceneManagerEvent event) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case DesktopDebugEventDeed:
|
case DesktopDebugEventDeed:
|
||||||
dolphin_deed(dolphin, DolphinDeedTestRight);
|
dolphin_deed(DolphinDeedTestRight);
|
||||||
desktop_debug_get_dolphin_data(desktop->debug_view);
|
desktop_debug_get_dolphin_data(desktop->debug_view);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DesktopDebugEventWrongDeed:
|
case DesktopDebugEventWrongDeed:
|
||||||
dolphin_deed(dolphin, DolphinDeedTestLeft);
|
dolphin_deed(DolphinDeedTestLeft);
|
||||||
desktop_debug_get_dolphin_data(desktop->debug_view);
|
desktop_debug_get_dolphin_data(desktop->debug_view);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
break;
|
break;
|
||||||
|
@ -13,12 +13,13 @@
|
|||||||
|
|
||||||
static void dolphin_update_clear_limits_timer_period(Dolphin* dolphin);
|
static void dolphin_update_clear_limits_timer_period(Dolphin* dolphin);
|
||||||
|
|
||||||
void dolphin_deed(Dolphin* dolphin, DolphinDeed deed) {
|
void dolphin_deed(DolphinDeed deed) {
|
||||||
furi_assert(dolphin);
|
Dolphin* dolphin = (Dolphin*)furi_record_open(RECORD_DOLPHIN);
|
||||||
DolphinEvent event;
|
DolphinEvent event;
|
||||||
event.type = DolphinEventTypeDeed;
|
event.type = DolphinEventTypeDeed;
|
||||||
event.deed = deed;
|
event.deed = deed;
|
||||||
dolphin_event_send_async(dolphin, &event);
|
dolphin_event_send_async(dolphin, &event);
|
||||||
|
furi_record_close(RECORD_DOLPHIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
DolphinStats dolphin_stats(Dolphin* dolphin) {
|
DolphinStats dolphin_stats(Dolphin* dolphin) {
|
||||||
|
@ -26,18 +26,11 @@ typedef enum {
|
|||||||
DolphinPubsubEventUpdate,
|
DolphinPubsubEventUpdate,
|
||||||
} DolphinPubsubEvent;
|
} DolphinPubsubEvent;
|
||||||
|
|
||||||
#define DOLPHIN_DEED(deed) \
|
|
||||||
do { \
|
|
||||||
Dolphin* dolphin = (Dolphin*)furi_record_open("dolphin"); \
|
|
||||||
dolphin_deed(dolphin, deed); \
|
|
||||||
furi_record_close("dolphin"); \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
/** Deed complete notification. Call it on deed completion.
|
/** Deed complete notification. Call it on deed completion.
|
||||||
* See dolphin_deed.h for available deeds. In futures it will become part of assets.
|
* See dolphin_deed.h for available deeds. In futures it will become part of assets.
|
||||||
* Thread safe, async
|
* Thread safe, async
|
||||||
*/
|
*/
|
||||||
void dolphin_deed(Dolphin* dolphin, DolphinDeed deed);
|
void dolphin_deed(DolphinDeed deed);
|
||||||
|
|
||||||
/** Retrieve dolphin stats
|
/** Retrieve dolphin stats
|
||||||
* Thread safe, blocking
|
* Thread safe, blocking
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
entry,status,name,type,params
|
entry,status,name,type,params
|
||||||
Version,+,29.0,,
|
Version,+,30.0,,
|
||||||
Header,+,applications/services/bt/bt_service/bt.h,,
|
Header,+,applications/services/bt/bt_service/bt.h,,
|
||||||
Header,+,applications/services/cli/cli.h,,
|
Header,+,applications/services/cli/cli.h,,
|
||||||
Header,+,applications/services/cli/cli_vcp.h,,
|
Header,+,applications/services/cli/cli_vcp.h,,
|
||||||
@ -648,7 +648,7 @@ Function,+,dir_walk_read,DirWalkResult,"DirWalk*, FuriString*, FileInfo*"
|
|||||||
Function,+,dir_walk_set_filter_cb,void,"DirWalk*, DirWalkFilterCb, void*"
|
Function,+,dir_walk_set_filter_cb,void,"DirWalk*, DirWalkFilterCb, void*"
|
||||||
Function,+,dir_walk_set_recursive,void,"DirWalk*, _Bool"
|
Function,+,dir_walk_set_recursive,void,"DirWalk*, _Bool"
|
||||||
Function,-,div,div_t,"int, int"
|
Function,-,div,div_t,"int, int"
|
||||||
Function,+,dolphin_deed,void,"Dolphin*, DolphinDeed"
|
Function,+,dolphin_deed,void,DolphinDeed
|
||||||
Function,+,dolphin_deed_get_app,DolphinApp,DolphinDeed
|
Function,+,dolphin_deed_get_app,DolphinApp,DolphinDeed
|
||||||
Function,+,dolphin_deed_get_app_limit,uint8_t,DolphinApp
|
Function,+,dolphin_deed_get_app_limit,uint8_t,DolphinApp
|
||||||
Function,+,dolphin_deed_get_weight,uint8_t,DolphinDeed
|
Function,+,dolphin_deed_get_weight,uint8_t,DolphinDeed
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
entry,status,name,type,params
|
entry,status,name,type,params
|
||||||
Version,+,29.0,,
|
Version,+,30.0,,
|
||||||
Header,+,applications/services/bt/bt_service/bt.h,,
|
Header,+,applications/services/bt/bt_service/bt.h,,
|
||||||
Header,+,applications/services/cli/cli.h,,
|
Header,+,applications/services/cli/cli.h,,
|
||||||
Header,+,applications/services/cli/cli_vcp.h,,
|
Header,+,applications/services/cli/cli_vcp.h,,
|
||||||
@ -787,7 +787,7 @@ Function,+,dir_walk_read,DirWalkResult,"DirWalk*, FuriString*, FileInfo*"
|
|||||||
Function,+,dir_walk_set_filter_cb,void,"DirWalk*, DirWalkFilterCb, void*"
|
Function,+,dir_walk_set_filter_cb,void,"DirWalk*, DirWalkFilterCb, void*"
|
||||||
Function,+,dir_walk_set_recursive,void,"DirWalk*, _Bool"
|
Function,+,dir_walk_set_recursive,void,"DirWalk*, _Bool"
|
||||||
Function,-,div,div_t,"int, int"
|
Function,-,div,div_t,"int, int"
|
||||||
Function,+,dolphin_deed,void,"Dolphin*, DolphinDeed"
|
Function,+,dolphin_deed,void,DolphinDeed
|
||||||
Function,+,dolphin_deed_get_app,DolphinApp,DolphinDeed
|
Function,+,dolphin_deed_get_app,DolphinApp,DolphinDeed
|
||||||
Function,+,dolphin_deed_get_app_limit,uint8_t,DolphinApp
|
Function,+,dolphin_deed_get_app_limit,uint8_t,DolphinApp
|
||||||
Function,+,dolphin_deed_get_weight,uint8_t,DolphinDeed
|
Function,+,dolphin_deed_get_weight,uint8_t,DolphinDeed
|
||||||
|
|
@ -4,6 +4,9 @@
|
|||||||
|
|
||||||
#define TAG "FuriHalMemory"
|
#define TAG "FuriHalMemory"
|
||||||
|
|
||||||
|
// STM(TM) Copro(TM) bug(TM) workaround size
|
||||||
|
#define RAM2B_COPRO_GAP_SIZE_KB 2
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
SRAM_A,
|
SRAM_A,
|
||||||
SRAM_B,
|
SRAM_B,
|
||||||
@ -30,53 +33,47 @@ void furi_hal_memory_init() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!ble_glue_wait_for_c2_start(FURI_HAL_BT_C2_START_TIMEOUT)) {
|
|
||||||
FURI_LOG_E(TAG, "C2 start timeout");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
FuriHalMemory* memory = malloc(sizeof(FuriHalMemory));
|
FuriHalMemory* memory = malloc(sizeof(FuriHalMemory));
|
||||||
|
|
||||||
const BleGlueC2Info* c2_ver = ble_glue_get_c2_info();
|
uint32_t sbrsa = (FLASH->SRRVR & FLASH_SRRVR_SBRSA_Msk) >> FLASH_SRRVR_SBRSA_Pos;
|
||||||
|
uint32_t snbrsa = (FLASH->SRRVR & FLASH_SRRVR_SNBRSA_Msk) >> FLASH_SRRVR_SNBRSA_Pos;
|
||||||
|
|
||||||
if(c2_ver->mode == BleGlueC2ModeStack) {
|
uint32_t sram2a_busy_size = (uint32_t)&__sram2a_free__ - (uint32_t)&__sram2a_start__;
|
||||||
uint32_t sram2a_busy_size = (uint32_t)&__sram2a_free__ - (uint32_t)&__sram2a_start__;
|
uint32_t sram2a_unprotected_size = (sbrsa)*1024;
|
||||||
uint32_t sram2a_unprotected_size = (32 - c2_ver->MemorySizeSram2A) * 1024;
|
uint32_t sram2b_unprotected_size = (snbrsa)*1024;
|
||||||
uint32_t sram2b_unprotected_size = (32 - c2_ver->MemorySizeSram2B) * 1024;
|
|
||||||
|
|
||||||
memory->region[SRAM_A].start = (uint8_t*)&__sram2a_free__;
|
// STM(TM) Copro(TM) bug(TM) workaround
|
||||||
memory->region[SRAM_B].start = (uint8_t*)&__sram2b_start__;
|
sram2b_unprotected_size -= 1024 * RAM2B_COPRO_GAP_SIZE_KB;
|
||||||
|
|
||||||
if(sram2a_unprotected_size > sram2a_busy_size) {
|
memory->region[SRAM_A].start = (uint8_t*)&__sram2a_free__;
|
||||||
memory->region[SRAM_A].size = sram2a_unprotected_size - sram2a_busy_size;
|
memory->region[SRAM_B].start = (uint8_t*)&__sram2b_start__;
|
||||||
} else {
|
|
||||||
memory->region[SRAM_A].size = 0;
|
if(sram2a_unprotected_size > sram2a_busy_size) {
|
||||||
|
memory->region[SRAM_A].size = sram2a_unprotected_size - sram2a_busy_size;
|
||||||
|
} else {
|
||||||
|
memory->region[SRAM_A].size = 0;
|
||||||
|
}
|
||||||
|
memory->region[SRAM_B].size = sram2b_unprotected_size;
|
||||||
|
|
||||||
|
FURI_LOG_I(
|
||||||
|
TAG, "SRAM2A: 0x%p, %lu", memory->region[SRAM_A].start, memory->region[SRAM_A].size);
|
||||||
|
FURI_LOG_I(
|
||||||
|
TAG, "SRAM2B: 0x%p, %lu", memory->region[SRAM_B].start, memory->region[SRAM_B].size);
|
||||||
|
|
||||||
|
if((memory->region[SRAM_A].size > 0) || (memory->region[SRAM_B].size > 0)) {
|
||||||
|
if((memory->region[SRAM_A].size > 0)) {
|
||||||
|
FURI_LOG_I(TAG, "SRAM2A clear");
|
||||||
|
memset(memory->region[SRAM_A].start, 0, memory->region[SRAM_A].size);
|
||||||
}
|
}
|
||||||
memory->region[SRAM_B].size = sram2b_unprotected_size;
|
if((memory->region[SRAM_B].size > 0)) {
|
||||||
|
FURI_LOG_I(TAG, "SRAM2B clear");
|
||||||
FURI_LOG_I(
|
memset(memory->region[SRAM_B].start, 0, memory->region[SRAM_B].size);
|
||||||
TAG, "SRAM2A: 0x%p, %lu", memory->region[SRAM_A].start, memory->region[SRAM_A].size);
|
|
||||||
FURI_LOG_I(
|
|
||||||
TAG, "SRAM2B: 0x%p, %lu", memory->region[SRAM_B].start, memory->region[SRAM_B].size);
|
|
||||||
|
|
||||||
if((memory->region[SRAM_A].size > 0) || (memory->region[SRAM_B].size > 0)) {
|
|
||||||
if((memory->region[SRAM_A].size > 0)) {
|
|
||||||
FURI_LOG_I(TAG, "SRAM2A clear");
|
|
||||||
memset(memory->region[SRAM_A].start, 0, memory->region[SRAM_A].size);
|
|
||||||
}
|
|
||||||
if((memory->region[SRAM_B].size > 0)) {
|
|
||||||
FURI_LOG_I(TAG, "SRAM2B clear");
|
|
||||||
memset(memory->region[SRAM_B].start, 0, memory->region[SRAM_B].size);
|
|
||||||
}
|
|
||||||
furi_hal_memory = memory;
|
|
||||||
FURI_LOG_I(TAG, "Enabled");
|
|
||||||
} else {
|
|
||||||
free(memory);
|
|
||||||
FURI_LOG_E(TAG, "No SRAM2 available");
|
|
||||||
}
|
}
|
||||||
|
furi_hal_memory = memory;
|
||||||
|
FURI_LOG_I(TAG, "Enabled");
|
||||||
} else {
|
} else {
|
||||||
free(memory);
|
free(memory);
|
||||||
FURI_LOG_E(TAG, "No Core2 available");
|
FURI_LOG_E(TAG, "No SRAM2 available");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,15 +86,20 @@ void* furi_hal_memory_alloc(size_t size) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* allocated_memory = NULL;
|
||||||
|
FURI_CRITICAL_ENTER();
|
||||||
for(int i = 0; i < SRAM_MAX; i++) {
|
for(int i = 0; i < SRAM_MAX; i++) {
|
||||||
if(furi_hal_memory->region[i].size >= size) {
|
if(furi_hal_memory->region[i].size >= size) {
|
||||||
void* ptr = furi_hal_memory->region[i].start;
|
void* ptr = furi_hal_memory->region[i].start;
|
||||||
furi_hal_memory->region[i].start += size;
|
furi_hal_memory->region[i].start += size;
|
||||||
furi_hal_memory->region[i].size -= size;
|
furi_hal_memory->region[i].size -= size;
|
||||||
return ptr;
|
allocated_memory = ptr;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NULL;
|
FURI_CRITICAL_EXIT();
|
||||||
|
|
||||||
|
return allocated_memory;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t furi_hal_memory_get_free() {
|
size_t furi_hal_memory_get_free() {
|
||||||
|
@ -56,6 +56,8 @@ static int32_t __furi_thread_stdout_flush(FuriThread* thread);
|
|||||||
|
|
||||||
/** Catch threads that are trying to exit wrong way */
|
/** Catch threads that are trying to exit wrong way */
|
||||||
__attribute__((__noreturn__)) void furi_thread_catch() { //-V1082
|
__attribute__((__noreturn__)) void furi_thread_catch() { //-V1082
|
||||||
|
// If you're here it means you're probably doing something wrong
|
||||||
|
// with critical sections or with scheduler state
|
||||||
asm volatile("nop"); // extra magic
|
asm volatile("nop"); // extra magic
|
||||||
furi_crash("You are doing it wrong"); //-V779
|
furi_crash("You are doing it wrong"); //-V779
|
||||||
__builtin_unreachable();
|
__builtin_unreachable();
|
||||||
|
Loading…
Reference in New Issue
Block a user