Merge branch 'ofw-dev' into dev

This commit is contained in:
MX 2023-06-09 14:13:11 +03:00
commit e9fc5f62a5
No known key found for this signature in database
GPG Key ID: 7CCC66B7DBDD1C83
62 changed files with 135 additions and 137 deletions

View File

@ -414,7 +414,7 @@ int32_t hid_usb_app(void* p) {
bt_hid_connection_status_changed_callback(BtStatusConnected, app);
DOLPHIN_DEED(DolphinDeedPluginStart);
dolphin_deed(DolphinDeedPluginStart);
view_dispatcher_run(app->view_dispatcher);
@ -454,7 +454,7 @@ int32_t hid_ble_app(void* p) {
furi_hal_bt_start_advertising();
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 File

@ -1112,7 +1112,7 @@ void mfkey32(ProgramState* program_state) {
}
if(keyarray_size > 0) {
// TODO: Should we use DolphinDeedNfcMfcAdd?
DOLPHIN_DEED(DolphinDeedNfcMfcAdd);
dolphin_deed(DolphinDeedNfcMfcAdd);
}
napi_mf_classic_nonce_array_free(nonce_arr);
napi_mf_classic_dict_free(user_dict);

View File

@ -19,7 +19,7 @@ void picopass_scene_device_info_on_enter(void* context) {
FuriString* wiegand_str = furi_string_alloc();
FuriString* sio_str = furi_string_alloc();
DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
dolphin_deed(DolphinDeedNfcReadSuccess);
// Setup view
PicopassBlock* AA1 = picopass->dev->dev_data.AA1;

View File

@ -10,7 +10,7 @@ void picopass_read_card_worker_callback(PicopassWorkerEvent event, void* context
void picopass_scene_read_card_on_enter(void* context) {
Picopass* picopass = context;
DOLPHIN_DEED(DolphinDeedNfcRead);
dolphin_deed(DolphinDeedNfcRead);
// Setup view
Popup* popup = picopass->popup;

View File

@ -21,7 +21,7 @@ void picopass_scene_read_card_success_on_enter(void* context) {
FuriString* wiegand_str = furi_string_alloc();
FuriString* sio_str = furi_string_alloc();
DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
dolphin_deed(DolphinDeedNfcReadSuccess);
// Send notification
notification_message(picopass->notifications, &sequence_success);

View File

@ -19,7 +19,7 @@ void picopass_scene_read_factory_success_on_enter(void* context) {
FuriString* title = furi_string_alloc_set("Factory Default");
FuriString* subtitle = furi_string_alloc_set("");
DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
dolphin_deed(DolphinDeedNfcReadSuccess);
// Send notification
notification_message(picopass->notifications, &sequence_success);

View File

@ -8,7 +8,7 @@ void picopass_scene_save_success_popup_callback(void* context) {
void picopass_scene_save_success_on_enter(void* context) {
Picopass* picopass = context;
DOLPHIN_DEED(DolphinDeedNfcSave);
dolphin_deed(DolphinDeedNfcSave);
// Setup view
Popup* popup = picopass->popup;

View File

@ -9,7 +9,7 @@ void picopass_write_card_worker_callback(PicopassWorkerEvent event, void* contex
void picopass_scene_write_card_on_enter(void* context) {
Picopass* picopass = context;
DOLPHIN_DEED(DolphinDeedNfcSave);
dolphin_deed(DolphinDeedNfcSave);
// Setup view
Popup* popup = picopass->popup;

View File

@ -18,7 +18,7 @@ void picopass_scene_write_card_success_on_enter(void* context) {
Widget* widget = picopass->widget;
FuriString* str = furi_string_alloc_set("Write Success!");
DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
dolphin_deed(DolphinDeedNfcReadSuccess);
// Send notification
notification_message(picopass->notifications, &sequence_success);

View File

@ -9,7 +9,7 @@ void picopass_write_key_worker_callback(PicopassWorkerEvent event, void* context
void picopass_scene_write_key_on_enter(void* context) {
Picopass* picopass = context;
DOLPHIN_DEED(DolphinDeedNfcSave);
dolphin_deed(DolphinDeedNfcSave);
// Setup view
Popup* popup = picopass->popup;

View File

@ -344,7 +344,7 @@ int32_t snake_game_app(void* p) {
notification_message_block(notification, &sequence_display_backlight_enforce_on);
DOLPHIN_DEED(DolphinDeedPluginGameStart);
dolphin_deed(DolphinDeedPluginGameStart);
SnakeEvent event;
for(bool processing = true; processing;) {

View File

@ -426,7 +426,7 @@ static int32_t bad_usb_worker(void* context) {
if(flags & WorkerEvtEnd) {
break;
} else if(flags & WorkerEvtStartStop) { // Start executing script
DOLPHIN_DEED(DolphinDeedBadUsbPlayScript);
dolphin_deed(DolphinDeedBadUsbPlayScript);
delay_val = 0;
bad_usb->buf_len = 0;
bad_usb->st.line_cur = 0;
@ -449,7 +449,7 @@ static int32_t bad_usb_worker(void* context) {
if(flags & WorkerEvtEnd) {
break;
} else if(flags & WorkerEvtConnect) { // Start executing script
DOLPHIN_DEED(DolphinDeedBadUsbPlayScript);
dolphin_deed(DolphinDeedBadUsbPlayScript);
delay_val = 0;
bad_usb->buf_len = 0;
bad_usb->st.line_cur = 0;

View File

@ -89,7 +89,7 @@ bool gpio_scene_start_on_event(void* context, SceneManagerEvent event) {
} else if(event.event == GpioStartEventUsbUart) {
scene_manager_set_scene_state(app->scene_manager, GpioSceneStart, GpioItemUsbUart);
if(!furi_hal_usb_is_locked()) {
DOLPHIN_DEED(DolphinDeedGpioUartBridge);
dolphin_deed(DolphinDeedGpioUartBridge);
scene_manager_next_scene(app->scene_manager, GpioSceneUsbUart);
} else {
scene_manager_next_scene(app->scene_manager, GpioSceneUsbUartCloseRpc);

View File

@ -282,14 +282,14 @@ int32_t ibutton_app(void* arg) {
view_dispatcher_attach_to_gui(
ibutton->view_dispatcher, ibutton->gui, ViewDispatcherTypeDesktop);
scene_manager_next_scene(ibutton->scene_manager, iButtonSceneRpc);
DOLPHIN_DEED(DolphinDeedIbuttonEmulate);
dolphin_deed(DolphinDeedIbuttonEmulate);
} else {
view_dispatcher_attach_to_gui(
ibutton->view_dispatcher, ibutton->gui, ViewDispatcherTypeFullscreen);
if(key_loaded) { //-V547
scene_manager_next_scene(ibutton->scene_manager, iButtonSceneEmulate);
DOLPHIN_DEED(DolphinDeedIbuttonEmulate);
dolphin_deed(DolphinDeedIbuttonEmulate);
} else {
scene_manager_next_scene(ibutton->scene_manager, iButtonSceneStart);
}

View File

@ -38,7 +38,7 @@ bool ibutton_scene_read_on_event(void* context, SceneManagerEvent event) {
ibutton_notification_message(ibutton, iButtonNotificationMessageSuccess);
scene_manager_next_scene(scene_manager, iButtonSceneReadSuccess);
DOLPHIN_DEED(DolphinDeedIbuttonReadSuccess);
dolphin_deed(DolphinDeedIbuttonReadSuccess);
} else {
scene_manager_next_scene(scene_manager, iButtonSceneReadError);

View File

@ -75,7 +75,7 @@ bool ibutton_scene_read_key_menu_on_event(void* context, SceneManagerEvent event
scene_manager_next_scene(scene_manager, iButtonSceneSaveName);
} else if(event.event == SubmenuIndexEmulate) {
scene_manager_next_scene(scene_manager, iButtonSceneEmulate);
DOLPHIN_DEED(DolphinDeedIbuttonEmulate);
dolphin_deed(DolphinDeedIbuttonEmulate);
} else if(event.event == SubmenuIndexViewData) {
scene_manager_next_scene(scene_manager, iButtonSceneViewData);
} else if(event.event == SubmenuIndexWriteBlank) {

View File

@ -58,9 +58,9 @@ bool ibutton_scene_save_name_on_event(void* context, SceneManagerEvent event) {
// Nothing, do not count editing as saving
} else if(scene_manager_has_previous_scene(
ibutton->scene_manager, iButtonSceneAddType)) {
DOLPHIN_DEED(DolphinDeedIbuttonAdd);
dolphin_deed(DolphinDeedIbuttonAdd);
} else {
DOLPHIN_DEED(DolphinDeedIbuttonSave);
dolphin_deed(DolphinDeedIbuttonSave);
}
} else {

View File

@ -48,7 +48,7 @@ bool ibutton_scene_saved_key_menu_on_event(void* context, SceneManagerEvent even
consumed = true;
if(event.event == SubmenuIndexEmulate) {
scene_manager_next_scene(scene_manager, iButtonSceneEmulate);
DOLPHIN_DEED(DolphinDeedIbuttonEmulate);
dolphin_deed(DolphinDeedIbuttonEmulate);
} else if(event.event == SubmenuIndexWriteBlank) {
ibutton->write_mode = iButtonWriteModeBlank;
scene_manager_next_scene(scene_manager, iButtonSceneWrite);

View File

@ -33,7 +33,7 @@ bool ibutton_scene_start_on_event(void* context, SceneManagerEvent event) {
consumed = true;
if(event.event == SubmenuIndexRead) {
scene_manager_next_scene(ibutton->scene_manager, iButtonSceneRead);
DOLPHIN_DEED(DolphinDeedIbuttonRead);
dolphin_deed(DolphinDeedIbuttonRead);
} else if(event.event == SubmenuIndexSaved) {
scene_manager_next_scene(ibutton->scene_manager, iButtonSceneSelectKey);
} else if(event.event == SubmenuIndexAdd) {

View File

@ -333,7 +333,7 @@ void infrared_tx_start_signal(Infrared* infrared, InfraredSignal* signal) {
infrared_worker_set_decoded_signal(infrared->worker, message);
}
DOLPHIN_DEED(DolphinDeedIrSend);
dolphin_deed(DolphinDeedIrSend);
infrared_play_notification_message(infrared, InfraredNotificationMessageBlinkStartSend);
infrared_worker_tx_set_get_signal_callback(

View File

@ -70,7 +70,7 @@ bool infrared_scene_universal_common_on_event(void* context, SceneManagerEvent e
uint32_t record_count;
if(infrared_brute_force_start(
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);
} else {
scene_manager_next_scene(scene_manager, InfraredSceneErrorDatabases);

View File

@ -28,7 +28,7 @@ bool infrared_scene_learn_on_event(void* context, SceneManagerEvent event) {
if(event.event == InfraredCustomEventTypeSignalReceived) {
infrared_play_notification_message(infrared, InfraredNotificationMessageSuccess);
scene_manager_next_scene(infrared->scene_manager, InfraredSceneLearnSuccess);
DOLPHIN_DEED(DolphinDeedIrLearnSuccess);
dolphin_deed(DolphinDeedIrLearnSuccess);
consumed = true;
}
}

View File

@ -50,7 +50,7 @@ bool infrared_scene_learn_enter_name_on_event(void* context, SceneManagerEvent e
if(success) {
scene_manager_next_scene(scene_manager, InfraredSceneLearnDone);
DOLPHIN_DEED(DolphinDeedIrSave);
dolphin_deed(DolphinDeedIrSave);
} else {
dialog_message_show_storage_error(infrared->dialogs, "Failed to save file");
const uint32_t possible_scenes[] = {InfraredSceneRemoteList, InfraredSceneStart};

View File

@ -183,7 +183,7 @@ int32_t lfrfid_app(void* p) {
view_dispatcher_attach_to_gui(
app->view_dispatcher, app->gui, ViewDispatcherTypeDesktop);
scene_manager_next_scene(app->scene_manager, LfRfidSceneRpc);
DOLPHIN_DEED(DolphinDeedRfidEmulate);
dolphin_deed(DolphinDeedRfidEmulate);
} else {
furi_string_set(app->file_path, args);
if(lfrfid_load_key_data(app, app->file_path, true)) {

View File

@ -72,12 +72,12 @@ bool lfrfid_scene_extra_actions_on_event(void* context, SceneManagerEvent event)
if(event.event == SubmenuIndexASK) {
app->read_type = LFRFIDWorkerReadTypeASKOnly;
scene_manager_next_scene(app->scene_manager, LfRfidSceneRead);
DOLPHIN_DEED(DolphinDeedRfidRead);
dolphin_deed(DolphinDeedRfidRead);
consumed = true;
} else if(event.event == SubmenuIndexPSK) {
app->read_type = LFRFIDWorkerReadTypePSKOnly;
scene_manager_next_scene(app->scene_manager, LfRfidSceneRead);
DOLPHIN_DEED(DolphinDeedRfidRead);
dolphin_deed(DolphinDeedRfidRead);
consumed = true;
} else if(event.event == SubmenuIndexClearT5577) {
scene_manager_next_scene(app->scene_manager, LfRfidSceneClearT5577Confirm);

View File

@ -81,7 +81,7 @@ bool lfrfid_scene_read_on_event(void* context, SceneManagerEvent event) {
notification_message(app->notifications, &sequence_success);
furi_string_reset(app->file_name);
scene_manager_next_scene(app->scene_manager, LfRfidSceneReadSuccess);
DOLPHIN_DEED(DolphinDeedRfidReadSuccess);
dolphin_deed(DolphinDeedRfidReadSuccess);
consumed = true;
} else if(event.event == LfRfidEventReadStartPSK) {
if(app->read_type == LFRFIDWorkerReadTypeAuto) {

View File

@ -44,7 +44,7 @@ bool lfrfid_scene_read_key_menu_on_event(void* context, SceneManagerEvent event)
consumed = true;
} else if(event.event == SubmenuIndexEmulate) {
scene_manager_next_scene(app->scene_manager, LfRfidSceneEmulate);
DOLPHIN_DEED(DolphinDeedRfidEmulate);
dolphin_deed(DolphinDeedRfidEmulate);
consumed = true;
}
scene_manager_set_scene_state(app->scene_manager, LfRfidSceneReadKeyMenu, event.event);

View File

@ -59,9 +59,9 @@ bool lfrfid_scene_save_name_on_event(void* context, SceneManagerEvent event) {
if(scene_manager_has_previous_scene(scene_manager, LfRfidSceneSavedKeyMenu)) {
// Nothing, do not count editing as saving
} else if(scene_manager_has_previous_scene(scene_manager, LfRfidSceneSaveType)) {
DOLPHIN_DEED(DolphinDeedRfidAdd);
dolphin_deed(DolphinDeedRfidAdd);
} else {
DOLPHIN_DEED(DolphinDeedRfidSave);
dolphin_deed(DolphinDeedRfidSave);
}
} else {
scene_manager_search_and_switch_to_previous_scene(

View File

@ -43,7 +43,7 @@ bool lfrfid_scene_saved_key_menu_on_event(void* context, SceneManagerEvent event
if(event.type == SceneManagerEventTypeCustom) {
if(event.event == SubmenuIndexEmulate) {
scene_manager_next_scene(app->scene_manager, LfRfidSceneEmulate);
DOLPHIN_DEED(DolphinDeedRfidEmulate);
dolphin_deed(DolphinDeedRfidEmulate);
consumed = true;
} else if(event.event == SubmenuIndexWrite) {
scene_manager_next_scene(app->scene_manager, LfRfidSceneWrite);

View File

@ -49,7 +49,7 @@ bool lfrfid_scene_start_on_event(void* context, SceneManagerEvent event) {
if(event.event == SubmenuIndexRead) {
scene_manager_set_scene_state(app->scene_manager, LfRfidSceneStart, SubmenuIndexRead);
scene_manager_next_scene(app->scene_manager, LfRfidSceneRead);
DOLPHIN_DEED(DolphinDeedRfidRead);
dolphin_deed(DolphinDeedRfidRead);
consumed = true;
} else if(event.event == SubmenuIndexSaved) {
// Like in the other apps, explicitly save the scene state

View File

@ -286,16 +286,16 @@ int32_t nfc_app(void* p) {
if(nfc_device_load(nfc->dev, p, true)) {
if(nfc->dev->format == NfcDeviceSaveFormatMifareUl) {
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfUltralightEmulate);
DOLPHIN_DEED(DolphinDeedNfcEmulate);
dolphin_deed(DolphinDeedNfcEmulate);
} else if(nfc->dev->format == NfcDeviceSaveFormatMifareClassic) {
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfClassicEmulate);
DOLPHIN_DEED(DolphinDeedNfcEmulate);
dolphin_deed(DolphinDeedNfcEmulate);
} else if(nfc->dev->format == NfcDeviceSaveFormatNfcV) {
scene_manager_next_scene(nfc->scene_manager, NfcSceneNfcVEmulate);
DOLPHIN_DEED(DolphinDeedNfcEmulate);
} else {
scene_manager_next_scene(nfc->scene_manager, NfcSceneEmulateUid);
DOLPHIN_DEED(DolphinDeedNfcEmulate);
dolphin_deed(DolphinDeedNfcEmulate);
}
} else {
// Exit app

View File

@ -111,7 +111,7 @@ bool nfc_scene_mf_classic_dict_attack_on_event(void* context, SceneManagerEvent
} else {
notification_message(nfc->notifications, &sequence_success);
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfClassicReadSuccess);
DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
dolphin_deed(DolphinDeedNfcReadSuccess);
consumed = true;
}
} 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);
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfClassicReadSuccess);
// Counting failed attempts too
DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
dolphin_deed(DolphinDeedNfcReadSuccess);
consumed = true;
}
} else if(event.event == NfcWorkerEventCardDetected) {

View File

@ -37,7 +37,7 @@ bool nfc_scene_mf_classic_keys_add_on_event(void* context, SceneManagerEvent eve
nfc->scene_manager, NfcSceneMfClassicKeysWarnDuplicate);
} else if(mf_classic_dict_add_key(dict, nfc->byte_input_store)) {
scene_manager_next_scene(nfc->scene_manager, NfcSceneSaveSuccess);
DOLPHIN_DEED(DolphinDeedNfcMfcAdd);
dolphin_deed(DolphinDeedNfcMfcAdd);
} else {
scene_manager_next_scene(nfc->scene_manager, NfcSceneDictNotFound);
}

View File

@ -54,14 +54,14 @@ bool nfc_scene_mf_classic_menu_on_event(void* context, SceneManagerEvent event)
} else if(event.event == SubmenuIndexEmulate) {
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfClassicEmulate);
if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSetType)) {
DOLPHIN_DEED(DolphinDeedNfcAddEmulate);
dolphin_deed(DolphinDeedNfcAddEmulate);
} else {
DOLPHIN_DEED(DolphinDeedNfcEmulate);
dolphin_deed(DolphinDeedNfcEmulate);
}
consumed = true;
} else if(event.event == SubmenuIndexDetectReader) {
scene_manager_next_scene(nfc->scene_manager, NfcSceneDetectReader);
DOLPHIN_DEED(DolphinDeedNfcDetectReader);
dolphin_deed(DolphinDeedNfcDetectReader);
consumed = true;
} else if(event.event == SubmenuIndexInfo) {
scene_manager_next_scene(nfc->scene_manager, NfcSceneNfcDataInfo);

View File

@ -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) {
Nfc* nfc = context;
DOLPHIN_DEED(DolphinDeedNfcEmulate);
dolphin_deed(DolphinDeedNfcEmulate);
scene_manager_set_scene_state(
nfc->scene_manager, NfcSceneMfClassicUpdate, NfcSceneMfClassicUpdateStateCardSearch);

View File

@ -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) {
Nfc* nfc = context;
DOLPHIN_DEED(DolphinDeedNfcSave);
dolphin_deed(DolphinDeedNfcSave);
notification_message(nfc->notifications, &sequence_success);

View File

@ -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) {
Nfc* nfc = context;
DOLPHIN_DEED(DolphinDeedNfcEmulate);
dolphin_deed(DolphinDeedNfcEmulate);
scene_manager_set_scene_state(
nfc->scene_manager, NfcSceneMfClassicWrite, NfcSceneMfClassicWriteStateCardSearch);

View File

@ -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) {
Nfc* nfc = context;
DOLPHIN_DEED(DolphinDeedNfcSave);
dolphin_deed(DolphinDeedNfcSave);
notification_message(nfc->notifications, &sequence_success);

View File

@ -50,9 +50,9 @@ bool nfc_scene_mf_desfire_menu_on_event(void* context, SceneManagerEvent event)
} else if(event.event == SubmenuIndexEmulateUid) {
scene_manager_next_scene(nfc->scene_manager, NfcSceneEmulateUid);
if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSetType)) {
DOLPHIN_DEED(DolphinDeedNfcAddEmulate);
dolphin_deed(DolphinDeedNfcAddEmulate);
} else {
DOLPHIN_DEED(DolphinDeedNfcEmulate);
dolphin_deed(DolphinDeedNfcEmulate);
}
consumed = true;
} else if(event.event == SubmenuIndexInfo) {

View File

@ -60,9 +60,9 @@ bool nfc_scene_mf_ultralight_menu_on_event(void* context, SceneManagerEvent even
} else if(event.event == SubmenuIndexEmulate) {
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfUltralightEmulate);
if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSetType)) {
DOLPHIN_DEED(DolphinDeedNfcAddEmulate);
dolphin_deed(DolphinDeedNfcAddEmulate);
} else {
DOLPHIN_DEED(DolphinDeedNfcEmulate);
dolphin_deed(DolphinDeedNfcEmulate);
}
consumed = true;
} else if(event.event == SubmenuIndexUnlock) {

View File

@ -61,7 +61,7 @@ bool nfc_scene_mf_ultralight_unlock_warn_on_event(void* context, SceneManagerEve
if(event.type == SceneManagerEventTypeCustom) {
if(event.event == DialogExResultRight) {
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfUltralightReadAuth);
DOLPHIN_DEED(DolphinDeedNfcRead);
dolphin_deed(DolphinDeedNfcRead);
consumed = true;
} else if(event.event == DialogExResultLeft) {
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.event == DialogExResultCenter) {
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfUltralightReadAuth);
DOLPHIN_DEED(DolphinDeedNfcRead);
dolphin_deed(DolphinDeedNfcRead);
consumed = true;
}
}

View File

@ -43,9 +43,9 @@ bool nfc_scene_nfca_menu_on_event(void* context, SceneManagerEvent event) {
} else if(event.event == SubmenuIndexEmulateUid) {
scene_manager_next_scene(nfc->scene_manager, NfcSceneEmulateUid);
if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSetType)) {
DOLPHIN_DEED(DolphinDeedNfcAddEmulate);
dolphin_deed(DolphinDeedNfcAddEmulate);
} else {
DOLPHIN_DEED(DolphinDeedNfcEmulate);
dolphin_deed(DolphinDeedNfcEmulate);
}
consumed = true;
} else if(event.event == SubmenuIndexInfo) {

View File

@ -32,7 +32,7 @@ bool nfc_scene_nfcv_key_input_on_event(void* context, SceneManagerEvent event) {
if(event.type == SceneManagerEventTypeCustom) {
if(event.event == NfcCustomEventByteInputDone) {
scene_manager_next_scene(nfc->scene_manager, NfcSceneNfcVUnlock);
DOLPHIN_DEED(DolphinDeedNfcRead);
dolphin_deed(DolphinDeedNfcRead);
consumed = true;
}
}

View File

@ -42,9 +42,9 @@ bool nfc_scene_nfcv_menu_on_event(void* context, SceneManagerEvent event) {
} else if(event.event == SubmenuIndexEmulate) {
scene_manager_next_scene(nfc->scene_manager, NfcSceneNfcVEmulate);
if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSetType)) {
DOLPHIN_DEED(DolphinDeedNfcAddEmulate);
dolphin_deed(DolphinDeedNfcAddEmulate);
} else {
DOLPHIN_DEED(DolphinDeedNfcEmulate);
dolphin_deed(DolphinDeedNfcEmulate);
}
consumed = true;
} else if(event.event == SubmenuIndexInfo) {

View File

@ -76,7 +76,7 @@ void nfc_scene_nfcv_unlock_set_state(Nfc* nfc, NfcSceneNfcVUnlockState state) {
popup_set_timeout(popup, 1500);
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewPopup);
DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
dolphin_deed(DolphinDeedNfcReadSuccess);
} else if(state == NfcSceneNfcVUnlockStateAlreadyUnlocked) {
popup_reset(popup);

View File

@ -45,7 +45,7 @@ bool nfc_scene_nfcv_unlock_menu_on_event(void* context, SceneManagerEvent event)
} else if(event.event == SubmenuIndexNfcVUnlockMenuTonieBox) {
nfc->dev->dev_data.nfcv_data.auth_method = NfcVAuthMethodTonieBox;
scene_manager_next_scene(nfc->scene_manager, NfcSceneNfcVUnlock);
DOLPHIN_DEED(DolphinDeedNfcRead);
dolphin_deed(DolphinDeedNfcRead);
consumed = true;
}
scene_manager_set_scene_state(nfc->scene_manager, NfcSceneNfcVUnlockMenu, event.event);

View File

@ -61,34 +61,34 @@ bool nfc_scene_read_on_event(void* context, SceneManagerEvent event) {
(event.event == NfcWorkerEventReadUidNfcV)) {
notification_message(nfc->notifications, &sequence_success);
scene_manager_next_scene(nfc->scene_manager, NfcSceneReadCardSuccess);
DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
dolphin_deed(DolphinDeedNfcReadSuccess);
consumed = true;
} else if(event.event == NfcWorkerEventReadUidNfcA) {
notification_message(nfc->notifications, &sequence_success);
scene_manager_next_scene(nfc->scene_manager, NfcSceneNfcaReadSuccess);
DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
dolphin_deed(DolphinDeedNfcReadSuccess);
consumed = true;
} else if(event.event == NfcWorkerEventReadNfcV) {
notification_message(nfc->notifications, &sequence_success);
scene_manager_next_scene(nfc->scene_manager, NfcSceneNfcVReadSuccess);
DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
dolphin_deed(DolphinDeedNfcReadSuccess);
consumed = true;
} else if(event.event == NfcWorkerEventReadMfUltralight) {
notification_message(nfc->notifications, &sequence_success);
// Set unlock password input to 0xFFFFFFFF only on fresh read
memset(nfc->byte_input_store, 0xFF, sizeof(nfc->byte_input_store));
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfUltralightReadSuccess);
DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
dolphin_deed(DolphinDeedNfcReadSuccess);
consumed = true;
} else if(event.event == NfcWorkerEventReadMfClassicDone) {
notification_message(nfc->notifications, &sequence_success);
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfClassicReadSuccess);
DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
dolphin_deed(DolphinDeedNfcReadSuccess);
consumed = true;
} else if(event.event == NfcWorkerEventReadMfDesfire) {
notification_message(nfc->notifications, &sequence_success);
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfDesfireReadSuccess);
DOLPHIN_DEED(DolphinDeedNfcReadSuccess);
dolphin_deed(DolphinDeedNfcReadSuccess);
consumed = true;
} else if(event.event == NfcWorkerEventReadBankCard) {
notification_message(nfc->notifications, &sequence_success);

View File

@ -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)) {
// Nothing, do not count editing as saving
} else if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSetType)) {
DOLPHIN_DEED(DolphinDeedNfcAddSave);
dolphin_deed(DolphinDeedNfcAddSave);
} else {
DOLPHIN_DEED(DolphinDeedNfcSave);
dolphin_deed(DolphinDeedNfcSave);
}
consumed = true;
} else {

View File

@ -125,11 +125,11 @@ bool nfc_scene_saved_menu_on_event(void* context, SceneManagerEvent event) {
} else {
scene_manager_next_scene(nfc->scene_manager, NfcSceneEmulateUid);
}
DOLPHIN_DEED(DolphinDeedNfcEmulate);
dolphin_deed(DolphinDeedNfcEmulate);
consumed = true;
} else if(event.event == SubmenuIndexDetectReader) {
scene_manager_next_scene(nfc->scene_manager, NfcSceneDetectReader);
DOLPHIN_DEED(DolphinDeedNfcDetectReader);
dolphin_deed(DolphinDeedNfcDetectReader);
consumed = true;
} else if(event.event == SubmenuIndexWrite) {
scene_manager_next_scene(nfc->scene_manager, NfcSceneMfClassicWrite);

View File

@ -53,7 +53,7 @@ bool nfc_scene_start_on_event(void* context, SceneManagerEvent event) {
scene_manager_set_scene_state(nfc->scene_manager, NfcSceneStart, SubmenuIndexRead);
nfc->dev->dev_data.read_mode = NfcReadModeAuto;
scene_manager_next_scene(nfc->scene_manager, NfcSceneRead);
DOLPHIN_DEED(DolphinDeedNfcRead);
dolphin_deed(DolphinDeedNfcRead);
consumed = true;
} else if(event.event == SubmenuIndexDetectReader) {
scene_manager_set_scene_state(
@ -62,7 +62,7 @@ bool nfc_scene_start_on_event(void* context, SceneManagerEvent event) {
if(sd_exist) {
nfc_device_data_clear(&nfc->dev->dev_data);
scene_manager_next_scene(nfc->scene_manager, NfcSceneDetectReader);
DOLPHIN_DEED(DolphinDeedNfcDetectReader);
dolphin_deed(DolphinDeedNfcDetectReader);
} else {
scene_manager_next_scene(nfc->scene_manager, NfcSceneDictNotFound);
}

View File

@ -213,7 +213,7 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
} else {
if(scene_manager_has_previous_scene(subghz->scene_manager, SubGhzSceneSaved) ||
!scene_manager_has_previous_scene(subghz->scene_manager, SubGhzSceneStart)) {
DOLPHIN_DEED(DolphinDeedSubGhzSend);
dolphin_deed(DolphinDeedSubGhzSend);
}
// set callback end tx
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 {
SubGhzRadioPreset preset = subghz_txrx_get_preset(subghz->txrx);
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->state_notifications = SubGhzNotificationStateRx;
subghz_rx_key_state_set(subghz, SubGhzRxKeyStateAddKey);

View File

@ -223,7 +223,7 @@ bool subghz_scene_receiver_on_event(void* context, SceneManagerEvent event) {
// Show file info, scene: receiver_info
subghz->idx_menu_chosen = subghz_view_receiver_get_idx_menu(subghz->subghz_receiver);
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneReceiverInfo);
DOLPHIN_DEED(DolphinDeedSubGhzReceiverInfo);
dolphin_deed(DolphinDeedSubGhzReceiverInfo);
consumed = true;
break;
case SubGhzCustomEventViewReceiverDeleteItem:

View File

@ -180,9 +180,9 @@ bool subghz_scene_save_name_on_event(void* context, SceneManagerEvent event) {
// Ditto, for RAW signals
} else if(scene_manager_has_previous_scene(
subghz->scene_manager, SubGhzSceneSetType)) {
DOLPHIN_DEED(DolphinDeedSubGhzAddManually);
dolphin_deed(DolphinDeedSubGhzAddManually);
} else {
DOLPHIN_DEED(DolphinDeedSubGhzSave);
dolphin_deed(DolphinDeedSubGhzSave);
}
return true;
} else {

View File

@ -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))) {
subghz->state_notifications = SubGhzNotificationStateTx;
subghz_scene_transmitter_update_data_show(subghz);
DOLPHIN_DEED(DolphinDeedSubGhzSend);
dolphin_deed(DolphinDeedSubGhzSend);
}
return true;
} else if(event.event == SubGhzCustomEventViewTransmitterSendStop) {

View File

@ -68,7 +68,7 @@ bool u2f_scene_main_on_event(void* context, SceneManagerEvent event) {
notification_message(app->notifications, &sequence_blink_magenta_10);
} else if(event.event == U2fCustomEventAuthSuccess) {
notification_message_block(app->notifications, &sequence_set_green_255);
DOLPHIN_DEED(DolphinDeedU2fAuthorized);
dolphin_deed(DolphinDeedU2fAuthorized);
furi_timer_start(app->timer, U2F_SUCCESS_TIMEOUT);
app->event_cur = U2fCustomEventNone;
u2f_view_set_state(app->u2f_view, U2fMsgSuccess);

View File

@ -34,13 +34,13 @@ bool desktop_scene_debug_on_event(void* context, SceneManagerEvent event) {
break;
case DesktopDebugEventDeed:
dolphin_deed(dolphin, DolphinDeedTestRight);
dolphin_deed(DolphinDeedTestRight);
desktop_debug_get_dolphin_data(desktop->debug_view);
consumed = true;
break;
case DesktopDebugEventWrongDeed:
dolphin_deed(dolphin, DolphinDeedTestLeft);
dolphin_deed(DolphinDeedTestLeft);
desktop_debug_get_dolphin_data(desktop->debug_view);
consumed = true;
break;

View File

@ -13,12 +13,13 @@
static void dolphin_update_clear_limits_timer_period(Dolphin* dolphin);
void dolphin_deed(Dolphin* dolphin, DolphinDeed deed) {
furi_assert(dolphin);
void dolphin_deed(DolphinDeed deed) {
Dolphin* dolphin = (Dolphin*)furi_record_open(RECORD_DOLPHIN);
DolphinEvent event;
event.type = DolphinEventTypeDeed;
event.deed = deed;
dolphin_event_send_async(dolphin, &event);
furi_record_close(RECORD_DOLPHIN);
}
DolphinStats dolphin_stats(Dolphin* dolphin) {

View File

@ -26,18 +26,11 @@ typedef enum {
DolphinPubsubEventUpdate,
} 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.
* See dolphin_deed.h for available deeds. In futures it will become part of assets.
* Thread safe, async
*/
void dolphin_deed(Dolphin* dolphin, DolphinDeed deed);
void dolphin_deed(DolphinDeed deed);
/** Retrieve dolphin stats
* Thread safe, blocking

View File

@ -1,5 +1,5 @@
entry,status,name,type,params
Version,+,29.0,,
Version,+,30.0,,
Header,+,applications/services/bt/bt_service/bt.h,,
Header,+,applications/services/cli/cli.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_recursive,void,"DirWalk*, _Bool"
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_limit,uint8_t,DolphinApp
Function,+,dolphin_deed_get_weight,uint8_t,DolphinDeed

1 entry status name type params
2 Version + 29.0 30.0
3 Header + applications/services/bt/bt_service/bt.h
4 Header + applications/services/cli/cli.h
5 Header + applications/services/cli/cli_vcp.h
648 Function + dir_walk_set_filter_cb void DirWalk*, DirWalkFilterCb, void*
649 Function + dir_walk_set_recursive void DirWalk*, _Bool
650 Function - div div_t int, int
651 Function + dolphin_deed void Dolphin*, DolphinDeed DolphinDeed
652 Function + dolphin_deed_get_app DolphinApp DolphinDeed
653 Function + dolphin_deed_get_app_limit uint8_t DolphinApp
654 Function + dolphin_deed_get_weight uint8_t DolphinDeed

View File

@ -1,5 +1,5 @@
entry,status,name,type,params
Version,+,29.0,,
Version,+,30.0,,
Header,+,applications/services/bt/bt_service/bt.h,,
Header,+,applications/services/cli/cli.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_recursive,void,"DirWalk*, _Bool"
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_limit,uint8_t,DolphinApp
Function,+,dolphin_deed_get_weight,uint8_t,DolphinDeed

1 entry status name type params
2 Version + 29.0 30.0
3 Header + applications/services/bt/bt_service/bt.h
4 Header + applications/services/cli/cli.h
5 Header + applications/services/cli/cli_vcp.h
787 Function + dir_walk_set_filter_cb void DirWalk*, DirWalkFilterCb, void*
788 Function + dir_walk_set_recursive void DirWalk*, _Bool
789 Function - div div_t int, int
790 Function + dolphin_deed void Dolphin*, DolphinDeed DolphinDeed
791 Function + dolphin_deed_get_app DolphinApp DolphinDeed
792 Function + dolphin_deed_get_app_limit uint8_t DolphinApp
793 Function + dolphin_deed_get_weight uint8_t DolphinDeed

View File

@ -4,6 +4,9 @@
#define TAG "FuriHalMemory"
// STM(TM) Copro(TM) bug(TM) workaround size
#define RAM2B_COPRO_GAP_SIZE_KB 2
typedef enum {
SRAM_A,
SRAM_B,
@ -30,53 +33,47 @@ void furi_hal_memory_init() {
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));
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_unprotected_size = (32 - c2_ver->MemorySizeSram2A) * 1024;
uint32_t sram2b_unprotected_size = (32 - c2_ver->MemorySizeSram2B) * 1024;
uint32_t sram2a_busy_size = (uint32_t)&__sram2a_free__ - (uint32_t)&__sram2a_start__;
uint32_t sram2a_unprotected_size = (sbrsa)*1024;
uint32_t sram2b_unprotected_size = (snbrsa)*1024;
memory->region[SRAM_A].start = (uint8_t*)&__sram2a_free__;
memory->region[SRAM_B].start = (uint8_t*)&__sram2b_start__;
// STM(TM) Copro(TM) bug(TM) workaround
sram2b_unprotected_size -= 1024 * RAM2B_COPRO_GAP_SIZE_KB;
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_A].start = (uint8_t*)&__sram2a_free__;
memory->region[SRAM_B].start = (uint8_t*)&__sram2b_start__;
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;
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);
}
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");
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 Core2 available");
FURI_LOG_E(TAG, "No SRAM2 available");
}
}
@ -89,15 +86,20 @@ void* furi_hal_memory_alloc(size_t size) {
return NULL;
}
void* allocated_memory = NULL;
FURI_CRITICAL_ENTER();
for(int i = 0; i < SRAM_MAX; i++) {
if(furi_hal_memory->region[i].size >= size) {
void* ptr = furi_hal_memory->region[i].start;
furi_hal_memory->region[i].start += 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() {

View File

@ -56,6 +56,8 @@ static int32_t __furi_thread_stdout_flush(FuriThread* thread);
/** Catch threads that are trying to exit wrong way */
__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
furi_crash("You are doing it wrong"); //-V779
__builtin_unreachable();