Nfc: fix incorrect type castings. Global: fix printf usage, types casting, overall cleanup. Drivers: incorrect array index in cc1101 driver. (#713)

* fix 'function cannot return qualified void/bool type'
* Fix variable 'consumed' is used uninitialized
* Fix format string is not a string literal (potentially insecure)
* Fix conflicting types for 'menu_item_get_type'
* Fix implicit conversion from enumeration type 'NfcDeviceType' to different enumeration type 'rfalNfcDevType'
* Fix hal_gpio_init incorrect arguments order
* Fix nfc->dev.dev_name condition will always evaluate to 'true'
* Fix explicitly assigning value of variable to itself
* Fix furi_hal_bt_wait_startup counter overflow
* Fix implicit conversion from 'StorageStatus' to 'SDError'
* Remove #include <sys/param.h>
* Add FIXME
* Fix syntax
* Fixup for 'furi_hal_bt_wait_startup counter overflow'
* nfc: fix different nfc device types
* Drivers: fix incorrect offset in cc1101_read_fifo
* Remove obsolete comment

Co-authored-by: Tony Freeman <tonyfreeman@users.noreply.github.com>
Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
tonyfreeman 2021-09-21 12:34:16 +03:00 committed by GitHub
parent 9b0aa0d6dc
commit 69f54973cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
63 changed files with 180 additions and 166 deletions

View File

@ -6,7 +6,7 @@ void archive_scene_browser_callback(ArchiveBrowserEvent event, void* context) {
view_dispatcher_send_custom_event(archive->view_dispatcher, event); view_dispatcher_send_custom_event(archive->view_dispatcher, event);
} }
const void archive_scene_browser_on_enter(void* context) { void archive_scene_browser_on_enter(void* context) {
ArchiveApp* archive = (ArchiveApp*)context; ArchiveApp* archive = (ArchiveApp*)context;
ArchiveMainView* main_view = archive->main_view; ArchiveMainView* main_view = archive->main_view;
@ -15,9 +15,9 @@ const void archive_scene_browser_on_enter(void* context) {
view_dispatcher_switch_to_view(archive->view_dispatcher, ArchiveViewBrowser); view_dispatcher_switch_to_view(archive->view_dispatcher, ArchiveViewBrowser);
} }
const bool archive_scene_browser_on_event(void* context, SceneManagerEvent event) { bool archive_scene_browser_on_event(void* context, SceneManagerEvent event) {
ArchiveApp* archive = (ArchiveApp*)context; ArchiveApp* archive = (ArchiveApp*)context;
bool consumed; bool consumed = false;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
switch(event.event) { switch(event.event) {
@ -37,6 +37,6 @@ const bool archive_scene_browser_on_event(void* context, SceneManagerEvent event
return consumed; return consumed;
} }
const void archive_scene_browser_on_exit(void* context) { void archive_scene_browser_on_exit(void* context) {
// ArchiveApp* archive = (ArchiveApp*)context; // ArchiveApp* archive = (ArchiveApp*)context;
} }

View File

@ -9,7 +9,7 @@ void archive_scene_rename_text_input_callback(void* context) {
view_dispatcher_send_custom_event(archive->view_dispatcher, SCENE_RENAME_CUSTOM_EVENT); view_dispatcher_send_custom_event(archive->view_dispatcher, SCENE_RENAME_CUSTOM_EVENT);
} }
const void archive_scene_rename_on_enter(void* context) { void archive_scene_rename_on_enter(void* context) {
ArchiveApp* archive = (ArchiveApp*)context; ArchiveApp* archive = (ArchiveApp*)context;
TextInput* text_input = archive->text_input; TextInput* text_input = archive->text_input;
@ -31,7 +31,7 @@ const void archive_scene_rename_on_enter(void* context) {
view_dispatcher_switch_to_view(archive->view_dispatcher, ArchiveViewTextInput); view_dispatcher_switch_to_view(archive->view_dispatcher, ArchiveViewTextInput);
} }
const bool archive_scene_rename_on_event(void* context, SceneManagerEvent event) { bool archive_scene_rename_on_event(void* context, SceneManagerEvent event) {
ArchiveApp* archive = (ArchiveApp*)context; ArchiveApp* archive = (ArchiveApp*)context;
bool consumed = false; bool consumed = false;
@ -72,7 +72,7 @@ const bool archive_scene_rename_on_event(void* context, SceneManagerEvent event)
return consumed; return consumed;
} }
const void archive_scene_rename_on_exit(void* context) { void archive_scene_rename_on_exit(void* context) {
ArchiveApp* archive = (ArchiveApp*)context; ArchiveApp* archive = (ArchiveApp*)context;
// Clear view // Clear view
text_input_set_header_text(archive->text_input, NULL); text_input_set_header_text(archive->text_input, NULL);

View File

@ -18,7 +18,7 @@ void bt_cli_command_info(Cli* cli, string_t args, void* context) {
string_t buffer; string_t buffer;
string_init(buffer); string_init(buffer);
furi_hal_bt_dump_state(buffer); furi_hal_bt_dump_state(buffer);
printf(string_get_cstr(buffer)); printf("%s", string_get_cstr(buffer));
string_clear(buffer); string_clear(buffer);
} }

View File

@ -276,7 +276,7 @@ static void cli_handle_escape(Cli* cli, char c) {
string_set(cli->line, cli->last_line); string_set(cli->line, cli->last_line);
cli->cursor_position = string_size(cli->line); cli->cursor_position = string_size(cli->line);
// Show new line to user // Show new line to user
printf(string_get_cstr(cli->line)); printf("%s", string_get_cstr(cli->line));
} }
} else if(c == 'B') { } else if(c == 'B') {
} else if(c == 'C') { } else if(c == 'C') {

View File

@ -138,7 +138,7 @@ void cli_command_help(Cli* cli, string_t args, void* context) {
} }
// Right Column // Right Column
if(!CliCommandTree_end_p(it_right)) { if(!CliCommandTree_end_p(it_right)) {
printf(string_get_cstr(*CliCommandTree_ref(it_right)->key_ptr)); printf("%s", string_get_cstr(*CliCommandTree_ref(it_right)->key_ptr));
CliCommandTree_next(it_right); CliCommandTree_next(it_right);
} }
}; };
@ -146,7 +146,7 @@ void cli_command_help(Cli* cli, string_t args, void* context) {
if(string_size(args) > 0) { if(string_size(args) > 0) {
cli_nl(); cli_nl();
printf("Also I have no clue what '"); printf("Also I have no clue what '");
printf(string_get_cstr(args)); printf("%s", string_get_cstr(args));
printf("' is."); printf("' is.");
} }
} }

View File

@ -1,7 +1,6 @@
#include "file_select.h" #include "file_select.h"
#include <gui/elements.h> #include <gui/elements.h>
#include <m-string.h> #include <m-string.h>
#include <sys/param.h>
#include <storage/storage.h> #include <storage/storage.h>
#define FILENAME_COUNT 4 #define FILENAME_COUNT 4

View File

@ -77,7 +77,7 @@ void menu_item_subitem_add(MenuItem* menu_item, MenuItem* sub_item) {
MenuItemArray_push_back(*items, sub_item); MenuItemArray_push_back(*items, sub_item);
} }
uint8_t menu_item_get_type(MenuItem* menu_item) { MenuItemType menu_item_get_type(MenuItem* menu_item) {
furi_assert(menu_item); furi_assert(menu_item);
return menu_item->type; return menu_item->type;
} }

View File

