Api Symbols: replace asserts with checks (#3507)

* Api Symbols: replace asserts with checks
* Api Symbols: replace asserts with checks part 2
* Update no args function signatures with void, to help compiler to track incorrect usage
* More unavoidable void
* Update PVS config and code to make it happy
* Format sources
* nfc: fix checks
* dead code cleanup & include fixes

Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: hedger <hedger@nanode.su>
This commit is contained in:
あく 2024-03-19 23:43:52 +09:00 committed by GitHub
parent a09ec4d976
commit acc39a4bc0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
571 changed files with 3565 additions and 2704 deletions

View file

@ -1,10 +1,10 @@
# MLib macros we can't do much about. # MLib macros we can't do much about.
//-V:M_LET:1048,1044 //-V:M_LET:1048,1044
//-V:M_EACH:1048,1044 //-V:M_EACH:1048,1044
//-V:ARRAY_DEF:760,747,568,776,729,712,654 //-V:ARRAY_DEF:760,747,568,776,729,712,654,1103
//-V:LIST_DEF:760,747,568,712,729,654,776 //-V:LIST_DEF:760,747,568,712,729,654,776,1103
//-V:BPTREE_DEF2:779,1086,557,773,512 //-V:BPTREE_DEF2:779,1086,557,773,512
//-V:DICT_DEF2:779,524,776,760,1044,1001,729,590,568,747,685 //-V:DICT_DEF2:779,524,776,760,1044,1001,729,590,568,747,685,1103
//-V:ALGO_DEF:1048,747,1044 //-V:ALGO_DEF:1048,747,1044
//-V:TUPLE_DEF2:524,590,1001,760 //-V:TUPLE_DEF2:524,590,1001,760
@ -42,8 +42,5 @@
# Model-related warnings # Model-related warnings
//-V:with_view_model:1044,1048 //-V:with_view_model:1044,1048
# Functions that always return the same error code
//-V:picopass_device_decrypt:1048
# Examples # Examples
//V_EXCLUDE_PATH applications/examples/ //V_EXCLUDE_PATH applications/examples/

View file

@ -11,29 +11,29 @@ class AccessorApp {
public: public:
void run(void); void run(void);
AccessorApp(); AccessorApp(void);
~AccessorApp(); ~AccessorApp(void);
enum class Scene : uint8_t { enum class Scene : uint8_t {
Exit, Exit,
Start, Start,
}; };
AccessorAppViewManager* get_view_manager(); AccessorAppViewManager* get_view_manager(void);
void switch_to_next_scene(Scene index); void switch_to_next_scene(Scene index);
void search_and_switch_to_previous_scene(std::initializer_list<Scene> scenes_list); void search_and_switch_to_previous_scene(std::initializer_list<Scene> scenes_list);
bool switch_to_previous_scene(uint8_t count = 1); bool switch_to_previous_scene(uint8_t count = 1);
Scene get_previous_scene(); Scene get_previous_scene(void);
void notify_green_blink(); void notify_green_blink(void);
void notify_success(); void notify_success(void);
char* get_text_store(); char* get_text_store(void);
uint8_t get_text_store_size(); uint8_t get_text_store_size(void);
void set_text_store(const char* text...); void set_text_store(const char* text...);
WIEGAND* get_wiegand(); WIEGAND* get_wiegand(void);
OneWireHost* get_one_wire(); OneWireHost* get_one_wire(void);
private: private:
std::list<Scene> previous_scenes_list = {Scene::Exit}; std::list<Scene> previous_scenes_list = {Scene::Exit};

View file

@ -15,16 +15,16 @@ public:
FuriMessageQueue* event_queue; FuriMessageQueue* event_queue;
AccessorAppViewManager(); AccessorAppViewManager(void);
~AccessorAppViewManager(); ~AccessorAppViewManager(void);
void switch_to(ViewType type); void switch_to(ViewType type);
void receive_event(AccessorEvent* event); void receive_event(AccessorEvent* event);
void send_event(AccessorEvent* event); void send_event(AccessorEvent* event);
Submenu* get_submenu(); Submenu* get_submenu(void);
Popup* get_popup(); Popup* get_popup(void);
private: private:
ViewDispatcher* view_dispatcher; ViewDispatcher* view_dispatcher;

View file

@ -2,19 +2,19 @@
class WIEGAND { class WIEGAND {
public: public:
WIEGAND(); WIEGAND(void);
void begin(); void begin(void);
void end(); void end(void);
bool available(); bool available(void);
unsigned long getCode(); unsigned long getCode(void);
unsigned long getCodeHigh(); unsigned long getCodeHigh(void);
int getWiegandType(); int getWiegandType(void);
static void ReadD0(); static void ReadD0(void);
static void ReadD1(); static void ReadD1(void);
private: private:
static bool DoWiegandConversion(); static bool DoWiegandConversion(void);
static unsigned long static unsigned long
GetCardId(unsigned long* codehigh, unsigned long* codelow, char bitlength); GetCardId(unsigned long* codehigh, unsigned long* codelow, char bitlength);

View file

@ -32,7 +32,7 @@ static void battery_test_battery_info_update_model(void* context) {
notification_message(app->notifications, &sequence_display_backlight_on); notification_message(app->notifications, &sequence_display_backlight_on);
} }
BatteryTestApp* battery_test_alloc() { BatteryTestApp* battery_test_alloc(void) {
BatteryTestApp* app = malloc(sizeof(BatteryTestApp)); BatteryTestApp* app = malloc(sizeof(BatteryTestApp));
// Records // Records

View file

@ -116,7 +116,7 @@ static void battery_info_draw_callback(Canvas* canvas, void* context) {
draw_stat(canvas, 104, 42, &I_Health_16x16, health); draw_stat(canvas, 104, 42, &I_Health_16x16, health);
} }
BatteryInfo* battery_info_alloc() { BatteryInfo* battery_info_alloc(void) {
BatteryInfo* battery_info = malloc(sizeof(BatteryInfo)); BatteryInfo* battery_info = malloc(sizeof(BatteryInfo));
battery_info->view = view_alloc(); battery_info->view = view_alloc();
view_set_context(battery_info->view, battery_info); view_set_context(battery_info->view, battery_info);

View file

@ -14,7 +14,7 @@ typedef struct {
uint8_t health; uint8_t health;
} BatteryInfoModel; } BatteryInfoModel;
BatteryInfo* battery_info_alloc(); BatteryInfo* battery_info_alloc(void);
void battery_info_free(BatteryInfo* battery_info); void battery_info_free(BatteryInfo* battery_info);

View file

@ -28,7 +28,7 @@ uint32_t bt_debug_start_view(void* context) {
return BtDebugAppViewSubmenu; return BtDebugAppViewSubmenu;
} }
BtDebugApp* bt_debug_app_alloc() { BtDebugApp* bt_debug_app_alloc(void) {
BtDebugApp* app = malloc(sizeof(BtDebugApp)); BtDebugApp* app = malloc(sizeof(BtDebugApp));
// Gui // Gui

View file

@ -129,7 +129,7 @@ static void bt_test_carrier_timer_callback(void* context) {
} }
} }
BtCarrierTest* bt_carrier_test_alloc() { BtCarrierTest* bt_carrier_test_alloc(void) {
BtCarrierTest* bt_carrier_test = malloc(sizeof(BtCarrierTest)); BtCarrierTest* bt_carrier_test = malloc(sizeof(BtCarrierTest));
bt_carrier_test->bt_test = bt_test_alloc(); bt_carrier_test->bt_test = bt_test_alloc();
bt_test_set_context(bt_carrier_test->bt_test, bt_carrier_test); bt_test_set_context(bt_carrier_test->bt_test, bt_carrier_test);

View file

@ -3,7 +3,7 @@
typedef struct BtCarrierTest BtCarrierTest; typedef struct BtCarrierTest BtCarrierTest;
BtCarrierTest* bt_carrier_test_alloc(); BtCarrierTest* bt_carrier_test_alloc(void);
void bt_carrier_test_free(BtCarrierTest* bt_carrier_test); void bt_carrier_test_free(BtCarrierTest* bt_carrier_test);

View file

@ -97,7 +97,7 @@ static void bt_test_packet_timer_callback(void* context) {
} }
} }
BtPacketTest* bt_packet_test_alloc() { BtPacketTest* bt_packet_test_alloc(void) {
BtPacketTest* bt_packet_test = malloc(sizeof(BtPacketTest)); BtPacketTest* bt_packet_test = malloc(sizeof(BtPacketTest));
bt_packet_test->bt_test = bt_test_alloc(); bt_packet_test->bt_test = bt_test_alloc();
bt_test_set_context(bt_packet_test->bt_test, bt_packet_test); bt_test_set_context(bt_packet_test->bt_test, bt_packet_test);

View file

@ -3,7 +3,7 @@
typedef struct BtPacketTest BtPacketTest; typedef struct BtPacketTest BtPacketTest;
BtPacketTest* bt_packet_test_alloc(); BtPacketTest* bt_packet_test_alloc(void);
void bt_packet_test_free(BtPacketTest* bt_packet_test); void bt_packet_test_free(BtPacketTest* bt_packet_test);

View file

@ -305,7 +305,7 @@ void bt_test_process_back(BtTest* bt_test) {
} }
} }
BtTest* bt_test_alloc() { BtTest* bt_test_alloc(void) {
BtTest* bt_test = malloc(sizeof(BtTest)); BtTest* bt_test = malloc(sizeof(BtTest));
bt_test->view = view_alloc(); bt_test->view = view_alloc();
view_set_context(bt_test->view, bt_test); view_set_context(bt_test->view, bt_test);

View file

@ -12,7 +12,7 @@ typedef void (*BtTestBackCallback)(void* context);
typedef struct BtTestParam BtTestParam; typedef struct BtTestParam BtTestParam;
typedef void (*BtTestParamChangeCallback)(BtTestParam* param); typedef void (*BtTestParamChangeCallback)(BtTestParam* param);
BtTest* bt_test_alloc(); BtTest* bt_test_alloc(void);
void bt_test_free(BtTest* bt_test); void bt_test_free(BtTest* bt_test);

View file

@ -90,7 +90,7 @@ uint32_t ccid_test_exit(void* context) {
return VIEW_NONE; return VIEW_NONE;
} }
CcidTestApp* ccid_test_app_alloc() { CcidTestApp* ccid_test_app_alloc(void) {
CcidTestApp* app = malloc(sizeof(CcidTestApp)); CcidTestApp* app = malloc(sizeof(CcidTestApp));
// Gui // Gui

View file

@ -50,7 +50,7 @@ static void crash_test_submenu_callback(void* context, uint32_t index) {
furi_halt("Crash test: furi_halt"); furi_halt("Crash test: furi_halt");
break; break;
default: default:
furi_crash("Programming error"); furi_crash();
} }
} }
@ -59,7 +59,7 @@ static uint32_t crash_test_exit_callback(void* context) {
return VIEW_NONE; return VIEW_NONE;
} }
CrashTest* crash_test_alloc() { CrashTest* crash_test_alloc(void) {
CrashTest* instance = malloc(sizeof(CrashTest)); CrashTest* instance = malloc(sizeof(CrashTest));
View* view = NULL; View* view = NULL;

View file

@ -26,7 +26,7 @@ static void gui_input_events_callback(const void* value, void* ctx) {
} }
} }
static DirectDraw* direct_draw_alloc() { static DirectDraw* direct_draw_alloc(void) {
DirectDraw* instance = malloc(sizeof(DirectDraw)); DirectDraw* instance = malloc(sizeof(DirectDraw));
instance->input = furi_record_open(RECORD_INPUT_EVENTS); instance->input = furi_record_open(RECORD_INPUT_EVENTS);

View file

@ -121,7 +121,7 @@ static void display_config_set_contrast(VariableItem* item) {
display_test_reload_config(instance); display_test_reload_config(instance);
} }
DisplayTest* display_test_alloc() { DisplayTest* display_test_alloc(void) {
DisplayTest* instance = malloc(sizeof(DisplayTest)); DisplayTest* instance = malloc(sizeof(DisplayTest));
View* view = NULL; View* view = NULL;

View file

@ -154,7 +154,7 @@ static void view_display_test_timer_callback(void* context) {
instance->view, ViewDisplayTestModel * model, { model->counter++; }, true); instance->view, ViewDisplayTestModel * model, { model->counter++; }, true);
} }
ViewDisplayTest* view_display_test_alloc() { ViewDisplayTest* view_display_test_alloc(void) {
ViewDisplayTest* instance = malloc(sizeof(ViewDisplayTest)); ViewDisplayTest* instance = malloc(sizeof(ViewDisplayTest));
instance->view = view_alloc(); instance->view = view_alloc();

View file

@ -5,7 +5,7 @@
typedef struct ViewDisplayTest ViewDisplayTest; typedef struct ViewDisplayTest ViewDisplayTest;
ViewDisplayTest* view_display_test_alloc(); ViewDisplayTest* view_display_test_alloc(void);
void view_display_test_free(ViewDisplayTest* instance); void view_display_test_free(ViewDisplayTest* instance);

View file

@ -81,7 +81,7 @@ static void expansion_test_app_serial_rx_callback(
} }
} }
static ExpansionTestApp* expansion_test_app_alloc() { static ExpansionTestApp* expansion_test_app_alloc(void) {
ExpansionTestApp* instance = malloc(sizeof(ExpansionTestApp)); ExpansionTestApp* instance = malloc(sizeof(ExpansionTestApp));
instance->buf = furi_stream_buffer_alloc(RECEIVE_BUFFER_SIZE, 1); instance->buf = furi_stream_buffer_alloc(RECEIVE_BUFFER_SIZE, 1);
return instance; return instance;

View file

@ -12,7 +12,7 @@ static bool lfrfid_debug_back_event_callback(void* context) {
return scene_manager_handle_back_event(app->scene_manager); return scene_manager_handle_back_event(app->scene_manager);
} }
static LfRfidDebug* lfrfid_debug_alloc() { static LfRfidDebug* lfrfid_debug_alloc(void) {
LfRfidDebug* app = malloc(sizeof(LfRfidDebug)); LfRfidDebug* app = malloc(sizeof(LfRfidDebug));
app->view_dispatcher = view_dispatcher_alloc(); app->view_dispatcher = view_dispatcher_alloc();

View file

@ -170,7 +170,7 @@ static bool lfrfid_debug_view_tune_input_callback(InputEvent* event, void* conte
return consumed; return consumed;
} }
LfRfidTuneView* lfrfid_debug_view_tune_alloc() { LfRfidTuneView* lfrfid_debug_view_tune_alloc(void) {
LfRfidTuneView* tune_view = malloc(sizeof(LfRfidTuneView)); LfRfidTuneView* tune_view = malloc(sizeof(LfRfidTuneView));
tune_view->view = view_alloc(); tune_view->view = view_alloc();
view_set_context(tune_view->view, tune_view); view_set_context(tune_view->view, tune_view);

View file

@ -3,7 +3,7 @@
typedef struct LfRfidTuneView LfRfidTuneView; typedef struct LfRfidTuneView LfRfidTuneView;
LfRfidTuneView* lfrfid_debug_view_tune_alloc(); LfRfidTuneView* lfrfid_debug_view_tune_alloc(void);
void lfrfid_debug_view_tune_free(LfRfidTuneView* tune_view); void lfrfid_debug_view_tune_free(LfRfidTuneView* tune_view);

View file

@ -53,7 +53,7 @@ static uint32_t locale_test_exit(void* context) {
return VIEW_NONE; return VIEW_NONE;
} }
static LocaleTestApp* locale_test_alloc() { static LocaleTestApp* locale_test_alloc(void) {
LocaleTestApp* app = malloc(sizeof(LocaleTestApp)); LocaleTestApp* app = malloc(sizeof(LocaleTestApp));
// Gui // Gui

View file

@ -83,7 +83,7 @@ static bool rpc_debug_app_rpc_init_rpc(RpcDebugApp* app, const char* args) {
return ret; return ret;
} }
static RpcDebugApp* rpc_debug_app_alloc() { static RpcDebugApp* rpc_debug_app_alloc(void) {
RpcDebugApp* app = malloc(sizeof(RpcDebugApp)); RpcDebugApp* app = malloc(sizeof(RpcDebugApp));
app->gui = furi_record_open(RECORD_GUI); app->gui = furi_record_open(RECORD_GUI);

View file

@ -21,7 +21,7 @@ typedef struct {
Cli* cli; Cli* cli;
} SpeakerDebugApp; } SpeakerDebugApp;
static SpeakerDebugApp* speaker_app_alloc() { static SpeakerDebugApp* speaker_app_alloc(void) {
SpeakerDebugApp* app = (SpeakerDebugApp*)malloc(sizeof(SpeakerDebugApp)); SpeakerDebugApp* app = (SpeakerDebugApp*)malloc(sizeof(SpeakerDebugApp));
app->music_worker = music_worker_alloc(); app->music_worker = music_worker_alloc();
app->message_queue = furi_message_queue_alloc(8, sizeof(SpeakerDebugAppMessage)); app->message_queue = furi_message_queue_alloc(8, sizeof(SpeakerDebugAppMessage));

View file

@ -38,7 +38,7 @@ typedef enum {
PrincetonDecoderStepCheckDuration, PrincetonDecoderStepCheckDuration,
} PrincetonDecoderStep; } PrincetonDecoderStep;
SubGhzEncoderPrinceton* subghz_encoder_princeton_for_testing_alloc() { SubGhzEncoderPrinceton* subghz_encoder_princeton_for_testing_alloc(void) {
SubGhzEncoderPrinceton* instance = malloc(sizeof(SubGhzEncoderPrinceton)); SubGhzEncoderPrinceton* instance = malloc(sizeof(SubGhzEncoderPrinceton));
return instance; return instance;
} }

View file

@ -15,7 +15,7 @@ typedef void (*SubGhzDecoderPrincetonCallback)(SubGhzDecoderPrinceton* parser, v
* Allocate SubGhzEncoderPrinceton * Allocate SubGhzEncoderPrinceton
* @return pointer to SubGhzEncoderPrinceton instance * @return pointer to SubGhzEncoderPrinceton instance
*/ */
SubGhzEncoderPrinceton* subghz_encoder_princeton_for_testing_alloc(); SubGhzEncoderPrinceton* subghz_encoder_princeton_for_testing_alloc(void);
/** /**
* Free SubGhzEncoderPrinceton instance * Free SubGhzEncoderPrinceton instance
@ -69,7 +69,7 @@ LevelDuration subghz_encoder_princeton_for_testing_yield(void* context);
* Allocate SubGhzDecoderPrinceton * Allocate SubGhzDecoderPrinceton
* @return SubGhzDecoderPrinceton* * @return SubGhzDecoderPrinceton*
*/ */
SubGhzDecoderPrinceton* subghz_decoder_princeton_for_testing_alloc(); SubGhzDecoderPrinceton* subghz_decoder_princeton_for_testing_alloc(void);
/** /**
* Free SubGhzDecoderPrinceton * Free SubGhzDecoderPrinceton

View file

@ -21,7 +21,7 @@ static void subghz_test_app_tick_event_callback(void* context) {
scene_manager_handle_tick_event(app->scene_manager); scene_manager_handle_tick_event(app->scene_manager);
} }
SubGhzTestApp* subghz_test_app_alloc() { SubGhzTestApp* subghz_test_app_alloc(void) {
SubGhzTestApp* app = malloc(sizeof(SubGhzTestApp)); SubGhzTestApp* app = malloc(sizeof(SubGhzTestApp));
// GUI // GUI

View file

@ -186,7 +186,7 @@ void subghz_test_carrier_rssi_timer_callback(void* context) {
false); false);
} }
SubGhzTestCarrier* subghz_test_carrier_alloc() { SubGhzTestCarrier* subghz_test_carrier_alloc(void) {
SubGhzTestCarrier* subghz_test_carrier = malloc(sizeof(SubGhzTestCarrier)); SubGhzTestCarrier* subghz_test_carrier = malloc(sizeof(SubGhzTestCarrier));
// View allocation and configuration // View allocation and configuration

View file

@ -15,7 +15,7 @@ void subghz_test_carrier_set_callback(
SubGhzTestCarrierCallback callback, SubGhzTestCarrierCallback callback,
void* context); void* context);
SubGhzTestCarrier* subghz_test_carrier_alloc(); SubGhzTestCarrier* subghz_test_carrier_alloc(void);
void subghz_test_carrier_free(SubGhzTestCarrier* subghz_test_carrier); void subghz_test_carrier_free(SubGhzTestCarrier* subghz_test_carrier);

View file

@ -236,7 +236,7 @@ void subghz_test_packet_exit(void* context) {
furi_hal_subghz_sleep(); furi_hal_subghz_sleep();
} }
SubGhzTestPacket* subghz_test_packet_alloc() { SubGhzTestPacket* subghz_test_packet_alloc(void) {
SubGhzTestPacket* instance = malloc(sizeof(SubGhzTestPacket)); SubGhzTestPacket* instance = malloc(sizeof(SubGhzTestPacket));
// View allocation and configuration // View allocation and configuration

View file

@ -15,7 +15,7 @@ void subghz_test_packet_set_callback(
SubGhzTestPacketCallback callback, SubGhzTestPacketCallback callback,
void* context); void* context);
SubGhzTestPacket* subghz_test_packet_alloc(); SubGhzTestPacket* subghz_test_packet_alloc(void);
void subghz_test_packet_free(SubGhzTestPacket* subghz_test_packet); void subghz_test_packet_free(SubGhzTestPacket* subghz_test_packet);

View file

@ -164,7 +164,7 @@ void subghz_test_static_exit(void* context) {
furi_hal_subghz_sleep(); furi_hal_subghz_sleep();
} }
SubGhzTestStatic* subghz_test_static_alloc() { SubGhzTestStatic* subghz_test_static_alloc(void) {
SubGhzTestStatic* instance = malloc(sizeof(SubGhzTestStatic)); SubGhzTestStatic* instance = malloc(sizeof(SubGhzTestStatic));
// View allocation and configuration // View allocation and configuration

View file

@ -15,7 +15,7 @@ void subghz_test_static_set_callback(
SubGhzTestStaticCallback callback, SubGhzTestStaticCallback callback,
void* context); void* context);
SubGhzTestStatic* subghz_test_static_alloc(); SubGhzTestStatic* subghz_test_static_alloc(void);
void subghz_test_static_free(SubGhzTestStatic* subghz_static); void subghz_test_static_free(SubGhzTestStatic* subghz_static);

View file

@ -734,7 +734,7 @@ MU_TEST_SUITE(test_bit_lib) {
MU_RUN_TEST(test_bit_lib_bytes_to_num_bcd); MU_RUN_TEST(test_bit_lib_bytes_to_num_bcd);
} }
int run_minunit_test_bit_lib() { int run_minunit_test_bit_lib(void) {
MU_RUN_SUITE(test_bit_lib); MU_RUN_SUITE(test_bit_lib);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }

View file

@ -17,7 +17,7 @@ typedef struct {
BtTest* bt_test = NULL; BtTest* bt_test = NULL;
void bt_test_alloc() { void bt_test_alloc(void) {
bt_test = malloc(sizeof(BtTest)); bt_test = malloc(sizeof(BtTest));
bt_test->storage = furi_record_open(RECORD_STORAGE); bt_test->storage = furi_record_open(RECORD_STORAGE);
bt_test->nvm_ram_buff_dut = malloc(BT_TEST_NVM_RAM_BUFF_SIZE); bt_test->nvm_ram_buff_dut = malloc(BT_TEST_NVM_RAM_BUFF_SIZE);
@ -27,7 +27,7 @@ void bt_test_alloc() {
bt_test->bt_keys_storage, bt_test->nvm_ram_buff_dut, BT_TEST_NVM_RAM_BUFF_SIZE); bt_test->bt_keys_storage, bt_test->nvm_ram_buff_dut, BT_TEST_NVM_RAM_BUFF_SIZE);
} }
void bt_test_free() { void bt_test_free(void) {
furi_check(bt_test); furi_check(bt_test);
free(bt_test->nvm_ram_buff_ref); free(bt_test->nvm_ram_buff_ref);
free(bt_test->nvm_ram_buff_dut); free(bt_test->nvm_ram_buff_dut);
@ -37,7 +37,7 @@ void bt_test_free() {
bt_test = NULL; bt_test = NULL;
} }
static void bt_test_keys_storage_profile() { static void bt_test_keys_storage_profile(void) {
// Emulate nvm change on initial connection // Emulate nvm change on initial connection
const int nvm_change_size_on_connection = 88; const int nvm_change_size_on_connection = 88;
for(size_t i = 0; i < nvm_change_size_on_connection; i++) { for(size_t i = 0; i < nvm_change_size_on_connection; i++) {
@ -82,7 +82,7 @@ static void bt_test_keys_storage_profile() {
"Wrong buffer loaded"); "Wrong buffer loaded");
} }
static void bt_test_keys_remove_test_file() { static void bt_test_keys_remove_test_file(void) {
mu_assert( mu_assert(
storage_simply_remove(bt_test->storage, BT_TEST_KEY_STORAGE_FILE_PATH), storage_simply_remove(bt_test->storage, BT_TEST_KEY_STORAGE_FILE_PATH),
"Can't remove test file"); "Can't remove test file");
@ -104,7 +104,7 @@ MU_TEST_SUITE(test_bt) {
bt_test_free(); bt_test_free();
} }
int run_minunit_test_bt() { int run_minunit_test_bt(void) {
MU_RUN_SUITE(test_bt); MU_RUN_SUITE(test_bt);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }

View file

@ -182,7 +182,7 @@ MU_TEST_SUITE(test_datetime_datetime_to_timestamp_suite) {
MU_RUN_TEST(test_datetime_datetime_to_timestamp_max); MU_RUN_TEST(test_datetime_datetime_to_timestamp_max);
} }
int run_minunit_test_datetime() { int run_minunit_test_datetime(void) {
MU_RUN_SUITE(test_datetime_timestamp_to_datetime_suite); MU_RUN_SUITE(test_datetime_timestamp_to_datetime_suite);
MU_RUN_SUITE(test_datetime_datetime_to_timestamp_suite); MU_RUN_SUITE(test_datetime_datetime_to_timestamp_suite);
MU_RUN_SUITE(test_datetime_validate_datetime); MU_RUN_SUITE(test_datetime_validate_datetime);

View file

@ -25,7 +25,7 @@ MU_TEST_SUITE(dialogs_file_browser_options) {
MU_RUN_TEST(test_dialog_file_browser_set_basic_options_should_init_all_fields); MU_RUN_TEST(test_dialog_file_browser_set_basic_options_should_init_all_fields);
} }
int run_minunit_test_dialogs_file_browser_options() { int run_minunit_test_dialogs_file_browser_options(void) {
MU_RUN_SUITE(dialogs_file_browser_options); MU_RUN_SUITE(dialogs_file_browser_options);
return MU_EXIT_CODE; return MU_EXIT_CODE;

View file

@ -194,7 +194,7 @@ MU_TEST_SUITE(test_expansion_suite) {
MU_RUN_TEST(test_expansion_garbage_input); MU_RUN_TEST(test_expansion_garbage_input);
} }
int run_minunit_test_expansion() { int run_minunit_test_expansion(void) {
MU_RUN_SUITE(test_expansion_suite); MU_RUN_SUITE(test_expansion_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }

View file

@ -331,7 +331,7 @@ MU_TEST_SUITE(flipper_format_string_suite) {
MU_RUN_TEST(flipper_format_file_test); MU_RUN_TEST(flipper_format_file_test);
} }
int run_minunit_test_flipper_format_string() { int run_minunit_test_flipper_format_string(void) {
MU_RUN_SUITE(flipper_format_string_suite); MU_RUN_SUITE(flipper_format_string_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }

View file

@ -103,14 +103,14 @@ static bool storage_write_string(const char* path, const char* data) {
return result; return result;
} }
static void tests_setup() { static void tests_setup(void) {
Storage* storage = furi_record_open(RECORD_STORAGE); Storage* storage = furi_record_open(RECORD_STORAGE);
mu_assert(storage_simply_remove_recursive(storage, TEST_DIR_NAME), "Cannot clean data"); mu_assert(storage_simply_remove_recursive(storage, TEST_DIR_NAME), "Cannot clean data");
mu_assert(storage_simply_mkdir(storage, TEST_DIR_NAME), "Cannot create dir"); mu_assert(storage_simply_mkdir(storage, TEST_DIR_NAME), "Cannot create dir");
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
} }
static void tests_teardown() { static void tests_teardown(void) {
Storage* storage = furi_record_open(RECORD_STORAGE); Storage* storage = furi_record_open(RECORD_STORAGE);
mu_assert(storage_simply_remove_recursive(storage, TEST_DIR_NAME), "Cannot clean data"); mu_assert(storage_simply_remove_recursive(storage, TEST_DIR_NAME), "Cannot clean data");
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
@ -545,7 +545,7 @@ MU_TEST_SUITE(flipper_format) {
tests_teardown(); tests_teardown();
} }
int run_minunit_test_flipper_format() { int run_minunit_test_flipper_format(void) {
MU_RUN_SUITE(flipper_format); MU_RUN_SUITE(flipper_format);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }

View file

@ -54,7 +54,7 @@ MU_TEST_SUITE(float_tools_suite) {
MU_RUN_TEST(float_tools_equal_test); MU_RUN_TEST(float_tools_equal_test);
} }
int run_minunit_test_float_tools() { int run_minunit_test_float_tools(void) {
MU_RUN_SUITE(float_tools_suite); MU_RUN_SUITE(float_tools_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }

View file

@ -4,7 +4,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
void test_furi_memmgr() { void test_furi_memmgr(void) {
void* ptr; void* ptr;
// allocate memory case // allocate memory case

View file

@ -15,7 +15,7 @@ void test_pubsub_handler(const void* arg, void* ctx) {
pubsub_context_value = *(uint32_t*)ctx; pubsub_context_value = *(uint32_t*)ctx;
} }
void test_furi_pubsub() { void test_furi_pubsub(void) {
FuriPubSub* test_pubsub = NULL; FuriPubSub* test_pubsub = NULL;
FuriPubSubSubscription* test_pubsub_subscription = NULL; FuriPubSubSubscription* test_pubsub_subscription = NULL;

View file

@ -5,7 +5,7 @@
#define TEST_RECORD_NAME "test/holding" #define TEST_RECORD_NAME "test/holding"
void test_furi_create_open() { void test_furi_create_open(void) {
// Test that record does not exist // Test that record does not exist
mu_check(furi_record_exists(TEST_RECORD_NAME) == false); mu_check(furi_record_exists(TEST_RECORD_NAME) == false);

View file

@ -462,7 +462,7 @@ MU_TEST_SUITE(test_suite) {
MU_RUN_TEST(mu_test_furi_string_utf8); MU_RUN_TEST(mu_test_furi_string_utf8);
} }
int run_minunit_test_furi_string() { int run_minunit_test_furi_string(void) {
MU_RUN_SUITE(test_suite); MU_RUN_SUITE(test_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;

View file

@ -50,7 +50,7 @@ MU_TEST_SUITE(test_suite) {
MU_RUN_TEST(mu_test_furi_memmgr); MU_RUN_TEST(mu_test_furi_memmgr);
} }
int run_minunit_test_furi() { int run_minunit_test_furi(void) {
MU_RUN_SUITE(test_suite); MU_RUN_SUITE(test_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;

View file

@ -409,16 +409,16 @@ static const uint8_t tv_gcm_tag_4[16] = {
0x1B, 0x1B,
}; };
static void furi_hal_crypto_ctr_setup() { static void furi_hal_crypto_ctr_setup(void) {
} }
static void furi_hal_crypto_ctr_teardown() { static void furi_hal_crypto_ctr_teardown(void) {
} }
static void furi_hal_crypto_gcm_setup() { static void furi_hal_crypto_gcm_setup(void) {
} }
static void furi_hal_crypto_gcm_teardown() { static void furi_hal_crypto_gcm_teardown(void) {
} }
MU_TEST(furi_hal_crypto_ctr_1) { MU_TEST(furi_hal_crypto_ctr_1) {
@ -595,7 +595,7 @@ MU_TEST_SUITE(furi_hal_crypto_gcm_test) {
MU_RUN_TEST(furi_hal_crypto_gcm_4); MU_RUN_TEST(furi_hal_crypto_gcm_4);
} }
int run_minunit_test_furi_hal_crypto() { int run_minunit_test_furi_hal_crypto(void) {
MU_RUN_SUITE(furi_hal_crypto_ctr_test); MU_RUN_SUITE(furi_hal_crypto_ctr_test);
MU_RUN_SUITE(furi_hal_crypto_gcm_test); MU_RUN_SUITE(furi_hal_crypto_gcm_test);
return MU_EXIT_CODE; return MU_EXIT_CODE;

View file

@ -14,19 +14,19 @@
#define EEPROM_PAGE_SIZE 16 #define EEPROM_PAGE_SIZE 16
#define EEPROM_WRITE_DELAY_MS 6 #define EEPROM_WRITE_DELAY_MS 6
static void furi_hal_i2c_int_setup() { static void furi_hal_i2c_int_setup(void) {
furi_hal_i2c_acquire(&furi_hal_i2c_handle_power); furi_hal_i2c_acquire(&furi_hal_i2c_handle_power);
} }
static void furi_hal_i2c_int_teardown() { static void furi_hal_i2c_int_teardown(void) {
furi_hal_i2c_release(&furi_hal_i2c_handle_power); furi_hal_i2c_release(&furi_hal_i2c_handle_power);
} }
static void furi_hal_i2c_ext_setup() { static void furi_hal_i2c_ext_setup(void) {
furi_hal_i2c_acquire(&furi_hal_i2c_handle_external); furi_hal_i2c_acquire(&furi_hal_i2c_handle_external);
} }
static void furi_hal_i2c_ext_teardown() { static void furi_hal_i2c_ext_teardown(void) {
furi_hal_i2c_release(&furi_hal_i2c_handle_external); furi_hal_i2c_release(&furi_hal_i2c_handle_external);
} }
@ -227,7 +227,7 @@ MU_TEST_SUITE(furi_hal_i2c_ext_suite) {
MU_RUN_TEST(furi_hal_i2c_ext_eeprom); MU_RUN_TEST(furi_hal_i2c_ext_eeprom);
} }
int run_minunit_test_furi_hal() { int run_minunit_test_furi_hal(void) {
MU_RUN_SUITE(furi_hal_i2c_int_suite); MU_RUN_SUITE(furi_hal_i2c_int_suite);
MU_RUN_SUITE(furi_hal_i2c_ext_suite); MU_RUN_SUITE(furi_hal_i2c_ext_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;

View file

@ -17,7 +17,7 @@ typedef struct {
static InfraredTest* test; static InfraredTest* test;
static void infrared_test_alloc() { static void infrared_test_alloc(void) {
Storage* storage = furi_record_open(RECORD_STORAGE); Storage* storage = furi_record_open(RECORD_STORAGE);
test = malloc(sizeof(InfraredTest)); test = malloc(sizeof(InfraredTest));
test->decoder_handler = infrared_alloc_decoder(); test->decoder_handler = infrared_alloc_decoder();
@ -26,7 +26,7 @@ static void infrared_test_alloc() {
test->file_path = furi_string_alloc(); test->file_path = furi_string_alloc();
} }
static void infrared_test_free() { static void infrared_test_free(void) {
furi_check(test); furi_check(test);
infrared_free_decoder(test->decoder_handler); infrared_free_decoder(test->decoder_handler);
infrared_free_encoder(test->encoder_handler); infrared_free_encoder(test->encoder_handler);
@ -543,7 +543,7 @@ MU_TEST_SUITE(infrared_test) {
MU_RUN_TEST(infrared_test_encoder_decoder_all); MU_RUN_TEST(infrared_test_encoder_decoder_all);
} }
int run_minunit_test_infrared() { int run_minunit_test_infrared(void) {
MU_RUN_SUITE(infrared_test); MU_RUN_SUITE(infrared_test);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }

View file

@ -547,7 +547,7 @@ MU_TEST_SUITE(test_lfrfid_protocols_suite) {
MU_RUN_TEST(test_lfrfid_protocol_fdxb_emulate_simple); MU_RUN_TEST(test_lfrfid_protocol_fdxb_emulate_simple);
} }
int run_minunit_test_lfrfid_protocols() { int run_minunit_test_lfrfid_protocols(void) {
MU_RUN_SUITE(test_lfrfid_protocols_suite); MU_RUN_SUITE(test_lfrfid_protocols_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }

View file

@ -69,7 +69,7 @@ MU_TEST_SUITE(manifest_suite) {
MU_RUN_TEST(manifest_iteration_test); MU_RUN_TEST(manifest_iteration_test);
} }
int run_minunit_test_manifest() { int run_minunit_test_manifest(void) {
MU_RUN_SUITE(manifest_suite); MU_RUN_SUITE(manifest_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }

View file

@ -28,12 +28,12 @@ typedef struct {
static NfcTest* nfc_test = NULL; static NfcTest* nfc_test = NULL;
static void nfc_test_alloc() { static void nfc_test_alloc(void) {
nfc_test = malloc(sizeof(NfcTest)); nfc_test = malloc(sizeof(NfcTest));
nfc_test->storage = furi_record_open(RECORD_STORAGE); nfc_test->storage = furi_record_open(RECORD_STORAGE);
} }
static void nfc_test_free() { static void nfc_test_free(void) {
furi_check(nfc_test); furi_check(nfc_test);
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
@ -292,7 +292,7 @@ MU_TEST(ntag_213_locked_reader) {
nfc_free(poller); nfc_free(poller);
} }
static void mf_ultralight_write() { static void mf_ultralight_write(void) {
Nfc* poller = nfc_alloc(); Nfc* poller = nfc_alloc();
Nfc* listener = nfc_alloc(); Nfc* listener = nfc_alloc();
@ -342,7 +342,7 @@ static void mf_ultralight_write() {
nfc_free(poller); nfc_free(poller);
} }
static void mf_classic_reader() { static void mf_classic_reader(void) {
Nfc* poller = nfc_alloc(); Nfc* poller = nfc_alloc();
Nfc* listener = nfc_alloc(); Nfc* listener = nfc_alloc();
@ -368,7 +368,7 @@ static void mf_classic_reader() {
nfc_free(poller); nfc_free(poller);
} }
static void mf_classic_write() { static void mf_classic_write(void) {
Nfc* poller = nfc_alloc(); Nfc* poller = nfc_alloc();
Nfc* listener = nfc_alloc(); Nfc* listener = nfc_alloc();
@ -396,7 +396,7 @@ static void mf_classic_write() {
nfc_free(poller); nfc_free(poller);
} }
static void mf_classic_value_block() { static void mf_classic_value_block(void) {
Nfc* poller = nfc_alloc(); Nfc* poller = nfc_alloc();
Nfc* listener = nfc_alloc(); Nfc* listener = nfc_alloc();
@ -548,7 +548,7 @@ MU_TEST_SUITE(nfc) {
nfc_test_free(); nfc_test_free();
} }
int run_minunit_test_nfc() { int run_minunit_test_nfc(void) {
MU_RUN_SUITE(nfc); MU_RUN_SUITE(nfc);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }

View file

@ -115,7 +115,7 @@ static void nfc_prepare_col_res_data(
} }
} }
Nfc* nfc_alloc() { Nfc* nfc_alloc(void) {
Nfc* instance = malloc(sizeof(Nfc)); Nfc* instance = malloc(sizeof(Nfc));
return instance; return instance;

View file

@ -63,7 +63,7 @@ MU_TEST_SUITE(test_power_suite) {
power_test_deinit(); power_test_deinit();
} }
int run_minunit_test_power() { int run_minunit_test_power(void) {
MU_RUN_SUITE(test_power_suite); MU_RUN_SUITE(test_power_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }

View file

@ -18,7 +18,7 @@ typedef struct {
static const uint32_t protocol_0_decoder_result = 0xDEADBEEF; static const uint32_t protocol_0_decoder_result = 0xDEADBEEF;
static void* protocol_0_alloc() { static void* protocol_0_alloc(void) {
void* data = malloc(sizeof(Protocol0Data)); void* data = malloc(sizeof(Protocol0Data));
return data; return data;
} }
@ -63,7 +63,7 @@ typedef struct {
static const uint64_t protocol_1_decoder_result = 0x1234567890ABCDEF; static const uint64_t protocol_1_decoder_result = 0x1234567890ABCDEF;
static void* protocol_1_alloc() { static void* protocol_1_alloc(void) {
void* data = malloc(sizeof(Protocol1Data)); void* data = malloc(sizeof(Protocol1Data));
return data; return data;
} }
@ -216,7 +216,7 @@ MU_TEST_SUITE(test_protocol_dict_suite) {
MU_RUN_TEST(test_protocol_dict); MU_RUN_TEST(test_protocol_dict);
} }
int run_minunit_test_protocol_dict() { int run_minunit_test_protocol_dict(void) {
MU_RUN_SUITE(test_protocol_dict_suite); MU_RUN_SUITE(test_protocol_dict_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }

View file

@ -1840,7 +1840,7 @@ MU_TEST_SUITE(test_rpc_session) {
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
} }
int run_minunit_test_rpc() { int run_minunit_test_rpc(void) {
Storage* storage = furi_record_open(RECORD_STORAGE); Storage* storage = furi_record_open(RECORD_STORAGE);
if(storage_sd_status(storage) != FSE_OK) { if(storage_sd_status(storage) != FSE_OK) {
FURI_LOG_E(TAG, "SD card not mounted - skip storage tests"); FURI_LOG_E(TAG, "SD card not mounted - skip storage tests");

View file

@ -266,7 +266,7 @@ MU_TEST_SUITE(test_dirwalk_suite) {
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
} }
int run_minunit_test_dirwalk() { int run_minunit_test_dirwalk(void) {
MU_RUN_SUITE(test_dirwalk_suite); MU_RUN_SUITE(test_dirwalk_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }

View file

@ -36,7 +36,7 @@ static bool storage_file_create(Storage* storage, const char* path, const char*
return result; return result;
} }
static void storage_file_open_lock_setup() { static void storage_file_open_lock_setup(void) {
Storage* storage = furi_record_open(RECORD_STORAGE); Storage* storage = furi_record_open(RECORD_STORAGE);
File* file = storage_file_alloc(storage); File* file = storage_file_alloc(storage);
storage_simply_remove(storage, STORAGE_LOCKED_FILE); storage_simply_remove(storage, STORAGE_LOCKED_FILE);
@ -47,7 +47,7 @@ static void storage_file_open_lock_setup() {
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
} }
static void storage_file_open_lock_teardown() { static void storage_file_open_lock_teardown(void) {
Storage* storage = furi_record_open(RECORD_STORAGE); Storage* storage = furi_record_open(RECORD_STORAGE);
mu_check(storage_simply_remove(storage, STORAGE_LOCKED_FILE)); mu_check(storage_simply_remove(storage, STORAGE_LOCKED_FILE));
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
@ -702,7 +702,7 @@ MU_TEST_SUITE(test_md5_calc_suite) {
MU_RUN_TEST(test_md5_calc); MU_RUN_TEST(test_md5_calc);
} }
int run_minunit_test_storage() { int run_minunit_test_storage(void) {
MU_RUN_SUITE(storage_file); MU_RUN_SUITE(storage_file);
MU_RUN_SUITE(storage_file_64k); MU_RUN_SUITE(storage_file_64k);
MU_RUN_SUITE(storage_dir); MU_RUN_SUITE(storage_dir);

View file

@ -526,7 +526,7 @@ MU_TEST_SUITE(stream_suite) {
MU_RUN_TEST(stream_buffered_large_file_test); MU_RUN_TEST(stream_buffered_large_file_test);
} }
int run_minunit_test_stream() { int run_minunit_test_stream(void) {
MU_RUN_SUITE(stream_suite); MU_RUN_SUITE(stream_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }

View file

@ -314,7 +314,7 @@ static LevelDuration subghz_hal_async_tx_test_yield(void* context) {
furi_crash("Yield after reset"); furi_crash("Yield after reset");
} }
} else { } else {
furi_crash("Programming error"); furi_crash();
} }
} }
@ -904,7 +904,7 @@ MU_TEST_SUITE(subghz) {
subghz_test_deinit(); subghz_test_deinit();
} }
int run_minunit_test_subghz() { int run_minunit_test_subghz(void) {
MU_RUN_SUITE(subghz); MU_RUN_SUITE(subghz);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }

View file

@ -66,7 +66,7 @@ const UnitTest unit_tests[] = {
{.name = "expansion", .entry = run_minunit_test_expansion}, {.name = "expansion", .entry = run_minunit_test_expansion},
}; };
void minunit_print_progress() { void minunit_print_progress(void) {
static const char progress[] = {'\\', '|', '/', '-'}; static const char progress[] = {'\\', '|', '/', '-'};
static uint8_t progress_counter = 0; static uint8_t progress_counter = 0;
static uint32_t last_tick = 0; static uint32_t last_tick = 0;
@ -157,7 +157,7 @@ void unit_tests_cli(Cli* cli, FuriString* args, void* context) {
furi_record_close(RECORD_LOADER); furi_record_close(RECORD_LOADER);
} }
void unit_tests_on_system_start() { void unit_tests_on_system_start(void) {
#ifdef SRV_CLI #ifdef SRV_CLI
Cli* cli = furi_record_open(RECORD_CLI); Cli* cli = furi_record_open(RECORD_CLI);

View file

@ -82,7 +82,7 @@ MU_TEST_SUITE(test_varint_suite) {
MU_RUN_TEST(test_varint_rand_i); MU_RUN_TEST(test_varint_rand_i);
} }
int run_minunit_test_varint() { int run_minunit_test_varint(void) {
MU_RUN_SUITE(test_varint_suite); MU_RUN_SUITE(test_varint_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }

View file

@ -55,7 +55,7 @@ uint32_t usb_test_exit(void* context) {
return VIEW_NONE; return VIEW_NONE;
} }
UsbTestApp* usb_test_app_alloc() { UsbTestApp* usb_test_app_alloc(void) {
UsbTestApp* app = malloc(sizeof(UsbTestApp)); UsbTestApp* app = malloc(sizeof(UsbTestApp));
// Gui // Gui

View file

@ -93,7 +93,7 @@ typedef struct {
static SubGhzDeviceCC1101Ext* subghz_device_cc1101_ext = NULL; static SubGhzDeviceCC1101Ext* subghz_device_cc1101_ext = NULL;
static bool subghz_device_cc1101_ext_check_init() { static bool subghz_device_cc1101_ext_check_init(void) {
furi_assert(subghz_device_cc1101_ext->state == SubGhzDeviceCC1101ExtStateInit); furi_assert(subghz_device_cc1101_ext->state == SubGhzDeviceCC1101ExtStateInit);
subghz_device_cc1101_ext->state = SubGhzDeviceCC1101ExtStateIdle; subghz_device_cc1101_ext->state = SubGhzDeviceCC1101ExtStateIdle;
@ -198,7 +198,7 @@ static bool subghz_device_cc1101_ext_check_init() {
return ret; return ret;
} }
bool subghz_device_cc1101_ext_alloc() { bool subghz_device_cc1101_ext_alloc(void) {
furi_assert(subghz_device_cc1101_ext == NULL); furi_assert(subghz_device_cc1101_ext == NULL);
subghz_device_cc1101_ext = malloc(sizeof(SubGhzDeviceCC1101Ext)); subghz_device_cc1101_ext = malloc(sizeof(SubGhzDeviceCC1101Ext));
subghz_device_cc1101_ext->state = SubGhzDeviceCC1101ExtStateInit; subghz_device_cc1101_ext->state = SubGhzDeviceCC1101ExtStateInit;
@ -213,7 +213,7 @@ bool subghz_device_cc1101_ext_alloc() {
return subghz_device_cc1101_ext_check_init(); return subghz_device_cc1101_ext_check_init();
} }
void subghz_device_cc1101_ext_free() { void subghz_device_cc1101_ext_free(void) {
furi_assert(subghz_device_cc1101_ext != NULL); furi_assert(subghz_device_cc1101_ext != NULL);
furi_hal_spi_bus_handle_deinit(subghz_device_cc1101_ext->spi_bus_handle); furi_hal_spi_bus_handle_deinit(subghz_device_cc1101_ext->spi_bus_handle);
free(subghz_device_cc1101_ext); free(subghz_device_cc1101_ext);
@ -224,11 +224,11 @@ void subghz_device_cc1101_ext_set_async_mirror_pin(const GpioPin* pin) {
subghz_device_cc1101_ext->async_mirror_pin = pin; subghz_device_cc1101_ext->async_mirror_pin = pin;
} }
const GpioPin* subghz_device_cc1101_ext_get_data_gpio() { const GpioPin* subghz_device_cc1101_ext_get_data_gpio(void) {
return subghz_device_cc1101_ext->g0_pin; return subghz_device_cc1101_ext->g0_pin;
} }
bool subghz_device_cc1101_ext_is_connect() { bool subghz_device_cc1101_ext_is_connect(void) {
bool ret = false; bool ret = false;
if(subghz_device_cc1101_ext == NULL) { // not initialized if(subghz_device_cc1101_ext == NULL) { // not initialized
@ -244,7 +244,7 @@ bool subghz_device_cc1101_ext_is_connect() {
return ret; return ret;
} }
void subghz_device_cc1101_ext_sleep() { void subghz_device_cc1101_ext_sleep(void) {
furi_assert(subghz_device_cc1101_ext->state == SubGhzDeviceCC1101ExtStateIdle); furi_assert(subghz_device_cc1101_ext->state == SubGhzDeviceCC1101ExtStateIdle);
furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle); furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle);
@ -259,7 +259,7 @@ void subghz_device_cc1101_ext_sleep() {
furi_hal_spi_release(subghz_device_cc1101_ext->spi_bus_handle); furi_hal_spi_release(subghz_device_cc1101_ext->spi_bus_handle);
} }
void subghz_device_cc1101_ext_dump_state() { void subghz_device_cc1101_ext_dump_state(void) {
furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle); furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle);
printf( printf(
"[subghz_device_cc1101_ext] cc1101 chip %d, version %d\r\n", "[subghz_device_cc1101_ext] cc1101 chip %d, version %d\r\n",
@ -324,19 +324,19 @@ void subghz_device_cc1101_ext_write_packet(const uint8_t* data, uint8_t size) {
furi_hal_spi_release(subghz_device_cc1101_ext->spi_bus_handle); furi_hal_spi_release(subghz_device_cc1101_ext->spi_bus_handle);
} }
void subghz_device_cc1101_ext_flush_rx() { void subghz_device_cc1101_ext_flush_rx(void) {
furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle); furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle);
cc1101_flush_rx(subghz_device_cc1101_ext->spi_bus_handle); cc1101_flush_rx(subghz_device_cc1101_ext->spi_bus_handle);
furi_hal_spi_release(subghz_device_cc1101_ext->spi_bus_handle); furi_hal_spi_release(subghz_device_cc1101_ext->spi_bus_handle);
} }
void subghz_device_cc1101_ext_flush_tx() { void subghz_device_cc1101_ext_flush_tx(void) {
furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle); furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle);
cc1101_flush_tx(subghz_device_cc1101_ext->spi_bus_handle); cc1101_flush_tx(subghz_device_cc1101_ext->spi_bus_handle);
furi_hal_spi_release(subghz_device_cc1101_ext->spi_bus_handle); furi_hal_spi_release(subghz_device_cc1101_ext->spi_bus_handle);
} }
bool subghz_device_cc1101_ext_rx_pipe_not_empty() { bool subghz_device_cc1101_ext_rx_pipe_not_empty(void) {
CC1101RxBytes status[1]; CC1101RxBytes status[1];
furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle); furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle);
cc1101_read_reg( cc1101_read_reg(
@ -351,7 +351,7 @@ bool subghz_device_cc1101_ext_rx_pipe_not_empty() {
} }
} }
bool subghz_device_cc1101_ext_is_rx_data_crc_valid() { bool subghz_device_cc1101_ext_is_rx_data_crc_valid(void) {
furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle); furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle);
uint8_t data[1]; uint8_t data[1];
cc1101_read_reg( cc1101_read_reg(
@ -370,14 +370,14 @@ void subghz_device_cc1101_ext_read_packet(uint8_t* data, uint8_t* size) {
furi_hal_spi_release(subghz_device_cc1101_ext->spi_bus_handle); furi_hal_spi_release(subghz_device_cc1101_ext->spi_bus_handle);
} }
void subghz_device_cc1101_ext_shutdown() { void subghz_device_cc1101_ext_shutdown(void) {
furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle); furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle);
// Reset and shutdown // Reset and shutdown
cc1101_shutdown(subghz_device_cc1101_ext->spi_bus_handle); cc1101_shutdown(subghz_device_cc1101_ext->spi_bus_handle);
furi_hal_spi_release(subghz_device_cc1101_ext->spi_bus_handle); furi_hal_spi_release(subghz_device_cc1101_ext->spi_bus_handle);
} }
void subghz_device_cc1101_ext_reset() { void subghz_device_cc1101_ext_reset(void) {
furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle); furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle);
furi_hal_gpio_init(subghz_device_cc1101_ext->g0_pin, GpioModeAnalog, GpioPullNo, GpioSpeedLow); furi_hal_gpio_init(subghz_device_cc1101_ext->g0_pin, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
cc1101_switch_to_idle(subghz_device_cc1101_ext->spi_bus_handle); cc1101_switch_to_idle(subghz_device_cc1101_ext->spi_bus_handle);
@ -388,7 +388,7 @@ void subghz_device_cc1101_ext_reset() {
furi_hal_spi_release(subghz_device_cc1101_ext->spi_bus_handle); furi_hal_spi_release(subghz_device_cc1101_ext->spi_bus_handle);
} }
void subghz_device_cc1101_ext_idle() { void subghz_device_cc1101_ext_idle(void) {
furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle); furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle);
cc1101_switch_to_idle(subghz_device_cc1101_ext->spi_bus_handle); cc1101_switch_to_idle(subghz_device_cc1101_ext->spi_bus_handle);
//waiting for the chip to switch to IDLE mode //waiting for the chip to switch to IDLE mode
@ -397,7 +397,7 @@ void subghz_device_cc1101_ext_idle() {
furi_hal_spi_release(subghz_device_cc1101_ext->spi_bus_handle); furi_hal_spi_release(subghz_device_cc1101_ext->spi_bus_handle);
} }
void subghz_device_cc1101_ext_rx() { void subghz_device_cc1101_ext_rx(void) {
furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle); furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle);
cc1101_switch_to_rx(subghz_device_cc1101_ext->spi_bus_handle); cc1101_switch_to_rx(subghz_device_cc1101_ext->spi_bus_handle);
//waiting for the chip to switch to Rx mode //waiting for the chip to switch to Rx mode
@ -406,7 +406,7 @@ void subghz_device_cc1101_ext_rx() {
furi_hal_spi_release(subghz_device_cc1101_ext->spi_bus_handle); furi_hal_spi_release(subghz_device_cc1101_ext->spi_bus_handle);
} }
bool subghz_device_cc1101_ext_tx() { bool subghz_device_cc1101_ext_tx(void) {
if(subghz_device_cc1101_ext->regulation != SubGhzDeviceCC1101ExtRegulationTxRx) return false; if(subghz_device_cc1101_ext->regulation != SubGhzDeviceCC1101ExtRegulationTxRx) return false;
furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle); furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle);
cc1101_switch_to_tx(subghz_device_cc1101_ext->spi_bus_handle); cc1101_switch_to_tx(subghz_device_cc1101_ext->spi_bus_handle);
@ -417,7 +417,7 @@ bool subghz_device_cc1101_ext_tx() {
return true; return true;
} }
float subghz_device_cc1101_ext_get_rssi() { float subghz_device_cc1101_ext_get_rssi(void) {
furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle); furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle);
int32_t rssi_dec = cc1101_get_rssi(subghz_device_cc1101_ext->spi_bus_handle); int32_t rssi_dec = cc1101_get_rssi(subghz_device_cc1101_ext->spi_bus_handle);
furi_hal_spi_release(subghz_device_cc1101_ext->spi_bus_handle); furi_hal_spi_release(subghz_device_cc1101_ext->spi_bus_handle);
@ -432,7 +432,7 @@ float subghz_device_cc1101_ext_get_rssi() {
return rssi; return rssi;
} }
uint8_t subghz_device_cc1101_ext_get_lqi() { uint8_t subghz_device_cc1101_ext_get_lqi(void) {
furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle); furi_hal_spi_acquire(subghz_device_cc1101_ext->spi_bus_handle);
uint8_t data[1]; uint8_t data[1];
cc1101_read_reg( cc1101_read_reg(
@ -472,7 +472,7 @@ uint32_t subghz_device_cc1101_ext_set_frequency(uint32_t value) {
return real_frequency; return real_frequency;
} }
static bool subghz_device_cc1101_ext_start_debug() { static bool subghz_device_cc1101_ext_start_debug(void) {
bool ret = false; bool ret = false;
if(subghz_device_cc1101_ext->async_mirror_pin != NULL) { if(subghz_device_cc1101_ext->async_mirror_pin != NULL) {
furi_hal_gpio_init( furi_hal_gpio_init(
@ -485,7 +485,7 @@ static bool subghz_device_cc1101_ext_start_debug() {
return ret; return ret;
} }
static bool subghz_device_cc1101_ext_stop_debug() { static bool subghz_device_cc1101_ext_stop_debug(void) {
bool ret = false; bool ret = false;
if(subghz_device_cc1101_ext->async_mirror_pin != NULL) { if(subghz_device_cc1101_ext->async_mirror_pin != NULL) {
furi_hal_gpio_init( furi_hal_gpio_init(
@ -567,7 +567,7 @@ void subghz_device_cc1101_ext_start_async_rx(
subghz_device_cc1101_ext->async_rx.capture_delta_duration = 0; subghz_device_cc1101_ext->async_rx.capture_delta_duration = 0;
} }
void subghz_device_cc1101_ext_stop_async_rx() { void subghz_device_cc1101_ext_stop_async_rx(void) {
furi_assert(subghz_device_cc1101_ext->state == SubGhzDeviceCC1101ExtStateAsyncRx); furi_assert(subghz_device_cc1101_ext->state == SubGhzDeviceCC1101ExtStateAsyncRx);
subghz_device_cc1101_ext->state = SubGhzDeviceCC1101ExtStateIdle; subghz_device_cc1101_ext->state = SubGhzDeviceCC1101ExtStateIdle;
@ -805,13 +805,13 @@ bool subghz_device_cc1101_ext_start_async_tx(SubGhzDeviceCC1101ExtCallback callb
return true; return true;
} }
bool subghz_device_cc1101_ext_is_async_tx_complete() { bool subghz_device_cc1101_ext_is_async_tx_complete(void) {
return ( return (
(subghz_device_cc1101_ext->state == SubGhzDeviceCC1101ExtStateAsyncTx) && (subghz_device_cc1101_ext->state == SubGhzDeviceCC1101ExtStateAsyncTx) &&
(LL_TIM_GetAutoReload(TIM17) == 0)); (LL_TIM_GetAutoReload(TIM17) == 0));
} }
void subghz_device_cc1101_ext_stop_async_tx() { void subghz_device_cc1101_ext_stop_async_tx(void) {
furi_assert(subghz_device_cc1101_ext->state == SubGhzDeviceCC1101ExtStateAsyncTx); furi_assert(subghz_device_cc1101_ext->state == SubGhzDeviceCC1101ExtStateAsyncTx);
// Shutdown radio // Shutdown radio

View file

@ -28,31 +28,31 @@ void subghz_device_cc1101_ext_set_async_mirror_pin(const GpioPin* pin);
* *
* @return pointer to the gpio pin structure * @return pointer to the gpio pin structure
*/ */
const GpioPin* subghz_device_cc1101_ext_get_data_gpio(); const GpioPin* subghz_device_cc1101_ext_get_data_gpio(void);
/** Initialize device /** Initialize device
* *
* @return true if success * @return true if success
*/ */
bool subghz_device_cc1101_ext_alloc(); bool subghz_device_cc1101_ext_alloc(void);
/** Deinitialize device /** Deinitialize device
*/ */
void subghz_device_cc1101_ext_free(); void subghz_device_cc1101_ext_free(void);
/** Check and switch to power save mode Used by internal API-HAL /** Check and switch to power save mode Used by internal API-HAL
* initialization routine Can be used to reinitialize device to safe state and * initialization routine Can be used to reinitialize device to safe state and
* send it to sleep * send it to sleep
*/ */
bool subghz_device_cc1101_ext_is_connect(); bool subghz_device_cc1101_ext_is_connect(void);
/** Send device to sleep mode /** Send device to sleep mode
*/ */
void subghz_device_cc1101_ext_sleep(); void subghz_device_cc1101_ext_sleep(void);
/** Dump info to stdout /** Dump info to stdout
*/ */
void subghz_device_cc1101_ext_dump_state(); void subghz_device_cc1101_ext_dump_state(void);
/** Load custom registers from preset /** Load custom registers from preset
* *
@ -83,13 +83,13 @@ void subghz_device_cc1101_ext_write_packet(const uint8_t* data, uint8_t size);
* *
* @return true if not empty * @return true if not empty
*/ */
bool subghz_device_cc1101_ext_rx_pipe_not_empty(); bool subghz_device_cc1101_ext_rx_pipe_not_empty(void);
/** Check if received data crc is valid /** Check if received data crc is valid
* *
* @return true if valid * @return true if valid
*/ */
bool subghz_device_cc1101_ext_is_rx_data_crc_valid(); bool subghz_device_cc1101_ext_is_rx_data_crc_valid(void);
/** Read packet from FIFO /** Read packet from FIFO
* *
@ -100,47 +100,47 @@ void subghz_device_cc1101_ext_read_packet(uint8_t* data, uint8_t* size);
/** Flush rx FIFO buffer /** Flush rx FIFO buffer
*/ */
void subghz_device_cc1101_ext_flush_rx(); void subghz_device_cc1101_ext_flush_rx(void);
/** Flush tx FIFO buffer /** Flush tx FIFO buffer
*/ */
void subghz_device_cc1101_ext_flush_tx(); void subghz_device_cc1101_ext_flush_tx(void);
/** Shutdown Issue SPWD command /** Shutdown Issue SPWD command
* @warning registers content will be lost * @warning registers content will be lost
*/ */
void subghz_device_cc1101_ext_shutdown(); void subghz_device_cc1101_ext_shutdown(void);
/** Reset Issue reset command /** Reset Issue reset command
* @warning registers content will be lost * @warning registers content will be lost
*/ */
void subghz_device_cc1101_ext_reset(); void subghz_device_cc1101_ext_reset(void);
/** Switch to Idle /** Switch to Idle
*/ */
void subghz_device_cc1101_ext_idle(); void subghz_device_cc1101_ext_idle(void);
/** Switch to Receive /** Switch to Receive
*/ */
void subghz_device_cc1101_ext_rx(); void subghz_device_cc1101_ext_rx(void);
/** Switch to Transmit /** Switch to Transmit
* *
* @return true if the transfer is allowed by belonging to the region * @return true if the transfer is allowed by belonging to the region
*/ */
bool subghz_device_cc1101_ext_tx(); bool subghz_device_cc1101_ext_tx(void);
/** Get RSSI value in dBm /** Get RSSI value in dBm
* *
* @return RSSI value * @return RSSI value
*/ */
float subghz_device_cc1101_ext_get_rssi(); float subghz_device_cc1101_ext_get_rssi(void);
/** Get LQI /** Get LQI
* *
* @return LQI value * @return LQI value
*/ */
uint8_t subghz_device_cc1101_ext_get_lqi(); uint8_t subghz_device_cc1101_ext_get_lqi(void);
/** Check if frequency is in valid range /** Check if frequency is in valid range
* *
@ -174,7 +174,7 @@ void subghz_device_cc1101_ext_start_async_rx(
/** Disable signal timings capture Resets GPIO and TIM2 /** Disable signal timings capture Resets GPIO and TIM2
*/ */
void subghz_device_cc1101_ext_stop_async_rx(); void subghz_device_cc1101_ext_stop_async_rx(void);
/** Async TX callback type /** Async TX callback type
* @param context callback context * @param context callback context
@ -195,11 +195,11 @@ bool subghz_device_cc1101_ext_start_async_tx(SubGhzDeviceCC1101ExtCallback callb
* *
* @return true if TX complete * @return true if TX complete
*/ */
bool subghz_device_cc1101_ext_is_async_tx_complete(); bool subghz_device_cc1101_ext_is_async_tx_complete(void);
/** Stop async transmission and cleanup resources Resets GPIO, TIM2, and DMA1 /** Stop async transmission and cleanup resources Resets GPIO, TIM2, and DMA1
*/ */
void subghz_device_cc1101_ext_stop_async_tx(); void subghz_device_cc1101_ext_stop_async_tx(void);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -105,6 +105,6 @@ static const FlipperAppPluginDescriptor subghz_device_cc1101_ext_descriptor = {
.entry_point = &subghz_device_cc1101_ext, .entry_point = &subghz_device_cc1101_ext,
}; };
const FlipperAppPluginDescriptor* subghz_device_cc1101_ext_ep() { const FlipperAppPluginDescriptor* subghz_device_cc1101_ext_ep(void) {
return &subghz_device_cc1101_ext_descriptor; return &subghz_device_cc1101_ext_descriptor;
} }

View file

@ -5,4 +5,4 @@
typedef struct SubGhzDeviceCC1101Ext SubGhzDeviceCC1101Ext; typedef struct SubGhzDeviceCC1101Ext SubGhzDeviceCC1101Ext;
const FlipperAppPluginDescriptor* subghz_device_cc1101_ext_ep(); const FlipperAppPluginDescriptor* subghz_device_cc1101_ext_ep(void);

View file

@ -57,7 +57,7 @@ static void ble_beacon_app_restore_beacon_state(BleBeaconApp* app) {
app->beacon_data_len = furi_hal_bt_extra_beacon_get_data(app->beacon_data); app->beacon_data_len = furi_hal_bt_extra_beacon_get_data(app->beacon_data);
} }
static BleBeaconApp* ble_beacon_app_alloc() { static BleBeaconApp* ble_beacon_app_alloc(void) {
BleBeaconApp* app = malloc(sizeof(BleBeaconApp)); BleBeaconApp* app = malloc(sizeof(BleBeaconApp));
app->gui = furi_record_open(RECORD_GUI); app->gui = furi_record_open(RECORD_GUI);

View file

@ -9,7 +9,7 @@
#include <flipper_application/flipper_application.h> #include <flipper_application/flipper_application.h>
static int example_plugin1_method1() { static int example_plugin1_method1(void) {
return 42; return 42;
} }
@ -32,6 +32,6 @@ static const FlipperAppPluginDescriptor example_plugin1_descriptor = {
}; };
/* Plugin entry point - must return a pointer to const descriptor */ /* Plugin entry point - must return a pointer to const descriptor */
const FlipperAppPluginDescriptor* example_plugin1_ep() { const FlipperAppPluginDescriptor* example_plugin1_ep(void) {
return &example_plugin1_descriptor; return &example_plugin1_descriptor;
} }

View file

@ -9,7 +9,7 @@
#include <flipper_application/flipper_application.h> #include <flipper_application/flipper_application.h>
static int example_plugin2_method1() { static int example_plugin2_method1(void) {
return 1337; return 1337;
} }
@ -32,6 +32,6 @@ static const FlipperAppPluginDescriptor example_plugin2_descriptor = {
}; };
/* Plugin entry point - must return a pointer to const descriptor */ /* Plugin entry point - must return a pointer to const descriptor */
const FlipperAppPluginDescriptor* example_plugin2_ep() { const FlipperAppPluginDescriptor* example_plugin2_ep(void) {
return &example_plugin2_descriptor; return &example_plugin2_descriptor;
} }

View file

@ -11,6 +11,6 @@
typedef struct { typedef struct {
const char* name; const char* name;
int (*method1)(); int (*method1)(void);
int (*method2)(int, int); int (*method2)(int, int);
} ExamplePlugin; } ExamplePlugin;

View file

@ -8,7 +8,7 @@ void app_api_accumulator_set(uint32_t value) {
accumulator = value; accumulator = value;
} }
uint32_t app_api_accumulator_get() { uint32_t app_api_accumulator_get(void) {
return accumulator; return accumulator;
} }

View file

@ -15,7 +15,7 @@ extern "C" {
void app_api_accumulator_set(uint32_t value); void app_api_accumulator_set(uint32_t value);
uint32_t app_api_accumulator_get(); uint32_t app_api_accumulator_get(void);
void app_api_accumulator_add(uint32_t value); void app_api_accumulator_add(uint32_t value);

View file

@ -18,7 +18,7 @@ static void advanced_plugin1_method1(int arg1) {
app_api_accumulator_add(arg1); app_api_accumulator_add(arg1);
} }
static void advanced_plugin1_method2() { static void advanced_plugin1_method2(void) {
/* Accumulator value is stored inside host application */ /* Accumulator value is stored inside host application */
FURI_LOG_I("TEST", "Plugin 1, accumulator: %lu", app_api_accumulator_get()); FURI_LOG_I("TEST", "Plugin 1, accumulator: %lu", app_api_accumulator_get());
} }
@ -38,6 +38,6 @@ static const FlipperAppPluginDescriptor advanced_plugin1_descriptor = {
}; };
/* Plugin entry point - must return a pointer to const descriptor */ /* Plugin entry point - must return a pointer to const descriptor */
const FlipperAppPluginDescriptor* advanced_plugin1_ep() { const FlipperAppPluginDescriptor* advanced_plugin1_ep(void) {
return &advanced_plugin1_descriptor; return &advanced_plugin1_descriptor;
} }

View file

@ -18,7 +18,7 @@ static void advanced_plugin2_method1(int arg1) {
app_api_accumulator_mul(arg1); app_api_accumulator_mul(arg1);
} }
static void advanced_plugin2_method2() { static void advanced_plugin2_method2(void) {
/* Accumulator value is stored inside host application */ /* Accumulator value is stored inside host application */
FURI_LOG_I("TEST", "Plugin 2, accumulator: %lu", app_api_accumulator_get()); FURI_LOG_I("TEST", "Plugin 2, accumulator: %lu", app_api_accumulator_get());
} }
@ -38,6 +38,6 @@ static const FlipperAppPluginDescriptor advanced_plugin2_descriptor = {
}; };
/* Plugin entry point - must return a pointer to const descriptor */ /* Plugin entry point - must return a pointer to const descriptor */
const FlipperAppPluginDescriptor* advanced_plugin2_ep() { const FlipperAppPluginDescriptor* advanced_plugin2_ep(void) {
return &advanced_plugin2_descriptor; return &advanced_plugin2_descriptor;
} }

View file

@ -12,5 +12,5 @@
typedef struct { typedef struct {
const char* name; const char* name;
void (*method1)(int); void (*method1)(int);
void (*method2)(); void (*method2)(void);
} AdvancedPlugin; } AdvancedPlugin;

View file

@ -315,7 +315,7 @@ static void example_thermo_run(ExampleThermoContext* context) {
/******************** Initialisation & startup *****************************/ /******************** Initialisation & startup *****************************/
/* Allocate the memory and initialise the variables */ /* Allocate the memory and initialise the variables */
static ExampleThermoContext* example_thermo_context_alloc() { static ExampleThermoContext* example_thermo_context_alloc(void) {
ExampleThermoContext* context = malloc(sizeof(ExampleThermoContext)); ExampleThermoContext* context = malloc(sizeof(ExampleThermoContext));
context->view_port = view_port_alloc(); context->view_port = view_port_alloc();

View file

@ -12,7 +12,7 @@ bool archive_back_event_callback(void* context) {
return scene_manager_handle_back_event(archive->scene_manager); return scene_manager_handle_back_event(archive->scene_manager);
} }
ArchiveApp* archive_alloc() { ArchiveApp* archive_alloc(void) {
ArchiveApp* archive = malloc(sizeof(ArchiveApp)); ArchiveApp* archive = malloc(sizeof(ArchiveApp));
archive->gui = furi_record_open(RECORD_GUI); archive->gui = furi_record_open(RECORD_GUI);

View file

@ -79,7 +79,7 @@ uint16_t archive_favorites_count(void* context) {
return lines; return lines;
} }
static bool archive_favourites_rescan() { static bool archive_favourites_rescan(void) {
FuriString* buffer; FuriString* buffer;
buffer = furi_string_alloc(); buffer = furi_string_alloc();
Storage* storage = furi_record_open(RECORD_STORAGE); Storage* storage = furi_record_open(RECORD_STORAGE);

View file

@ -436,7 +436,7 @@ static void browser_view_exit(void* context) {
furi_timer_stop(browser->scroll_timer); furi_timer_stop(browser->scroll_timer);
} }
ArchiveBrowserView* browser_alloc() { ArchiveBrowserView* browser_alloc(void) {
ArchiveBrowserView* browser = malloc(sizeof(ArchiveBrowserView)); ArchiveBrowserView* browser = malloc(sizeof(ArchiveBrowserView));
browser->view = view_alloc(); browser->view = view_alloc();
view_allocate_model(browser->view, ViewModelTypeLocking, sizeof(ArchiveBrowserViewModel)); view_allocate_model(browser->view, ViewModelTypeLocking, sizeof(ArchiveBrowserViewModel));

View file

@ -111,5 +111,5 @@ void archive_browser_set_callback(
View* archive_browser_get_view(ArchiveBrowserView* browser); View* archive_browser_get_view(ArchiveBrowserView* browser);
ArchiveBrowserView* browser_alloc(); ArchiveBrowserView* browser_alloc(void);
void browser_free(ArchiveBrowserView* browser); void browser_free(ArchiveBrowserView* browser);

View file

@ -71,7 +71,7 @@ bool ducky_get_number(const char* param, uint32_t* val) {
return false; return false;
} }
void ducky_numlock_on() { void ducky_numlock_on(void) {
if((furi_hal_hid_get_led_state() & HID_KB_LED_NUM) == 0) { if((furi_hal_hid_get_led_state() & HID_KB_LED_NUM) == 0) {
furi_hal_hid_kb_press(HID_KEYBOARD_LOCK_NUM_LOCK); furi_hal_hid_kb_press(HID_KEYBOARD_LOCK_NUM_LOCK);
furi_hal_hid_kb_release(HID_KEYBOARD_LOCK_NUM_LOCK); furi_hal_hid_kb_release(HID_KEYBOARD_LOCK_NUM_LOCK);

View file

@ -193,7 +193,7 @@ static bool bad_usb_input_callback(InputEvent* event, void* context) {
return consumed; return consumed;
} }
BadUsb* bad_usb_alloc() { BadUsb* bad_usb_alloc(void) {
BadUsb* bad_usb = malloc(sizeof(BadUsb)); BadUsb* bad_usb = malloc(sizeof(BadUsb));
bad_usb->view = view_alloc(); bad_usb->view = view_alloc();

View file

@ -6,7 +6,7 @@
typedef struct BadUsb BadUsb; typedef struct BadUsb BadUsb;
typedef void (*BadUsbButtonCallback)(InputKey key, void* context); typedef void (*BadUsbButtonCallback)(InputKey key, void* context);
BadUsb* bad_usb_alloc(); BadUsb* bad_usb_alloc(void);
void bad_usb_free(BadUsb* bad_usb); void bad_usb_free(BadUsb* bad_usb);

View file

@ -21,7 +21,7 @@ static void gpio_app_tick_event_callback(void* context) {
scene_manager_handle_tick_event(app->scene_manager); scene_manager_handle_tick_event(app->scene_manager);
} }
GpioApp* gpio_app_alloc() { GpioApp* gpio_app_alloc(void) {
GpioApp* app = malloc(sizeof(GpioApp)); GpioApp* app = malloc(sizeof(GpioApp));
app->expansion = furi_record_open(RECORD_EXPANSION); app->expansion = furi_record_open(RECORD_EXPANSION);

View file

@ -7,7 +7,7 @@ struct GPIOItems {
size_t count; size_t count;
}; };
GPIOItems* gpio_items_alloc() { GPIOItems* gpio_items_alloc(void) {
GPIOItems* items = malloc(sizeof(GPIOItems)); GPIOItems* items = malloc(sizeof(GPIOItems));
items->count = 0; items->count = 0;

View file

@ -8,7 +8,7 @@ extern "C" {
typedef struct GPIOItems GPIOItems; typedef struct GPIOItems GPIOItems;
GPIOItems* gpio_items_alloc(); GPIOItems* gpio_items_alloc(void);
void gpio_items_free(GPIOItems* items); void gpio_items_free(GPIOItems* items);

View file

@ -101,7 +101,7 @@ static bool gpio_usb_uart_input_callback(InputEvent* event, void* context) {
return consumed; return consumed;
} }
GpioUsbUart* gpio_usb_uart_alloc() { GpioUsbUart* gpio_usb_uart_alloc(void) {
GpioUsbUart* usb_uart = malloc(sizeof(GpioUsbUart)); GpioUsbUart* usb_uart = malloc(sizeof(GpioUsbUart));
usb_uart->view = view_alloc(); usb_uart->view = view_alloc();

View file

@ -7,7 +7,7 @@
typedef struct GpioUsbUart GpioUsbUart; typedef struct GpioUsbUart GpioUsbUart;
typedef void (*GpioUsbUartCallback)(GpioCustomEvent event, void* context); typedef void (*GpioUsbUartCallback)(GpioCustomEvent event, void* context);
GpioUsbUart* gpio_usb_uart_alloc(); GpioUsbUart* gpio_usb_uart_alloc(void);
void gpio_usb_uart_free(GpioUsbUart* usb_uart); void gpio_usb_uart_free(GpioUsbUart* usb_uart);

View file

@ -77,7 +77,7 @@ void ibutton_tick_event_callback(void* context) {
scene_manager_handle_tick_event(ibutton->scene_manager); scene_manager_handle_tick_event(ibutton->scene_manager);
} }
iButton* ibutton_alloc() { iButton* ibutton_alloc(void) {
iButton* ibutton = malloc(sizeof(iButton)); iButton* ibutton = malloc(sizeof(iButton));
ibutton->file_path = furi_string_alloc(); ibutton->file_path = furi_string_alloc();

View file

@ -11,7 +11,7 @@
static void ibutton_cli(Cli* cli, FuriString* args, void* context); static void ibutton_cli(Cli* cli, FuriString* args, void* context);
// app cli function // app cli function
void ibutton_on_system_start() { void ibutton_on_system_start(void) {
#ifdef SRV_CLI #ifdef SRV_CLI
Cli* cli = furi_record_open(RECORD_CLI); Cli* cli = furi_record_open(RECORD_CLI);
cli_add_command(cli, "ikey", CliCommandFlagDefault, ibutton_cli, cli); cli_add_command(cli, "ikey", CliCommandFlagDefault, ibutton_cli, cli);
@ -21,7 +21,7 @@ void ibutton_on_system_start() {
#endif #endif
} }
static void ibutton_cli_print_usage() { static void ibutton_cli_print_usage(void) {
printf("Usage:\r\n"); printf("Usage:\r\n");
printf("ikey read\r\n"); printf("ikey read\r\n");
printf("ikey emulate <key_type> <key_data>\r\n"); printf("ikey emulate <key_type> <key_data>\r\n");

View file

@ -126,7 +126,7 @@ static void infrared_find_vacant_remote_name(FuriString* name, const char* path)
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
} }
static InfraredApp* infrared_alloc() { static InfraredApp* infrared_alloc(void) {
InfraredApp* infrared = malloc(sizeof(InfraredApp)); InfraredApp* infrared = malloc(sizeof(InfraredApp));
infrared->task_thread = infrared->task_thread =

View file

@ -27,7 +27,7 @@ struct InfraredBruteForce {
bool is_started; bool is_started;
}; };
InfraredBruteForce* infrared_brute_force_alloc() { InfraredBruteForce* infrared_brute_force_alloc(void) {
InfraredBruteForce* brute_force = malloc(sizeof(InfraredBruteForce)); InfraredBruteForce* brute_force = malloc(sizeof(InfraredBruteForce));
brute_force->ff = NULL; brute_force->ff = NULL;
brute_force->db_filename = NULL; brute_force->db_filename = NULL;

View file

@ -21,7 +21,7 @@ typedef struct InfraredBruteForce InfraredBruteForce;
* *
* @returns pointer to the created instance. * @returns pointer to the created instance.
*/ */
InfraredBruteForce* infrared_brute_force_alloc(); InfraredBruteForce* infrared_brute_force_alloc(void);
/** /**
* @brief Delete an InfraredBruteForce instance. * @brief Delete an InfraredBruteForce instance.

View file

@ -508,7 +508,7 @@ static void infrared_cli_start_ir(Cli* cli, FuriString* args, void* context) {
furi_string_free(command); furi_string_free(command);
} }
void infrared_on_system_start() { void infrared_on_system_start(void) {
#ifdef SRV_CLI #ifdef SRV_CLI
Cli* cli = (Cli*)furi_record_open(RECORD_CLI); Cli* cli = (Cli*)furi_record_open(RECORD_CLI);
cli_add_command(cli, "ir", CliCommandFlagDefault, infrared_cli_start_ir, NULL); cli_add_command(cli, "ir", CliCommandFlagDefault, infrared_cli_start_ir, NULL);

View file

@ -37,7 +37,7 @@ typedef struct {
typedef bool ( typedef bool (
*InfraredBatchCallback)(const InfraredBatch* batch, const InfraredBatchTarget* target); *InfraredBatchCallback)(const InfraredBatch* batch, const InfraredBatchTarget* target);
InfraredRemote* infrared_remote_alloc() { InfraredRemote* infrared_remote_alloc(void) {
InfraredRemote* remote = malloc(sizeof(InfraredRemote)); InfraredRemote* remote = malloc(sizeof(InfraredRemote));
StringArray_init(remote->signal_names); StringArray_init(remote->signal_names);
remote->name = furi_string_alloc(); remote->name = furi_string_alloc();

View file

@ -23,7 +23,7 @@ typedef struct InfraredRemote InfraredRemote;
* *
* @returns pointer to the created instance. * @returns pointer to the created instance.
*/ */
InfraredRemote* infrared_remote_alloc(); InfraredRemote* infrared_remote_alloc(void);
/** /**
* @brief Delete an InfraredRemote instance. * @brief Delete an InfraredRemote instance.

Some files were not shown because too many files have changed in this diff Show more