mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-14 02:58:36 -07:00
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:
@@ -60,7 +60,7 @@ void subghz_scene_add_to_history_callback(SubGhzProtocolCommon* parser, void* co
|
||||
string_clear(str_buff);
|
||||
}
|
||||
|
||||
const void subghz_scene_receiver_on_enter(void* context) {
|
||||
void subghz_scene_receiver_on_enter(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
const bool subghz_scene_receiver_on_event(void* context, SceneManagerEvent event) {
|
||||
bool subghz_scene_receiver_on_event(void* context, SceneManagerEvent event) {
|
||||
SubGhz* subghz = context;
|
||||
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
@@ -147,6 +147,6 @@ const bool subghz_scene_receiver_on_event(void* context, SceneManagerEvent event
|
||||
return false;
|
||||
}
|
||||
|
||||
const void subghz_scene_receiver_on_exit(void* context) {
|
||||
void subghz_scene_receiver_on_exit(void* context) {
|
||||
// SubGhz* subghz = context;
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ void subghz_scene_receiver_config_callback(SubghzReceverEvent event, void* conte
|
||||
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;
|
||||
VariableItem* item;
|
||||
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);
|
||||
}
|
||||
|
||||
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;
|
||||
return false;
|
||||
}
|
||||
|
||||
const void subghz_scene_receiver_config_on_exit(void* context) {
|
||||
void subghz_scene_receiver_config_on_exit(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
variable_item_list_clean(subghz->variable_item_list);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ static bool subghz_scene_receiver_info_update_parser(void* context) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const void subghz_scene_receiver_info_on_enter(void* context) {
|
||||
void subghz_scene_receiver_info_on_enter(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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;
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
if(event.event == SubGhzSceneReceiverInfoCustomEventTxStart) {
|
||||
@@ -167,7 +167,7 @@ const bool subghz_scene_receiver_info_on_event(void* context, SceneManagerEvent
|
||||
return false;
|
||||
}
|
||||
|
||||
const void subghz_scene_receiver_info_on_exit(void* context) {
|
||||
void subghz_scene_receiver_info_on_exit(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
widget_clear(subghz->widget);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
const void subghz_scene_save_name_on_enter(void* context) {
|
||||
void subghz_scene_save_name_on_enter(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
@@ -49,7 +49,7 @@ const bool subghz_scene_save_name_on_event(void* context, SceneManagerEvent even
|
||||
return false;
|
||||
}
|
||||
|
||||
const void subghz_scene_save_name_on_exit(void* context) {
|
||||
void subghz_scene_save_name_on_exit(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
|
||||
// Clear view
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
const void subghz_scene_save_success_on_enter(void* context) {
|
||||
void subghz_scene_save_success_on_enter(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
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;
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
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;
|
||||
}
|
||||
|
||||
const void subghz_scene_save_success_on_exit(void* context) {
|
||||
void subghz_scene_save_success_on_exit(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
|
||||
// Clear view
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "../subghz_i.h"
|
||||
|
||||
const void subghz_scene_saved_on_enter(void* context) {
|
||||
void subghz_scene_saved_on_enter(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
|
||||
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;
|
||||
return false;
|
||||
}
|
||||
|
||||
const void subghz_scene_saved_on_exit(void* context) {
|
||||
void subghz_scene_saved_on_exit(void* context) {
|
||||
// SubGhz* subghz = context;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
const void subghz_scene_set_type_on_enter(void* context) {
|
||||
void subghz_scene_set_type_on_enter(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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;
|
||||
bool generated_protocol = false;
|
||||
|
||||
@@ -182,7 +182,7 @@ const bool subghz_scene_set_type_on_event(void* context, SceneManagerEvent event
|
||||
return false;
|
||||
}
|
||||
|
||||
const void subghz_scene_set_type_on_exit(void* context) {
|
||||
void subghz_scene_set_type_on_exit(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
submenu_clean(subghz->submenu);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
const void subghz_scene_show_error_on_enter(void* context) {
|
||||
void subghz_scene_show_error_on_enter(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
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;
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
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;
|
||||
}
|
||||
|
||||
const void subghz_scene_show_error_on_exit(void* context) {
|
||||
void subghz_scene_show_error_on_exit(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
|
||||
// Clear view
|
||||
|
||||
@@ -12,7 +12,7 @@ void subghz_scene_start_submenu_callback(void* context, uint32_t 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;
|
||||
if(subghz->state_notifications == NOTIFICATION_STARTING_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);
|
||||
}
|
||||
|
||||
const bool subghz_scene_start_on_event(void* context, SceneManagerEvent event) {
|
||||
bool subghz_scene_start_on_event(void* context, SceneManagerEvent event) {
|
||||
SubGhz* subghz = context;
|
||||
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
@@ -65,7 +65,7 @@ const bool subghz_scene_start_on_event(void* context, SceneManagerEvent event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const void subghz_scene_start_on_exit(void* context) {
|
||||
void subghz_scene_start_on_exit(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
submenu_clean(subghz->submenu);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ void subghz_scene_test_submenu_callback(void* context, uint32_t 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;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
const bool subghz_scene_test_on_event(void* context, SceneManagerEvent event) {
|
||||
bool subghz_scene_test_on_event(void* context, SceneManagerEvent event) {
|
||||
SubGhz* subghz = context;
|
||||
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
@@ -55,7 +55,7 @@ const bool subghz_scene_test_on_event(void* context, SceneManagerEvent event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const void subghz_scene_test_on_exit(void* context) {
|
||||
void subghz_scene_test_on_exit(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
submenu_clean(subghz->submenu);
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
#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;
|
||||
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;
|
||||
return false;
|
||||
}
|
||||
|
||||
const void subghz_scene_test_carrier_on_exit(void* context) {
|
||||
void subghz_scene_test_carrier_on_exit(void* context) {
|
||||
// SubGhz* subghz = context;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
#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;
|
||||
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;
|
||||
return false;
|
||||
}
|
||||
|
||||
const void subghz_scene_test_packet_on_exit(void* context) {
|
||||
void subghz_scene_test_packet_on_exit(void* context) {
|
||||
// SubGhz* subghz = context;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
#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;
|
||||
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;
|
||||
return false;
|
||||
}
|
||||
|
||||
const void subghz_scene_test_static_on_exit(void* context) {
|
||||
void subghz_scene_test_static_on_exit(void* context) {
|
||||
// SubGhz* subghz = context;
|
||||
}
|
||||
|
||||
@@ -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_transmitter_set_callback(
|
||||
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);
|
||||
}
|
||||
|
||||
const bool subghz_scene_transmitter_on_event(void* context, SceneManagerEvent event) {
|
||||
bool subghz_scene_transmitter_on_event(void* context, SceneManagerEvent event) {
|
||||
SubGhz* subghz = context;
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
if(event.event == SubghzTransmitterEventSendStart) {
|
||||
@@ -100,7 +100,7 @@ const bool subghz_scene_transmitter_on_event(void* context, SceneManagerEvent ev
|
||||
return false;
|
||||
}
|
||||
|
||||
const void subghz_scene_transmitter_on_exit(void* context) {
|
||||
void subghz_scene_transmitter_on_exit(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
|
||||
subghz->state_notifications = NOTIFICATION_IDLE_STATE;
|
||||
|
||||
@@ -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) {
|
||||
SubGhzCliCommandRx* instance = context;
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user