@ -27,7 +27,7 @@ void nfc_cli_detect(Cli* cli, string_t args, void* context) {
if(dev_cnt > 0) { if(dev_cnt > 0) {
printf("Found %d devices\r\n", dev_cnt); printf("Found %d devices\r\n", dev_cnt);
for(uint8_t i = 0; i < dev_cnt; i++) { for(uint8_t i = 0; i < dev_cnt; i++) {
printf("%d found: %s ", i + 1, nfc_get_dev_type(dev_list[i].type)); printf("%d found: %s ", i + 1, nfc_get_rfal_type(dev_list[i].type));
if(dev_list[i].type == RFAL_NFC_LISTEN_TYPE_NFCA) { if(dev_list[i].type == RFAL_NFC_LISTEN_TYPE_NFCA) {
printf("type: %s, ", nfc_get_nfca_type(dev_list[i].dev.nfca.type)); printf("type: %s, ", nfc_get_nfca_type(dev_list[i].dev.nfca.type));
} }

View File

@ -6,19 +6,33 @@
#include <gui/view_dispatcher.h> #include <gui/view_dispatcher.h>
#include "nfc_worker.h" #include "nfc_worker.h"
static inline const char* nfc_get_dev_type(rfalNfcDevType type) { static inline const char* nfc_get_rfal_type(rfalNfcDevType type) {
if(type == RFAL_NFC_LISTEN_TYPE_NFCA) { if(type == RFAL_NFC_LISTEN_TYPE_NFCA) {
return "NFC-A may be:"; return "NFC-A";
} else if(type == RFAL_NFC_LISTEN_TYPE_NFCB) { } else if(type == RFAL_NFC_LISTEN_TYPE_NFCB) {
return "NFC-B may be:"; return "NFC-B";
} else if(type == RFAL_NFC_LISTEN_TYPE_NFCF) { } else if(type == RFAL_NFC_LISTEN_TYPE_NFCF) {
return "NFC-F may be:"; return "NFC-F";
} else if(type == RFAL_NFC_LISTEN_TYPE_NFCV) { } else if(type == RFAL_NFC_LISTEN_TYPE_NFCV) {
return "NFC-V may be:"; return "NFC-V";
} else if(type == RFAL_NFC_LISTEN_TYPE_ST25TB) { } else if(type == RFAL_NFC_LISTEN_TYPE_ST25TB) {
return "NFC-ST25TB may be:"; return "NFC-ST25TB";
} else if(type == RFAL_NFC_LISTEN_TYPE_AP2P) { } else if(type == RFAL_NFC_LISTEN_TYPE_AP2P) {
return "NFC-AP2P may be:"; return "NFC-AP2P";
} else {
return "Unknown";
}
}
static inline const char* nfc_get_dev_type(NfcDeviceType type) {
if(type == NfcDeviceNfca) {
return "NFC-A may be:";
} else if(type == NfcDeviceNfcb) {
return "NFC-B may be:";
} else if(type == NfcDeviceNfcf) {
return "NFC-F may be:";
} else if(type == NfcDeviceNfcv) {
return "NFC-V may be:";
} else { } else {
return "Unknown"; return "Unknown";
} }

View File

@ -13,7 +13,7 @@ void nfc_scene_card_menu_submenu_callback(void* context, uint32_t index) {
view_dispatcher_send_custom_event(nfc->view_dispatcher, index); view_dispatcher_send_custom_event(nfc->view_dispatcher, index);
} }
const void nfc_scene_card_menu_on_enter(void* context) { void nfc_scene_card_menu_on_enter(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
Submenu* submenu = nfc->submenu; Submenu* submenu = nfc->submenu;
@ -41,7 +41,7 @@ const void nfc_scene_card_menu_on_enter(void* context) {
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewMenu); view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewMenu);
} }
const bool nfc_scene_card_menu_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_card_menu_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
@ -78,7 +78,7 @@ const bool nfc_scene_card_menu_on_event(void* context, SceneManagerEvent event)
return false; return false;
} }
const void nfc_scene_card_menu_on_exit(void* context) { void nfc_scene_card_menu_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
submenu_clean(nfc->submenu); submenu_clean(nfc->submenu);

View File

@ -66,7 +66,7 @@ void nfc_scene_delete_on_enter(void* context) {
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewWidget); view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewWidget);
} }
const bool nfc_scene_delete_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_delete_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
@ -85,7 +85,7 @@ const bool nfc_scene_delete_on_event(void* context, SceneManagerEvent event) {
return false; return false;
} }
const void nfc_scene_delete_on_exit(void* context) { void nfc_scene_delete_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
widget_clear(nfc->widget); widget_clear(nfc->widget);

View File

@ -7,7 +7,7 @@ void nfc_scene_delete_success_popup_callback(void* context) {
view_dispatcher_send_custom_event(nfc->view_dispatcher, SCENE_SAVE_SUCCESS_CUSTOM_EVENT); view_dispatcher_send_custom_event(nfc->view_dispatcher, SCENE_SAVE_SUCCESS_CUSTOM_EVENT);
} }
const void nfc_scene_delete_success_on_enter(void* context) { void nfc_scene_delete_success_on_enter(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Setup view // Setup view
@ -21,7 +21,7 @@ const void nfc_scene_delete_success_on_enter(void* context) {
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewPopup); view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewPopup);
} }
const bool nfc_scene_delete_success_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_delete_success_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
@ -33,7 +33,7 @@ const bool nfc_scene_delete_success_on_event(void* context, SceneManagerEvent ev
return false; return false;
} }
const void nfc_scene_delete_success_on_exit(void* context) { void nfc_scene_delete_success_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Clear view // Clear view

View File

@ -127,7 +127,7 @@ void nfc_scene_device_info_on_enter(void* context) {
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewWidget); view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewWidget);
} }
const bool nfc_scene_device_info_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_device_info_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = context; Nfc* nfc = context;
bool consumed = false; bool consumed = false;
uint32_t state = scene_manager_get_scene_state(nfc->scene_manager, NfcSceneDeviceInfo); uint32_t state = scene_manager_get_scene_state(nfc->scene_manager, NfcSceneDeviceInfo);
@ -162,7 +162,7 @@ const bool nfc_scene_device_info_on_event(void* context, SceneManagerEvent event
return consumed; return consumed;
} }
const void nfc_scene_device_info_on_exit(void* context) { void nfc_scene_device_info_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Clear Custom Widget // Clear Custom Widget

View File

@ -1,6 +1,6 @@
#include "../nfc_i.h" #include "../nfc_i.h"
const void nfc_scene_emulate_apdu_sequence_on_enter(void* context) { void nfc_scene_emulate_apdu_sequence_on_enter(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Setup view // Setup view
@ -14,7 +14,7 @@ const void nfc_scene_emulate_apdu_sequence_on_enter(void* context) {
nfc_worker_start(nfc->worker, NfcWorkerStateEmulateApdu, &nfc->dev.dev_data, NULL, nfc); nfc_worker_start(nfc->worker, NfcWorkerStateEmulateApdu, &nfc->dev.dev_data, NULL, nfc);
} }
const bool nfc_scene_emulate_apdu_sequence_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_emulate_apdu_sequence_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
if(event.type == SceneManagerEventTypeTick) { if(event.type == SceneManagerEventTypeTick) {
@ -24,7 +24,7 @@ const bool nfc_scene_emulate_apdu_sequence_on_event(void* context, SceneManagerE
return false; return false;
} }
const void nfc_scene_emulate_apdu_sequence_on_exit(void* context) { void nfc_scene_emulate_apdu_sequence_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Stop worker // Stop worker

View File

@ -9,7 +9,7 @@ void nfc_emulate_mifare_ul_worker_callback(void* context) {
nfc->scene_manager, NfcSceneEmulateMifareUl, NFC_MF_UL_DATA_CHANGED); nfc->scene_manager, NfcSceneEmulateMifareUl, NFC_MF_UL_DATA_CHANGED);
} }
const void nfc_scene_emulate_mifare_ul_on_enter(void* context) { void nfc_scene_emulate_mifare_ul_on_enter(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Setup view // Setup view
@ -30,7 +30,7 @@ const void nfc_scene_emulate_mifare_ul_on_enter(void* context) {
nfc); nfc);
} }
const bool nfc_scene_emulate_mifare_ul_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_emulate_mifare_ul_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
bool consumed = false; bool consumed = false;
@ -52,7 +52,7 @@ const bool nfc_scene_emulate_mifare_ul_on_event(void* context, SceneManagerEvent
return consumed; return consumed;
} }
const void nfc_scene_emulate_mifare_ul_on_exit(void* context) { void nfc_scene_emulate_mifare_ul_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Clear view // Clear view

View File

@ -1,6 +1,6 @@
#include "../nfc_i.h" #include "../nfc_i.h"
const void nfc_scene_emulate_uid_on_enter(void* context) { void nfc_scene_emulate_uid_on_enter(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Setup view // Setup view
@ -35,7 +35,7 @@ const void nfc_scene_emulate_uid_on_enter(void* context) {
nfc_worker_start(nfc->worker, NfcWorkerStateEmulate, &nfc->dev.dev_data, NULL, nfc); nfc_worker_start(nfc->worker, NfcWorkerStateEmulate, &nfc->dev.dev_data, NULL, nfc);
} }
const bool nfc_scene_emulate_uid_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_emulate_uid_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
if(event.type == SceneManagerEventTypeTick) { if(event.type == SceneManagerEventTypeTick) {
@ -45,7 +45,7 @@ const bool nfc_scene_emulate_uid_on_event(void* context, SceneManagerEvent event
return false; return false;
} }
const void nfc_scene_emulate_uid_on_exit(void* context) { void nfc_scene_emulate_uid_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Stop worker // Stop worker

View File

@ -1,6 +1,6 @@
#include "../nfc_i.h" #include "../nfc_i.h"
const void nfc_scene_file_select_on_enter(void* context) { void nfc_scene_file_select_on_enter(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Process file_select return // Process file_select return
if(nfc_file_select(&nfc->dev)) { if(nfc_file_select(&nfc->dev)) {
@ -10,9 +10,9 @@ const void nfc_scene_file_select_on_enter(void* context) {
} }
} }
const bool nfc_scene_file_select_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_file_select_on_event(void* context, SceneManagerEvent event) {
return false; return false;
} }
const void nfc_scene_file_select_on_exit(void* context) { void nfc_scene_file_select_on_exit(void* context) {
} }

View File

@ -11,7 +11,7 @@ void nfc_scene_mifare_ul_menu_submenu_callback(void* context, uint32_t index) {
view_dispatcher_send_custom_event(nfc->view_dispatcher, index); view_dispatcher_send_custom_event(nfc->view_dispatcher, index);
} }
const void nfc_scene_mifare_ul_menu_on_enter(void* context) { void nfc_scene_mifare_ul_menu_on_enter(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
Submenu* submenu = nfc->submenu; Submenu* submenu = nfc->submenu;
@ -25,7 +25,7 @@ const void nfc_scene_mifare_ul_menu_on_enter(void* context) {
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewMenu); view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewMenu);
} }
const bool nfc_scene_mifare_ul_menu_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_mifare_ul_menu_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
@ -49,7 +49,7 @@ const bool nfc_scene_mifare_ul_menu_on_event(void* context, SceneManagerEvent ev
return false; return false;
} }
const void nfc_scene_mifare_ul_menu_on_exit(void* context) { void nfc_scene_mifare_ul_menu_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
submenu_clean(nfc->submenu); submenu_clean(nfc->submenu);

View File

@ -6,7 +6,7 @@ void nfc_scene_not_implemented_dialog_callback(DialogExResult result, void* cont
view_dispatcher_send_custom_event(nfc->view_dispatcher, result); view_dispatcher_send_custom_event(nfc->view_dispatcher, result);
} }
const void nfc_scene_not_implemented_on_enter(void* context) { void nfc_scene_not_implemented_on_enter(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// TODO Set data from worker // TODO Set data from worker
@ -19,7 +19,7 @@ const void nfc_scene_not_implemented_on_enter(void* context) {
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewDialogEx); view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewDialogEx);
} }
const bool nfc_scene_not_implemented_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_not_implemented_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
@ -30,7 +30,7 @@ const bool nfc_scene_not_implemented_on_event(void* context, SceneManagerEvent e
return false; return false;
} }
const void nfc_scene_not_implemented_on_exit(void* context) { void nfc_scene_not_implemented_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
DialogEx* dialog_ex = nfc->dialog_ex; DialogEx* dialog_ex = nfc->dialog_ex;

View File

@ -7,7 +7,7 @@ void nfc_read_card_worker_callback(void* context) {
view_dispatcher_send_custom_event(nfc->view_dispatcher, NFC_READ_CARD_CUSTOM_EVENT); view_dispatcher_send_custom_event(nfc->view_dispatcher, NFC_READ_CARD_CUSTOM_EVENT);
} }
const void nfc_scene_read_card_on_enter(void* context) { void nfc_scene_read_card_on_enter(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Setup view // Setup view
@ -21,7 +21,7 @@ const void nfc_scene_read_card_on_enter(void* context) {
nfc->worker, NfcWorkerStateDetect, &nfc->dev.dev_data, nfc_read_card_worker_callback, nfc); nfc->worker, NfcWorkerStateDetect, &nfc->dev.dev_data, nfc_read_card_worker_callback, nfc);
} }
const bool nfc_scene_read_card_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_read_card_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
@ -36,7 +36,7 @@ const bool nfc_scene_read_card_on_event(void* context, SceneManagerEvent event)
return false; return false;
} }
const void nfc_scene_read_card_on_exit(void* context) { void nfc_scene_read_card_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Stop worker // Stop worker

View File

@ -63,7 +63,7 @@ void nfc_scene_read_card_success_on_enter(void* context) {
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewDialogEx); view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewDialogEx);
} }
const bool nfc_scene_read_card_success_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_read_card_success_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
@ -77,7 +77,7 @@ const bool nfc_scene_read_card_success_on_event(void* context, SceneManagerEvent
return false; return false;
} }
const void nfc_scene_read_card_success_on_exit(void* context) { void nfc_scene_read_card_success_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
DialogEx* dialog_ex = nfc->dialog_ex; DialogEx* dialog_ex = nfc->dialog_ex;

View File

@ -7,7 +7,7 @@ void nfc_read_emv_app_worker_callback(void* context) {
view_dispatcher_send_custom_event(nfc->view_dispatcher, NFC_READ_EMV_APP_CUSTOM_EVENT); view_dispatcher_send_custom_event(nfc->view_dispatcher, NFC_READ_EMV_APP_CUSTOM_EVENT);
} }
const void nfc_scene_read_emv_app_on_enter(void* context) { void nfc_scene_read_emv_app_on_enter(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Setup view // Setup view
@ -25,7 +25,7 @@ const void nfc_scene_read_emv_app_on_enter(void* context) {
nfc); nfc);
} }
const bool nfc_scene_read_emv_app_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_read_emv_app_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
@ -40,7 +40,7 @@ const bool nfc_scene_read_emv_app_on_event(void* context, SceneManagerEvent even
return false; return false;
} }
const void nfc_scene_read_emv_app_on_exit(void* context) { void nfc_scene_read_emv_app_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Stop worker // Stop worker

View File

@ -45,7 +45,7 @@ void nfc_scene_read_emv_app_success_on_enter(void* context) {
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewDialogEx); view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewDialogEx);
} }
const bool nfc_scene_read_emv_app_success_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_read_emv_app_success_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
@ -59,7 +59,7 @@ const bool nfc_scene_read_emv_app_success_on_event(void* context, SceneManagerEv
return false; return false;
} }
const void nfc_scene_read_emv_app_success_on_exit(void* context) { void nfc_scene_read_emv_app_success_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
DialogEx* dialog_ex = nfc->dialog_ex; DialogEx* dialog_ex = nfc->dialog_ex;

View File

@ -7,7 +7,7 @@ void nfc_read_emv_data_worker_callback(void* context) {
view_dispatcher_send_custom_event(nfc->view_dispatcher, NFC_READ_EMV_DATA_CUSTOM_EVENT); view_dispatcher_send_custom_event(nfc->view_dispatcher, NFC_READ_EMV_DATA_CUSTOM_EVENT);
} }
const void nfc_scene_read_emv_data_on_enter(void* context) { void nfc_scene_read_emv_data_on_enter(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Setup view // Setup view
@ -27,7 +27,7 @@ const void nfc_scene_read_emv_data_on_enter(void* context) {
nfc); nfc);
} }
const bool nfc_scene_read_emv_data_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_read_emv_data_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
@ -42,7 +42,7 @@ const bool nfc_scene_read_emv_data_on_event(void* context, SceneManagerEvent eve
return false; return false;
} }
const void nfc_scene_read_emv_data_on_exit(void* context) { void nfc_scene_read_emv_data_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Stop worker // Stop worker

View File

@ -113,7 +113,7 @@ void nfc_scene_read_emv_data_success_on_enter(void* context) {
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewWidget); view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewWidget);
} }
const bool nfc_scene_read_emv_data_success_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_read_emv_data_success_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
@ -132,7 +132,7 @@ const bool nfc_scene_read_emv_data_success_on_event(void* context, SceneManagerE
return false; return false;
} }
const void nfc_scene_read_emv_data_success_on_exit(void* context) { void nfc_scene_read_emv_data_success_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
widget_clear(nfc->widget); widget_clear(nfc->widget);

View File

@ -7,7 +7,7 @@ void nfc_read_mifare_ul_worker_callback(void* context) {
view_dispatcher_send_custom_event(nfc->view_dispatcher, NFC_READ_MIFARE_UL_CUSTOM_EVENT); view_dispatcher_send_custom_event(nfc->view_dispatcher, NFC_READ_MIFARE_UL_CUSTOM_EVENT);
} }
const void nfc_scene_read_mifare_ul_on_enter(void* context) { void nfc_scene_read_mifare_ul_on_enter(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Setup view // Setup view
@ -25,7 +25,7 @@ const void nfc_scene_read_mifare_ul_on_enter(void* context) {
nfc); nfc);
} }
const bool nfc_scene_read_mifare_ul_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_read_mifare_ul_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
@ -40,7 +40,7 @@ const bool nfc_scene_read_mifare_ul_on_event(void* context, SceneManagerEvent ev
return false; return false;
} }
const void nfc_scene_read_mifare_ul_on_exit(void* context) { void nfc_scene_read_mifare_ul_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Stop worker // Stop worker

View File

@ -20,7 +20,7 @@ void nfc_scene_read_mifare_ul_success_text_box_callback(void* context) {
view_dispatcher_send_custom_event(nfc->view_dispatcher, NFC_SCENE_READ_MF_UL_CUSTOM_EVENT); view_dispatcher_send_custom_event(nfc->view_dispatcher, NFC_SCENE_READ_MF_UL_CUSTOM_EVENT);
} }
const void nfc_scene_read_mifare_ul_success_on_enter(void* context) { void nfc_scene_read_mifare_ul_success_on_enter(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Clear device name // Clear device name
@ -76,7 +76,7 @@ const void nfc_scene_read_mifare_ul_success_on_enter(void* context) {
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewDialogEx); view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewDialogEx);
} }
const bool nfc_scene_read_mifare_ul_success_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_read_mifare_ul_success_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
@ -112,7 +112,7 @@ const bool nfc_scene_read_mifare_ul_success_on_event(void* context, SceneManager
return false; return false;
} }
const void nfc_scene_read_mifare_ul_success_on_exit(void* context) { void nfc_scene_read_mifare_ul_success_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Clean dialog // Clean dialog

View File

@ -7,7 +7,7 @@ void nfc_scene_restore_original_popup_callback(void* context) {
view_dispatcher_send_custom_event(nfc->view_dispatcher, SCENE_RESTORE_ORIGINAL_CUSTOM_EVENT); view_dispatcher_send_custom_event(nfc->view_dispatcher, SCENE_RESTORE_ORIGINAL_CUSTOM_EVENT);
} }
const void nfc_scene_restore_original_on_enter(void* context) { void nfc_scene_restore_original_on_enter(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Setup view // Setup view
@ -21,7 +21,7 @@ const void nfc_scene_restore_original_on_enter(void* context) {
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewPopup); view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewPopup);
} }
const bool nfc_scene_restore_original_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_restore_original_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
bool consumed = false; bool consumed = false;
@ -33,7 +33,7 @@ const bool nfc_scene_restore_original_on_event(void* context, SceneManagerEvent
return consumed; return consumed;
} }
const void nfc_scene_restore_original_on_exit(void* context) { void nfc_scene_restore_original_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Clear view // Clear view

View File

@ -28,7 +28,7 @@ void nfc_scene_run_emv_app_confirm_on_enter(void* context) {
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewDialogEx); view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewDialogEx);
} }
const bool nfc_scene_run_emv_app_confirm_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_run_emv_app_confirm_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
@ -42,7 +42,7 @@ const bool nfc_scene_run_emv_app_confirm_on_event(void* context, SceneManagerEve
return false; return false;
} }
const void nfc_scene_run_emv_app_confirm_on_exit(void* context) { void nfc_scene_run_emv_app_confirm_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
DialogEx* dialog_ex = nfc->dialog_ex; DialogEx* dialog_ex = nfc->dialog_ex;

View File

@ -9,7 +9,7 @@ void nfc_scene_save_name_text_input_callback(void* context) {
view_dispatcher_send_custom_event(nfc->view_dispatcher, SCENE_SAVE_NAME_CUSTOM_EVENT); view_dispatcher_send_custom_event(nfc->view_dispatcher, SCENE_SAVE_NAME_CUSTOM_EVENT);
} }
const void nfc_scene_save_name_on_enter(void* context) { void nfc_scene_save_name_on_enter(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Setup view // Setup view
@ -32,12 +32,12 @@ const void nfc_scene_save_name_on_enter(void* context) {
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewTextInput); view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewTextInput);
} }
const bool nfc_scene_save_name_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_save_name_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
if(event.event == SCENE_SAVE_NAME_CUSTOM_EVENT) { if(event.event == SCENE_SAVE_NAME_CUSTOM_EVENT) {
if(nfc->dev.dev_name) { if(strcmp(nfc->dev.dev_name, "")) {
nfc_device_delete(&nfc->dev); nfc_device_delete(&nfc->dev);
} }
if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSetUid)) { if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSetUid)) {
@ -56,7 +56,7 @@ const bool nfc_scene_save_name_on_event(void* context, SceneManagerEvent event)
return false; return false;
} }
const void nfc_scene_save_name_on_exit(void* context) { void nfc_scene_save_name_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Clear view // Clear view

View File

@ -7,7 +7,7 @@ void nfc_scene_save_success_popup_callback(void* context) {
view_dispatcher_send_custom_event(nfc->view_dispatcher, SCENE_SAVE_SUCCESS_CUSTOM_EVENT); view_dispatcher_send_custom_event(nfc->view_dispatcher, SCENE_SAVE_SUCCESS_CUSTOM_EVENT);
} }
const void nfc_scene_save_success_on_enter(void* context) { void nfc_scene_save_success_on_enter(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Setup view // Setup view
@ -21,7 +21,7 @@ const void nfc_scene_save_success_on_enter(void* context) {
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewPopup); view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewPopup);
} }
const bool nfc_scene_save_success_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_save_success_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
bool consumed = false; bool consumed = false;
@ -42,7 +42,7 @@ const bool nfc_scene_save_success_on_event(void* context, SceneManagerEvent even
return consumed; return consumed;
} }
const void nfc_scene_save_success_on_exit(void* context) { void nfc_scene_save_success_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Clear view // Clear view

View File

@ -14,7 +14,7 @@ void nfc_scene_saved_menu_submenu_callback(void* context, uint32_t index) {
view_dispatcher_send_custom_event(nfc->view_dispatcher, index); view_dispatcher_send_custom_event(nfc->view_dispatcher, index);
} }
const void nfc_scene_saved_menu_on_enter(void* context) { void nfc_scene_saved_menu_on_enter(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
Submenu* submenu = nfc->submenu; Submenu* submenu = nfc->submenu;
@ -42,7 +42,7 @@ const void nfc_scene_saved_menu_on_enter(void* context) {
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewMenu); view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewMenu);
} }
const bool nfc_scene_saved_menu_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_saved_menu_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
bool consumed = false; bool consumed = false;
@ -78,7 +78,7 @@ const bool nfc_scene_saved_menu_on_event(void* context, SceneManagerEvent event)
return consumed; return consumed;
} }
const void nfc_scene_saved_menu_on_exit(void* context) { void nfc_scene_saved_menu_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
submenu_clean(nfc->submenu); submenu_clean(nfc->submenu);

View File

@ -11,7 +11,7 @@ void nfc_scene_scripts_menu_submenu_callback(void* context, uint32_t index) {
view_dispatcher_send_custom_event(nfc->view_dispatcher, index); view_dispatcher_send_custom_event(nfc->view_dispatcher, index);
} }
const void nfc_scene_scripts_menu_on_enter(void* context) { void nfc_scene_scripts_menu_on_enter(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
Submenu* submenu = nfc->submenu; Submenu* submenu = nfc->submenu;
@ -32,7 +32,7 @@ const void nfc_scene_scripts_menu_on_enter(void* context) {
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewMenu); view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewMenu);
} }
const bool nfc_scene_scripts_menu_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_scripts_menu_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
@ -52,7 +52,7 @@ const bool nfc_scene_scripts_menu_on_event(void* context, SceneManagerEvent even
return false; return false;
} }
const void nfc_scene_scripts_menu_on_exit(void* context) { void nfc_scene_scripts_menu_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
submenu_clean(nfc->submenu); submenu_clean(nfc->submenu);

View File

@ -8,7 +8,7 @@ void nfc_scene_set_atqa_byte_input_callback(void* context) {
view_dispatcher_send_custom_event(nfc->view_dispatcher, SCENE_SET_ATQA_CUSTOM_EVENT); view_dispatcher_send_custom_event(nfc->view_dispatcher, SCENE_SET_ATQA_CUSTOM_EVENT);
} }
const void nfc_scene_set_atqa_on_enter(void* context) { void nfc_scene_set_atqa_on_enter(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Setup view // Setup view
@ -24,7 +24,7 @@ const void nfc_scene_set_atqa_on_enter(void* context) {
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewByteInput); view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewByteInput);
} }
const bool nfc_scene_set_atqa_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_set_atqa_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
@ -36,7 +36,7 @@ const bool nfc_scene_set_atqa_on_event(void* context, SceneManagerEvent event) {
return false; return false;
} }
const void nfc_scene_set_atqa_on_exit(void* context) { void nfc_scene_set_atqa_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Clear view // Clear view

View File

@ -8,7 +8,7 @@ void nfc_scene_set_sak_byte_input_callback(void* context) {
view_dispatcher_send_custom_event(nfc->view_dispatcher, SCENE_SET_SAK_CUSTOM_EVENT); view_dispatcher_send_custom_event(nfc->view_dispatcher, SCENE_SET_SAK_CUSTOM_EVENT);
} }
const void nfc_scene_set_sak_on_enter(void* context) { void nfc_scene_set_sak_on_enter(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Setup view // Setup view
@ -24,7 +24,7 @@ const void nfc_scene_set_sak_on_enter(void* context) {
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewByteInput); view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewByteInput);
} }
const bool nfc_scene_set_sak_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_set_sak_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
@ -36,7 +36,7 @@ const bool nfc_scene_set_sak_on_event(void* context, SceneManagerEvent event) {
return false; return false;
} }
const void nfc_scene_set_sak_on_exit(void* context) { void nfc_scene_set_sak_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Clear view // Clear view

View File

@ -11,7 +11,7 @@ void nfc_scene_set_type_submenu_callback(void* context, uint32_t index) {
view_dispatcher_send_custom_event(nfc->view_dispatcher, index); view_dispatcher_send_custom_event(nfc->view_dispatcher, index);
} }
const void nfc_scene_set_type_on_enter(void* context) { void nfc_scene_set_type_on_enter(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
Submenu* submenu = nfc->submenu; Submenu* submenu = nfc->submenu;
@ -22,7 +22,7 @@ const void nfc_scene_set_type_on_enter(void* context) {
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewMenu); view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewMenu);
} }
const bool nfc_scene_set_type_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_set_type_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
@ -41,7 +41,7 @@ const bool nfc_scene_set_type_on_event(void* context, SceneManagerEvent event) {
return false; return false;
} }
const void nfc_scene_set_type_on_exit(void* context) { void nfc_scene_set_type_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
submenu_clean(nfc->submenu); submenu_clean(nfc->submenu);

View File

@ -8,7 +8,7 @@ void nfc_scene_set_uid_byte_input_callback(void* context) {
view_dispatcher_send_custom_event(nfc->view_dispatcher, SCENE_SET_UID_CUSTOM_EVENT); view_dispatcher_send_custom_event(nfc->view_dispatcher, SCENE_SET_UID_CUSTOM_EVENT);
} }
const void nfc_scene_set_uid_on_enter(void* context) { void nfc_scene_set_uid_on_enter(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Setup view // Setup view
@ -25,7 +25,7 @@ const void nfc_scene_set_uid_on_enter(void* context) {
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewByteInput); view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewByteInput);
} }
const bool nfc_scene_set_uid_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_set_uid_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
@ -37,7 +37,7 @@ const bool nfc_scene_set_uid_on_event(void* context, SceneManagerEvent event) {
return false; return false;
} }
const void nfc_scene_set_uid_on_exit(void* context) { void nfc_scene_set_uid_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
// Clear view // Clear view

View File

@ -14,7 +14,7 @@ void nfc_scene_start_submenu_callback(void* context, uint32_t index) {
view_dispatcher_send_custom_event(nfc->view_dispatcher, index); view_dispatcher_send_custom_event(nfc->view_dispatcher, index);
} }
const void nfc_scene_start_on_enter(void* context) { void nfc_scene_start_on_enter(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
Submenu* submenu = nfc->submenu; Submenu* submenu = nfc->submenu;
@ -38,7 +38,7 @@ const void nfc_scene_start_on_enter(void* context) {
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewMenu); view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewMenu);
} }
const bool nfc_scene_start_on_event(void* context, SceneManagerEvent event) { bool nfc_scene_start_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
bool consumed = false; bool consumed = false;
@ -70,7 +70,7 @@ const bool nfc_scene_start_on_event(void* context, SceneManagerEvent event) {
return consumed; return consumed;
} }
const void nfc_scene_start_on_exit(void* context) { void nfc_scene_start_on_exit(void* context) {
Nfc* nfc = (Nfc*)context; Nfc* nfc = (Nfc*)context;
submenu_clean(nfc->submenu); submenu_clean(nfc->submenu);

View File

@ -99,7 +99,8 @@ FS_Error sd_unmount_card(StorageData* storage) {
SDError error; SDError error;
storage_data_lock(storage); storage_data_lock(storage);
error = storage->status = StorageStatusNotReady; storage->status = StorageStatusNotReady;
error = FR_DISK_ERR;
// TODO do i need to close the files? // TODO do i need to close the files?

View File

@ -286,7 +286,7 @@ static bool storage_int_file_open(
if(access_mode & FSAM_READ) flags |= LFS_O_RDONLY; if(access_mode & FSAM_READ) flags |= LFS_O_RDONLY;
if(access_mode & FSAM_WRITE) flags |= LFS_O_WRONLY; if(access_mode & FSAM_WRITE) flags |= LFS_O_WRONLY;
if(open_mode & FSOM_OPEN_EXISTING) flags = flags; if(open_mode & FSOM_OPEN_EXISTING) flags |= 0;
if(open_mode & FSOM_OPEN_ALWAYS) flags |= LFS_O_CREAT; if(open_mode & FSOM_OPEN_ALWAYS) flags |= LFS_O_CREAT;
if(open_mode & FSOM_OPEN_APPEND) flags |= LFS_O_CREAT | LFS_O_APPEND; if(open_mode & FSOM_OPEN_APPEND) flags |= LFS_O_CREAT | LFS_O_APPEND;
if(open_mode & FSOM_CREATE_NEW) flags |= LFS_O_CREAT | LFS_O_EXCL; if(open_mode & FSOM_CREATE_NEW) flags |= LFS_O_CREAT | LFS_O_EXCL;

View File

@ -60,7 +60,7 @@ void subghz_scene_add_to_history_callback(SubGhzProtocolCommon* parser, void* co
string_clear(str_buff); string_clear(str_buff);
} }
const void subghz_scene_receiver_on_enter(void* context) { void subghz_scene_receiver_on_enter(void* context) {
SubGhz* subghz = context; SubGhz* subghz = context;
string_t str_buff; string_t str_buff;
@ -95,7 +95,7 @@ const void subghz_scene_receiver_on_enter(void* context) {
view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewReceiver); view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewReceiver);
} }
const bool subghz_scene_receiver_on_event(void* context, SceneManagerEvent event) { bool subghz_scene_receiver_on_event(void* context, SceneManagerEvent event) {
SubGhz* subghz = context; SubGhz* subghz = context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
@ -147,6 +147,6 @@ const bool subghz_scene_receiver_on_event(void* context, SceneManagerEvent event
return false; return false;
} }
const void subghz_scene_receiver_on_exit(void* context) { void subghz_scene_receiver_on_exit(void* context) {
// SubGhz* subghz = context; // SubGhz* subghz = context;
} }

View File

@ -102,7 +102,7 @@ void subghz_scene_receiver_config_callback(SubghzReceverEvent event, void* conte
view_dispatcher_send_custom_event(subghz->view_dispatcher, event); view_dispatcher_send_custom_event(subghz->view_dispatcher, event);
} }
const void subghz_scene_receiver_config_on_enter(void* context) { void subghz_scene_receiver_config_on_enter(void* context) {
SubGhz* subghz = context; SubGhz* subghz = context;
VariableItem* item; VariableItem* item;
uint8_t value_index; uint8_t value_index;
@ -145,12 +145,12 @@ const void subghz_scene_receiver_config_on_enter(void* context) {
view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewVariableItemList); view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewVariableItemList);
} }
const bool subghz_scene_receiver_config_on_event(void* context, SceneManagerEvent event) { bool subghz_scene_receiver_config_on_event(void* context, SceneManagerEvent event) {
//SubGhz* subghz = context; //SubGhz* subghz = context;
return false; return false;
} }
const void subghz_scene_receiver_config_on_exit(void* context) { void subghz_scene_receiver_config_on_exit(void* context) {
SubGhz* subghz = context; SubGhz* subghz = context;
variable_item_list_clean(subghz->variable_item_list); variable_item_list_clean(subghz->variable_item_list);
} }

View File

@ -41,7 +41,7 @@ static bool subghz_scene_receiver_info_update_parser(void* context) {
return false; return false;
} }
const void subghz_scene_receiver_info_on_enter(void* context) { void subghz_scene_receiver_info_on_enter(void* context) {
SubGhz* subghz = context; SubGhz* subghz = context;
if(subghz_scene_receiver_info_update_parser(subghz)) { if(subghz_scene_receiver_info_update_parser(subghz)) {
@ -96,7 +96,7 @@ const void subghz_scene_receiver_info_on_enter(void* context) {
view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewWidget); view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewWidget);
} }
const bool subghz_scene_receiver_info_on_event(void* context, SceneManagerEvent event) { bool subghz_scene_receiver_info_on_event(void* context, SceneManagerEvent event) {
SubGhz* subghz = context; SubGhz* subghz = context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
if(event.event == SubGhzSceneReceiverInfoCustomEventTxStart) { if(event.event == SubGhzSceneReceiverInfoCustomEventTxStart) {
@ -167,7 +167,7 @@ const bool subghz_scene_receiver_info_on_event(void* context, SceneManagerEvent
return false; return false;
} }
const void subghz_scene_receiver_info_on_exit(void* context) { void subghz_scene_receiver_info_on_exit(void* context) {
SubGhz* subghz = context; SubGhz* subghz = context;
widget_clear(subghz->widget); widget_clear(subghz->widget);
} }

View File

@ -9,7 +9,7 @@ void subghz_scene_save_name_text_input_callback(void* context) {
view_dispatcher_send_custom_event(subghz->view_dispatcher, SCENE_SAVE_NAME_CUSTOM_EVENT); view_dispatcher_send_custom_event(subghz->view_dispatcher, SCENE_SAVE_NAME_CUSTOM_EVENT);
} }
const void subghz_scene_save_name_on_enter(void* context) { void subghz_scene_save_name_on_enter(void* context) {
SubGhz* subghz = context; SubGhz* subghz = context;
// Setup view // Setup view
@ -30,7 +30,7 @@ const void subghz_scene_save_name_on_enter(void* context) {
view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewTextInput); view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewTextInput);
} }
const bool subghz_scene_save_name_on_event(void* context, SceneManagerEvent event) { bool subghz_scene_save_name_on_event(void* context, SceneManagerEvent event) {
SubGhz* subghz = context; SubGhz* subghz = context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
@ -49,7 +49,7 @@ const bool subghz_scene_save_name_on_event(void* context, SceneManagerEvent even
return false; return false;
} }
const void subghz_scene_save_name_on_exit(void* context) { void subghz_scene_save_name_on_exit(void* context) {
SubGhz* subghz = context; SubGhz* subghz = context;
// Clear view // Clear view

View File

@ -7,7 +7,7 @@ void subghz_scene_save_success_popup_callback(void* context) {
view_dispatcher_send_custom_event(subghz->view_dispatcher, SCENE_SAVE_SUCCESS_CUSTOM_EVENT); view_dispatcher_send_custom_event(subghz->view_dispatcher, SCENE_SAVE_SUCCESS_CUSTOM_EVENT);
} }
const void subghz_scene_save_success_on_enter(void* context) { void subghz_scene_save_success_on_enter(void* context) {
SubGhz* subghz = context; SubGhz* subghz = context;
// Setup view // Setup view
@ -21,7 +21,7 @@ const void subghz_scene_save_success_on_enter(void* context) {
view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewPopup); view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewPopup);
} }
const bool subghz_scene_save_success_on_event(void* context, SceneManagerEvent event) { bool subghz_scene_save_success_on_event(void* context, SceneManagerEvent event) {
SubGhz* subghz = context; SubGhz* subghz = context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
if(event.event == SCENE_SAVE_SUCCESS_CUSTOM_EVENT) { if(event.event == SCENE_SAVE_SUCCESS_CUSTOM_EVENT) {
@ -36,7 +36,7 @@ const bool subghz_scene_save_success_on_event(void* context, SceneManagerEvent e
return false; return false;
} }
const void subghz_scene_save_success_on_exit(void* context) { void subghz_scene_save_success_on_exit(void* context) {
SubGhz* subghz = context; SubGhz* subghz = context;
// Clear view // Clear view

View File

@ -1,6 +1,6 @@
#include "../subghz_i.h" #include "../subghz_i.h"
const void subghz_scene_saved_on_enter(void* context) { void subghz_scene_saved_on_enter(void* context) {
SubGhz* subghz = context; SubGhz* subghz = context;
if(subghz_load_protocol_from_file(subghz)) { if(subghz_load_protocol_from_file(subghz)) {
@ -10,11 +10,11 @@ const void subghz_scene_saved_on_enter(void* context) {
} }
} }
const bool subghz_scene_saved_on_event(void* context, SceneManagerEvent event) { bool subghz_scene_saved_on_event(void* context, SceneManagerEvent event) {
// SubGhz* subghz = context; // SubGhz* subghz = context;
return false; return false;
} }
const void subghz_scene_saved_on_exit(void* context) { void subghz_scene_saved_on_exit(void* context) {
// SubGhz* subghz = context; // SubGhz* subghz = context;
} }

View File

@ -29,7 +29,7 @@ void subghz_scene_set_type_submenu_callback(void* context, uint32_t index) {
view_dispatcher_send_custom_event(subghz->view_dispatcher, index); view_dispatcher_send_custom_event(subghz->view_dispatcher, index);
} }
const void subghz_scene_set_type_on_enter(void* context) { void subghz_scene_set_type_on_enter(void* context) {
SubGhz* subghz = context; SubGhz* subghz = context;
submenu_add_item( submenu_add_item(
@ -85,7 +85,7 @@ const void subghz_scene_set_type_on_enter(void* context) {
view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewMenu); view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewMenu);
} }
const bool subghz_scene_set_type_on_event(void* context, SceneManagerEvent event) { bool subghz_scene_set_type_on_event(void* context, SceneManagerEvent event) {
SubGhz* subghz = context; SubGhz* subghz = context;
bool generated_protocol = false; bool generated_protocol = false;
@ -182,7 +182,7 @@ const bool subghz_scene_set_type_on_event(void* context, SceneManagerEvent event
return false; return false;
} }
const void subghz_scene_set_type_on_exit(void* context) { void subghz_scene_set_type_on_exit(void* context) {
SubGhz* subghz = context; SubGhz* subghz = context;
submenu_clean(subghz->submenu); submenu_clean(subghz->submenu);
} }

View File

@ -7,7 +7,7 @@ void subghz_scene_show_error_popup_callback(void* context) {
view_dispatcher_send_custom_event(subghz->view_dispatcher, SCENE_NO_MAN_CUSTOM_EVENT); view_dispatcher_send_custom_event(subghz->view_dispatcher, SCENE_NO_MAN_CUSTOM_EVENT);
} }
const void subghz_scene_show_error_on_enter(void* context) { void subghz_scene_show_error_on_enter(void* context) {
SubGhz* subghz = context; SubGhz* subghz = context;
// Setup view // Setup view
@ -21,7 +21,7 @@ const void subghz_scene_show_error_on_enter(void* context) {
view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewPopup); view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewPopup);
} }
const bool subghz_scene_show_error_on_event(void* context, SceneManagerEvent event) { bool subghz_scene_show_error_on_event(void* context, SceneManagerEvent event) {
SubGhz* subghz = context; SubGhz* subghz = context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
if(event.event == SCENE_NO_MAN_CUSTOM_EVENT) { if(event.event == SCENE_NO_MAN_CUSTOM_EVENT) {
@ -33,7 +33,7 @@ const bool subghz_scene_show_error_on_event(void* context, SceneManagerEvent eve
return false; return false;
} }
const void subghz_scene_show_error_on_exit(void* context) { void subghz_scene_show_error_on_exit(void* context) {
SubGhz* subghz = context; SubGhz* subghz = context;
// Clear view // Clear view

View File

@ -12,7 +12,7 @@ void subghz_scene_start_submenu_callback(void* context, uint32_t index) {
view_dispatcher_send_custom_event(subghz->view_dispatcher, index); view_dispatcher_send_custom_event(subghz->view_dispatcher, index);
} }
const void subghz_scene_start_on_enter(void* context) { void subghz_scene_start_on_enter(void* context) {
SubGhz* subghz = context; SubGhz* subghz = context;
if(subghz->state_notifications == NOTIFICATION_STARTING_STATE) { if(subghz->state_notifications == NOTIFICATION_STARTING_STATE) {
subghz->state_notifications = NOTIFICATION_IDLE_STATE; subghz->state_notifications = NOTIFICATION_IDLE_STATE;
@ -36,7 +36,7 @@ const void subghz_scene_start_on_enter(void* context) {
view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewMenu); view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewMenu);
} }
const bool subghz_scene_start_on_event(void* context, SceneManagerEvent event) { bool subghz_scene_start_on_event(void* context, SceneManagerEvent event) {
SubGhz* subghz = context; SubGhz* subghz = context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
@ -65,7 +65,7 @@ const bool subghz_scene_start_on_event(void* context, SceneManagerEvent event) {
return false; return false;
} }
const void subghz_scene_start_on_exit(void* context) { void subghz_scene_start_on_exit(void* context) {
SubGhz* subghz = context; SubGhz* subghz = context;
submenu_clean(subghz->submenu); submenu_clean(subghz->submenu);
} }

View File

@ -11,7 +11,7 @@ void subghz_scene_test_submenu_callback(void* context, uint32_t index) {
view_dispatcher_send_custom_event(subghz->view_dispatcher, index); view_dispatcher_send_custom_event(subghz->view_dispatcher, index);
} }
const void subghz_scene_test_on_enter(void* context) { void subghz_scene_test_on_enter(void* context) {
SubGhz* subghz = context; SubGhz* subghz = context;
submenu_add_item( submenu_add_item(
@ -31,7 +31,7 @@ const void subghz_scene_test_on_enter(void* context) {
view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewMenu); view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewMenu);
} }
const bool subghz_scene_test_on_event(void* context, SceneManagerEvent event) { bool subghz_scene_test_on_event(void* context, SceneManagerEvent event) {
SubGhz* subghz = context; SubGhz* subghz = context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
@ -55,7 +55,7 @@ const bool subghz_scene_test_on_event(void* context, SceneManagerEvent event) {
return false; return false;
} }
const void subghz_scene_test_on_exit(void* context) { void subghz_scene_test_on_exit(void* context) {
SubGhz* subghz = context; SubGhz* subghz = context;
submenu_clean(subghz->submenu); submenu_clean(subghz->submenu);
} }

View File

@ -1,15 +1,15 @@
#include "../subghz_i.h" #include "../subghz_i.h"
const void subghz_scene_test_carrier_on_enter(void* context) { void subghz_scene_test_carrier_on_enter(void* context) {
SubGhz* subghz = context; SubGhz* subghz = context;
view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewTestCarrier); view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewTestCarrier);
} }
const bool subghz_scene_test_carrier_on_event(void* context, SceneManagerEvent event) { bool subghz_scene_test_carrier_on_event(void* context, SceneManagerEvent event) {
// SubGhz* subghz = context; // SubGhz* subghz = context;
return false; return false;
} }
const void subghz_scene_test_carrier_on_exit(void* context) { void subghz_scene_test_carrier_on_exit(void* context) {
// SubGhz* subghz = context; // SubGhz* subghz = context;
} }

View File

@ -1,15 +1,15 @@
#include "../subghz_i.h" #include "../subghz_i.h"
const void subghz_scene_test_packet_on_enter(void* context) { void subghz_scene_test_packet_on_enter(void* context) {
SubGhz* subghz = context; SubGhz* subghz = context;
view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewTestPacket); view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewTestPacket);
} }
const bool subghz_scene_test_packet_on_event(void* context, SceneManagerEvent event) { bool subghz_scene_test_packet_on_event(void* context, SceneManagerEvent event) {
// SubGhz* subghz = context; // SubGhz* subghz = context;
return false; return false;
} }
const void subghz_scene_test_packet_on_exit(void* context) { void subghz_scene_test_packet_on_exit(void* context) {
// SubGhz* subghz = context; // SubGhz* subghz = context;
} }

View File

@ -1,15 +1,15 @@
#include "../subghz_i.h" #include "../subghz_i.h"
const void subghz_scene_test_static_on_enter(void* context) { void subghz_scene_test_static_on_enter(void* context) {
SubGhz* subghz = context; SubGhz* subghz = context;
view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewStatic); view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewStatic);
} }
const bool subghz_scene_test_static_on_event(void* context, SceneManagerEvent event) { bool subghz_scene_test_static_on_event(void* context, SceneManagerEvent event) {
// SubGhz* subghz = context; // SubGhz* subghz = context;
return false; return false;
} }
const void subghz_scene_test_static_on_exit(void* context) { void subghz_scene_test_static_on_exit(void* context) {
// SubGhz* subghz = context; // SubGhz* subghz = context;
} }

View File

@ -55,7 +55,7 @@ static void subghz_scene_transmitter_update_data_show(void* context) {
} }
} }
const void subghz_scene_transmitter_on_enter(void* context) { void subghz_scene_transmitter_on_enter(void* context) {
SubGhz* subghz = context; SubGhz* subghz = context;
subghz_transmitter_set_callback( subghz_transmitter_set_callback(
subghz->subghz_transmitter, subghz_scene_transmitter_callback, subghz); subghz->subghz_transmitter, subghz_scene_transmitter_callback, subghz);
@ -64,7 +64,7 @@ const void subghz_scene_transmitter_on_enter(void* context) {
view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewTransmitter); view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewTransmitter);
} }
const bool subghz_scene_transmitter_on_event(void* context, SceneManagerEvent event) { bool subghz_scene_transmitter_on_event(void* context, SceneManagerEvent event) {
SubGhz* subghz = context; SubGhz* subghz = context;
if(event.type == SceneManagerEventTypeCustom) { if(event.type == SceneManagerEventTypeCustom) {
if(event.event == SubghzTransmitterEventSendStart) { if(event.event == SubghzTransmitterEventSendStart) {
@ -100,7 +100,7 @@ const bool subghz_scene_transmitter_on_event(void* context, SceneManagerEvent ev
return false; return false;
} }
const void subghz_scene_transmitter_on_exit(void* context) { void subghz_scene_transmitter_on_exit(void* context) {
SubGhz* subghz = context; SubGhz* subghz = context;
subghz->state_notifications = NOTIFICATION_IDLE_STATE; subghz->state_notifications = NOTIFICATION_IDLE_STATE;

View File

@ -179,7 +179,7 @@ static void subghz_cli_command_rx_callback(bool level, uint32_t duration, void*
static void subghz_cli_command_rx_text_callback(string_t text, void* context) { static void subghz_cli_command_rx_text_callback(string_t text, void* context) {
SubGhzCliCommandRx* instance = context; SubGhzCliCommandRx* instance = context;
instance->packet_count++; instance->packet_count++;
printf(string_get_cstr(text)); printf("%s", string_get_cstr(text));
} }
void subghz_cli_command_rx(Cli* cli, string_t args, void* context) { void subghz_cli_command_rx(Cli* cli, string_t args, void* context) {

View File

@ -61,7 +61,7 @@ bool furi_hal_bt_is_active() {
} }
bool furi_hal_bt_wait_startup() { bool furi_hal_bt_wait_startup() {
uint8_t counter = 0; uint16_t counter = 0;
while (!(APPE_Status() == BleGlueStatusStarted || APPE_Status() == BleGlueStatusBroken)) { while (!(APPE_Status() == BleGlueStatusStarted || APPE_Status() == BleGlueStatusBroken)) {
osDelay(10); osDelay(10);
counter++; counter++;

View File

@ -3,12 +3,12 @@
void furi_hal_ibutton_start() { void furi_hal_ibutton_start() {
furi_hal_ibutton_pin_high(); furi_hal_ibutton_pin_high();
hal_gpio_init(&ibutton_gpio, GpioModeOutputOpenDrain, GpioSpeedLow, GpioPullNo); hal_gpio_init(&ibutton_gpio, GpioModeOutputOpenDrain, GpioPullNo, GpioSpeedLow);
} }
void furi_hal_ibutton_stop() { void furi_hal_ibutton_stop() {
furi_hal_ibutton_pin_high(); furi_hal_ibutton_pin_high();
hal_gpio_init(&ibutton_gpio, GpioModeAnalog, GpioSpeedLow, GpioPullNo); hal_gpio_init(&ibutton_gpio, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
} }
void furi_hal_ibutton_pin_low() { void furi_hal_ibutton_pin_low() {

View File

@ -18,11 +18,11 @@ void furi_hal_rfid_pins_reset() {
furi_hal_ibutton_stop(); furi_hal_ibutton_stop();
// pulldown rfid antenna // pulldown rfid antenna
hal_gpio_init(&gpio_rfid_carrier_out, GpioModeOutputPushPull, GpioSpeedLow, GpioPullNo); hal_gpio_init(&gpio_rfid_carrier_out, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
hal_gpio_write(&gpio_rfid_carrier_out, false); hal_gpio_write(&gpio_rfid_carrier_out, false);
// from both sides // from both sides
hal_gpio_init(&gpio_rfid_pull, GpioModeOutputPushPull, GpioSpeedLow, GpioPullNo); hal_gpio_init(&gpio_rfid_pull, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
hal_gpio_write(&gpio_rfid_pull, true); hal_gpio_write(&gpio_rfid_pull, true);
} }
@ -36,7 +36,7 @@ void furi_hal_rfid_pins_emulate() {
&gpio_rfid_pull, GpioModeAltFunctionPushPull, GpioPullNo, GpioSpeedLow, GpioAltFn1TIM2); &gpio_rfid_pull, GpioModeAltFunctionPushPull, GpioPullNo, GpioSpeedLow, GpioAltFn1TIM2);
// pull rfid antenna from carrier side // pull rfid antenna from carrier side
hal_gpio_init(&gpio_rfid_carrier_out, GpioModeOutputPushPull, GpioSpeedLow, GpioPullNo); hal_gpio_init(&gpio_rfid_carrier_out, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
hal_gpio_write(&gpio_rfid_carrier_out, false); hal_gpio_write(&gpio_rfid_carrier_out, false);
} }
@ -46,7 +46,7 @@ void furi_hal_rfid_pins_read() {
furi_hal_ibutton_pin_low(); furi_hal_ibutton_pin_low();
// dont pull rfid antenna // dont pull rfid antenna
hal_gpio_init(&gpio_rfid_pull, GpioModeOutputPushPull, GpioSpeedLow, GpioPullNo); hal_gpio_init(&gpio_rfid_pull, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
hal_gpio_write(&gpio_rfid_pull, false); hal_gpio_write(&gpio_rfid_pull, false);
// carrier pin to timer out // carrier pin to timer out
@ -58,7 +58,7 @@ void furi_hal_rfid_pins_read() {
GpioAltFn1TIM1); GpioAltFn1TIM1);
// comparator in // comparator in
hal_gpio_init(&gpio_rfid_data_in, GpioModeAnalog, GpioSpeedLow, GpioPullNo); hal_gpio_init(&gpio_rfid_data_in, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
} }
void furi_hal_rfid_tim_read(float freq, float duty_cycle) { void furi_hal_rfid_tim_read(float freq, float duty_cycle) {

View File

@ -61,7 +61,7 @@ bool furi_hal_bt_is_active() {
} }
bool furi_hal_bt_wait_startup() { bool furi_hal_bt_wait_startup() {
uint8_t counter = 0; uint16_t counter = 0;
while (!(APPE_Status() == BleGlueStatusStarted || APPE_Status() == BleGlueStatusBroken)) { while (!(APPE_Status() == BleGlueStatusStarted || APPE_Status() == BleGlueStatusBroken)) {
osDelay(10); osDelay(10);
counter++; counter++;

View File

@ -3,12 +3,12 @@
void furi_hal_ibutton_start() { void furi_hal_ibutton_start() {
furi_hal_ibutton_pin_high(); furi_hal_ibutton_pin_high();
hal_gpio_init(&ibutton_gpio, GpioModeOutputOpenDrain, GpioSpeedLow, GpioPullNo); hal_gpio_init(&ibutton_gpio, GpioModeOutputOpenDrain, GpioPullNo, GpioSpeedLow);
} }
void furi_hal_ibutton_stop() { void furi_hal_ibutton_stop() {
furi_hal_ibutton_pin_high(); furi_hal_ibutton_pin_high();
hal_gpio_init(&ibutton_gpio, GpioModeAnalog, GpioSpeedLow, GpioPullNo); hal_gpio_init(&ibutton_gpio, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
} }
void furi_hal_ibutton_pin_low() { void furi_hal_ibutton_pin_low() {

View File

@ -18,11 +18,11 @@ void furi_hal_rfid_pins_reset() {
furi_hal_ibutton_stop(); furi_hal_ibutton_stop();
// pulldown rfid antenna // pulldown rfid antenna
hal_gpio_init(&gpio_rfid_carrier_out, GpioModeOutputPushPull, GpioSpeedLow, GpioPullNo); hal_gpio_init(&gpio_rfid_carrier_out, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
hal_gpio_write(&gpio_rfid_carrier_out, false); hal_gpio_write(&gpio_rfid_carrier_out, false);
// from both sides // from both sides
hal_gpio_init(&gpio_rfid_pull, GpioModeOutputPushPull, GpioSpeedLow, GpioPullNo); hal_gpio_init(&gpio_rfid_pull, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
hal_gpio_write(&gpio_rfid_pull, true); hal_gpio_write(&gpio_rfid_pull, true);
hal_gpio_init_simple(&gpio_rfid_carrier, GpioModeAnalog); hal_gpio_init_simple(&gpio_rfid_carrier, GpioModeAnalog);
@ -38,7 +38,7 @@ void furi_hal_rfid_pins_emulate() {
&gpio_rfid_pull, GpioModeAltFunctionPushPull, GpioPullNo, GpioSpeedLow, GpioAltFn1TIM2); &gpio_rfid_pull, GpioModeAltFunctionPushPull, GpioPullNo, GpioSpeedLow, GpioAltFn1TIM2);
// pull rfid antenna from carrier side // pull rfid antenna from carrier side
hal_gpio_init(&gpio_rfid_carrier_out, GpioModeOutputPushPull, GpioSpeedLow, GpioPullNo); hal_gpio_init(&gpio_rfid_carrier_out, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
hal_gpio_write(&gpio_rfid_carrier_out, false); hal_gpio_write(&gpio_rfid_carrier_out, false);
hal_gpio_init_ex( hal_gpio_init_ex(
@ -51,7 +51,7 @@ void furi_hal_rfid_pins_read() {
furi_hal_ibutton_pin_low(); furi_hal_ibutton_pin_low();
// dont pull rfid antenna // dont pull rfid antenna
hal_gpio_init(&gpio_rfid_pull, GpioModeOutputPushPull, GpioSpeedLow, GpioPullNo); hal_gpio_init(&gpio_rfid_pull, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
hal_gpio_write(&gpio_rfid_pull, false); hal_gpio_write(&gpio_rfid_pull, false);
// carrier pin to timer out // carrier pin to timer out
@ -63,7 +63,7 @@ void furi_hal_rfid_pins_read() {
GpioAltFn1TIM1); GpioAltFn1TIM1);
// comparator in // comparator in
hal_gpio_init(&gpio_rfid_data_in, GpioModeAnalog, GpioSpeedLow, GpioPullNo); hal_gpio_init(&gpio_rfid_data_in, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
} }
void furi_hal_rfid_tim_read(float freq, float duty_cycle) { void furi_hal_rfid_tim_read(float freq, float duty_cycle) {

View File

@ -174,7 +174,7 @@ uint8_t cc1101_read_fifo(const FuriHalSpiDevice* device, uint8_t* data, uint8_t*
// First byte - packet length // First byte - packet length
furi_hal_spi_bus_trx(device->bus, buff_tx, buff_rx, 2, CC1101_TIMEOUT); furi_hal_spi_bus_trx(device->bus, buff_tx, buff_rx, 2, CC1101_TIMEOUT);
*size = buff_rx[2]; *size = buff_rx[1];
furi_hal_spi_bus_trx(device->bus, &buff_tx[1], data, *size, CC1101_TIMEOUT); furi_hal_spi_bus_trx(device->bus, &buff_tx[1], data, *size, CC1101_TIMEOUT);
cc1101_flush_rx(device); cc1101_flush_rx(device);

View File

@ -54,7 +54,7 @@ static void subghz_parser_text_rx_callback(SubGhzProtocolCommon* parser, void* c
if(instance->text_callback) { if(instance->text_callback) {
instance->text_callback(output, instance->text_callback_context); instance->text_callback(output, instance->text_callback_context);
} else { } else {
printf(string_get_cstr(output)); printf("%s", string_get_cstr(output));
} }
string_clear(output); string_clear(output);
} }