From 4d6b170769a33711e62deaf1c2a6b3bdda37e665 Mon Sep 17 00:00:00 2001 From: hedger Date: Fri, 6 May 2022 16:37:10 +0300 Subject: [PATCH] [FL-2520] FW build with -Wextra (#1185) * Fixing compiler warnings with -Wextra * More warnings suppression, WIP * Even more warning fixes * Added new lines at end of text files. * Padding fix * Additional fixes to warnings on different build configurations; added -Wextra to default build pipeline * Fixes for Secplus v1 * -additional warnings * +-Wredundant-decls fixes * FuriHal: print stack overflow task name in console * FuriHal: add missing include Co-authored-by: Aleksandr Kutuzov --- .clang-format | 2 +- .github/workflows/build_toolchain.yml | 2 +- .github/workflows/check_submodules.yml | 2 +- applications/about/about.c | 1 + applications/accessor/accessor.cpp | 3 +- applications/accessor/accessor_app.h | 2 +- .../accessor/accessor_view_manager.cpp | 4 +- applications/accessor/accessor_view_manager.h | 2 +- applications/accessor/helpers/wiegand.h | 2 +- .../accessor/scene/accessor_scene_generic.h | 2 +- .../accessor/scene/accessor_scene_start.h | 2 +- applications/archive/archive.c | 1 + applications/archive/helpers/archive_apps.c | 5 +- applications/archive/helpers/archive_apps.h | 2 +- .../archive/helpers/archive_browser.c | 24 +++++---- .../archive/helpers/archive_browser.h | 2 +- applications/archive/helpers/archive_files.c | 2 +- .../archive/scenes/archive_scene_browser.c | 1 + .../archive/views/archive_browser_view.c | 12 ++--- .../archive/views/archive_browser_view.h | 4 +- .../scenes/bad_usb_scene_file_select.c | 3 ++ applications/bad_usb/views/bad_usb_view.c | 1 + applications/bt/bt_cli.c | 10 ++++ applications/bt/bt_debug_app/bt_debug_app.c | 3 ++ .../bt/bt_debug_app/views/bt_carrier_test.c | 6 +-- .../bt/bt_debug_app/views/bt_packet_test.c | 6 +-- applications/bt/bt_hid_app/bt_hid.c | 3 ++ .../bt/bt_settings_app/bt_settings_app.c | 1 + applications/cli/cli.c | 3 ++ applications/cli/cli_commands.c | 39 +++++++++++++- applications/cli/cli_commands.h | 2 +- applications/cli/cli_vcp.c | 8 ++- applications/crypto/crypto_cli.c | 3 ++ applications/debug_tools/blink_test.c | 2 + .../debug_tools/display_test/display_test.c | 5 ++ .../display_test/view_display_test.c | 1 + applications/debug_tools/keypad_test.c | 1 + applications/debug_tools/text_box_test.c | 3 +- applications/debug_tools/uart_echo.c | 12 +++-- applications/debug_tools/usb_mouse.c | 2 + applications/debug_tools/usb_test.c | 2 + applications/debug_tools/vibro_test.c | 2 + .../desktop/animations/animation_manager.c | 1 + .../desktop/animations/animation_storage.c | 10 ++-- applications/desktop/desktop.c | 2 + .../desktop_settings_scene_pin_disable.c | 1 + .../scenes/desktop_settings_scene_pin_error.c | 1 + .../desktop_settings_scene_pin_setup_howto.c | 1 + .../desktop/scenes/desktop_scene_fault.c | 1 + .../scenes/desktop_scene_first_start.c | 1 + .../desktop/scenes/desktop_scene_lock_menu.c | 1 + .../desktop/scenes/desktop_scene_locked.c | 1 + .../scenes/desktop_scene_pin_timeout.c | 1 + .../desktop/views/desktop_view_pin_timeout.c | 2 + applications/dialogs/dialogs.c | 2 + applications/dialogs/dialogs.h | 2 +- applications/dialogs/dialogs_api.c | 2 +- applications/dialogs/dialogs_i.h | 2 +- applications/dialogs/dialogs_message.h | 2 +- .../dialogs/dialogs_module_file_select.h | 2 +- applications/dialogs/dialogs_module_message.h | 2 +- applications/dialogs/view_holder.h | 2 +- applications/dolphin/dolphin.c | 2 + applications/dolphin/helpers/dolphin_state.h | 2 +- applications/dolphin/passport/passport.c | 1 + applications/gpio/gpio_app.c | 1 + applications/gpio/scenes/gpio_scene_test.c | 3 ++ .../gpio/scenes/gpio_scene_usb_uart_config.c | 9 ++-- applications/gpio/usb_uart_bridge.c | 14 +++-- applications/gpio/views/gpio_test.c | 1 + applications/gpio/views/gpio_usb_uart.c | 1 + applications/gui/gui.c | 1 + applications/gui/icon.c | 2 +- applications/gui/icon.h | 2 +- applications/gui/modules/button_menu.c | 2 +- applications/gui/modules/button_panel.c | 8 +-- applications/gui/modules/byte_input.h | 2 +- applications/gui/modules/empty_screen.c | 3 ++ applications/gui/modules/empty_screen.h | 2 +- applications/gui/modules/file_select.h | 2 +- applications/gui/modules/loading.c | 1 + applications/gui/modules/text_box.c | 2 +- applications/gui/modules/text_input.c | 10 ++-- applications/gui/modules/validators.h | 2 +- applications/gui/modules/variable_item_list.c | 1 + applications/gui/view.c | 1 + applications/ibutton/ibutton.cpp | 2 +- applications/ibutton/ibutton_app.h | 2 +- applications/ibutton/ibutton_cli.c | 5 +- applications/ibutton/ibutton_event.h | 1 + applications/ibutton/ibutton_view_manager.cpp | 4 +- applications/ibutton/ibutton_view_manager.h | 2 +- .../ibutton/scene/ibutton_scene_add_type.h | 2 +- .../ibutton/scene/ibutton_scene_add_value.cpp | 2 +- .../ibutton/scene/ibutton_scene_add_value.h | 2 +- .../scene/ibutton_scene_delete_confirm.h | 2 +- .../scene/ibutton_scene_delete_success.cpp | 2 +- .../scene/ibutton_scene_delete_success.h | 2 +- .../ibutton/scene/ibutton_scene_emulate.cpp | 5 +- .../ibutton/scene/ibutton_scene_emulate.h | 2 +- .../scene/ibutton_scene_exit_confirm.h | 2 +- .../ibutton/scene/ibutton_scene_info.cpp | 5 +- .../ibutton/scene/ibutton_scene_info.h | 2 +- .../ibutton/scene/ibutton_scene_read.cpp | 5 +- .../ibutton/scene/ibutton_scene_read.h | 2 +- .../scene/ibutton_scene_read_crc_error.cpp | 2 +- .../scene/ibutton_scene_read_crc_error.h | 2 +- .../scene/ibutton_scene_read_key_menu.h | 2 +- .../ibutton_scene_read_not_key_error.cpp | 2 +- .../scene/ibutton_scene_read_not_key_error.h | 2 +- .../scene/ibutton_scene_read_success.h | 2 +- .../scene/ibutton_scene_retry_confirm.h | 2 +- .../ibutton/scene/ibutton_scene_save_name.h | 2 +- .../scene/ibutton_scene_save_success.cpp | 2 +- .../scene/ibutton_scene_save_success.h | 2 +- .../scene/ibutton_scene_saved_key_menu.h | 2 +- .../scene/ibutton_scene_select_key.cpp | 4 +- .../ibutton/scene/ibutton_scene_select_key.h | 2 +- .../ibutton/scene/ibutton_scene_start.h | 2 +- .../ibutton/scene/ibutton_scene_write.cpp | 2 +- .../ibutton/scene/ibutton_scene_write.h | 2 +- .../scene/ibutton_scene_write_success.cpp | 2 +- .../scene/ibutton_scene_write_success.h | 2 +- applications/infrared/cli/infrared_cli.cpp | 4 ++ applications/infrared/infrared_app_event.h | 1 + .../infrared/infrared_app_view_manager.cpp | 2 +- .../scene/infrared_app_scene_ask_back.cpp | 2 +- .../scene/infrared_app_scene_edit_delete.cpp | 2 +- .../infrared_app_scene_edit_rename_done.cpp | 2 +- .../infrared_app_scene_learn_enter_name.cpp | 2 +- .../scene/infrared_app_scene_remote_list.cpp | 8 ++- .../infrared_app_scene_universal_common.cpp | 6 ++- applications/input/input.c | 1 + applications/input/input_cli.c | 2 + .../lfrfid/helpers/decoder_analyzer.cpp | 4 +- .../lfrfid/helpers/decoder_gpio_out.cpp | 2 +- applications/lfrfid/helpers/decoder_hid26.h | 2 +- .../lfrfid/helpers/decoder_indala.cpp | 2 +- applications/lfrfid/helpers/decoder_indala.h | 2 +- applications/lfrfid/helpers/emmarin.h | 2 +- applications/lfrfid/helpers/encoder_emmarin.h | 2 +- .../lfrfid/helpers/encoder_hid_h10301.h | 2 +- .../lfrfid/helpers/encoder_indala_40134.h | 2 +- applications/lfrfid/helpers/key_info.cpp | 2 +- applications/lfrfid/helpers/key_info.h | 2 +- applications/lfrfid/helpers/osc_fsk.h | 2 +- .../helpers/protocols/protocol_generic.h | 2 +- .../helpers/protocols/protocol_hid_h10301.h | 2 +- .../protocols/protocol_indala_40134.cpp | 2 +- applications/lfrfid/helpers/pulse_joiner.h | 2 +- applications/lfrfid/helpers/rfid_key.cpp | 2 +- applications/lfrfid/helpers/rfid_key.h | 2 +- applications/lfrfid/helpers/rfid_worker.h | 2 +- applications/lfrfid/helpers/rfid_writer.h | 2 +- applications/lfrfid/helpers/state_sequencer.h | 2 +- applications/lfrfid/lfrfid_cli.cpp | 3 ++ .../scene/lfrfid_app_scene_delete_confirm.cpp | 2 +- .../scene/lfrfid_app_scene_delete_confirm.h | 2 +- .../scene/lfrfid_app_scene_delete_success.cpp | 4 +- .../scene/lfrfid_app_scene_delete_success.h | 2 +- .../lfrfid/scene/lfrfid_app_scene_emulate.cpp | 2 +- .../lfrfid/scene/lfrfid_app_scene_emulate.h | 2 +- .../scene/lfrfid_app_scene_exit_confirm.cpp | 2 +- .../scene/lfrfid_app_scene_exit_confirm.h | 2 +- .../lfrfid/scene/lfrfid_app_scene_read.cpp | 2 +- .../lfrfid/scene/lfrfid_app_scene_read.h | 2 +- .../lfrfid/scene/lfrfid_app_scene_read_menu.h | 2 +- .../scene/lfrfid_app_scene_read_success.cpp | 2 +- .../scene/lfrfid_app_scene_read_success.h | 2 +- .../scene/lfrfid_app_scene_retry_confirm.cpp | 2 +- .../scene/lfrfid_app_scene_retry_confirm.h | 2 +- .../lfrfid/scene/lfrfid_app_scene_save_data.h | 2 +- .../scene/lfrfid_app_scene_save_name.cpp | 2 +- .../lfrfid/scene/lfrfid_app_scene_save_name.h | 2 +- .../scene/lfrfid_app_scene_save_success.cpp | 2 +- .../scene/lfrfid_app_scene_save_success.h | 2 +- .../lfrfid/scene/lfrfid_app_scene_save_type.h | 2 +- .../scene/lfrfid_app_scene_saved_info.cpp | 8 ++- .../scene/lfrfid_app_scene_saved_info.h | 2 +- .../scene/lfrfid_app_scene_saved_key_menu.h | 2 +- .../scene/lfrfid_app_scene_select_key.cpp | 10 ++-- .../scene/lfrfid_app_scene_select_key.h | 2 +- .../lfrfid/scene/lfrfid_app_scene_start.h | 2 +- .../lfrfid/scene/lfrfid_app_scene_write.cpp | 2 +- .../lfrfid/scene/lfrfid_app_scene_write.h | 2 +- .../scene/lfrfid_app_scene_write_success.cpp | 2 +- .../scene/lfrfid_app_scene_write_success.h | 2 +- applications/lfrfid/view/container_vm.cpp | 2 +- .../lfrfid/view/elements/generic_element.h | 2 +- .../lfrfid/view/elements/icon_element.cpp | 2 +- .../lfrfid/view/elements/string_element.cpp | 4 +- .../lfrfid_debug/lfrfid_debug_app.cpp | 2 +- .../lfrfid_debug_app_launcher.cpp | 1 + .../scene/lfrfid_debug_app_scene_start.h | 2 +- .../scene/lfrfid_debug_app_scene_tune.cpp | 7 +-- .../scene/lfrfid_debug_app_scene_tune.h | 2 +- applications/loader/loader.c | 9 ++++ applications/music_player/music_player_cli.c | 1 + .../music_player/music_player_worker.c | 4 +- applications/nfc/helpers/nfc_custom_event.h | 2 +- applications/nfc/nfc_cli.c | 4 ++ applications/nfc/nfc_device.c | 4 +- .../nfc/scenes/nfc_scene_delete_success.c | 2 +- .../nfc/scenes/nfc_scene_device_info.c | 1 + .../nfc/scenes/nfc_scene_emulate_mifare_ul.c | 1 + .../nfc/scenes/nfc_scene_emulate_uid.c | 1 + applications/nfc/scenes/nfc_scene_field.c | 2 + .../nfc/scenes/nfc_scene_file_select.c | 3 ++ .../nfc/scenes/nfc_scene_mifare_desfire_app.c | 2 +- applications/nfc/scenes/nfc_scene_read_card.c | 1 + .../nfc/scenes/nfc_scene_read_emv_app.c | 1 + .../nfc/scenes/nfc_scene_read_emv_data.c | 1 + .../scenes/nfc_scene_read_mifare_desfire.c | 1 + .../nfc/scenes/nfc_scene_read_mifare_ul.c | 1 + applications/notification/notification_app.c | 2 +- .../notification/notification_app_api.c | 2 +- .../notification/notification_settings_app.c | 2 + .../power/battery_test_app/battery_test_app.c | 1 + applications/power/power_cli.c | 15 ++++++ .../power_settings_app/power_settings_app.c | 1 + .../power_settings_scene_battery_info.c | 1 + .../scenes/power_settings_scene_reboot.c | 1 + applications/rpc/rpc.c | 11 ++-- applications/rpc/rpc_cli.c | 1 + applications/rpc/rpc_storage.c | 2 - .../scene/scened_app_scene_byte_input.cpp | 2 +- .../scene/scened_app_scene_byte_input.h | 2 +- .../scene/scened_app_scene_start.h | 2 +- .../scened_app_example/scened_app.cpp | 2 +- .../scened_app_launcher.cpp | 1 + applications/snake_game/snake_game.c | 1 + applications/storage/filesystem_api.c | 2 +- applications/storage/filesystem_api_defines.h | 2 +- applications/storage/storage.c | 1 + applications/storage/storage.h | 2 +- applications/storage/storage_cli.c | 12 +++++ applications/storage/storage_glue.h | 2 +- applications/storage/storage_internal_api.c | 2 +- applications/storage/storage_message.h | 2 +- applications/storage/storage_processing.c | 2 +- applications/storage/storage_processing.h | 2 +- applications/storage/storage_sd_api.c | 2 +- applications/storage/storage_sd_api.h | 2 +- applications/storage/storage_test_app.c | 1 + applications/storage/storages/sd_notify.c | 2 +- applications/storage/storages/sd_notify.h | 2 +- applications/storage/storages/storage_ext.c | 20 ++++++- applications/storage/storages/storage_ext.h | 2 +- applications/storage/storages/storage_int.c | 2 + applications/storage/storages/storage_int.h | 2 +- .../scenes/storage_settings_scene_config.h | 2 +- .../storage_settings/storage_settings.c | 1 + .../storage_settings/storage_settings.h | 2 +- .../subghz_frequency_analyzer_worker.c | 2 +- applications/subghz/helpers/subghz_testing.h | 2 +- .../subghz/scenes/subghz_scene_config.h | 2 +- .../subghz/scenes/subghz_scene_receiver.c | 2 +- .../scenes/subghz_scene_receiver_config.c | 4 +- .../subghz/scenes/subghz_scene_saved.c | 5 +- .../subghz/scenes/subghz_scene_show_only_rx.c | 2 +- .../subghz/scenes/subghz_scene_test_carrier.c | 2 +- .../subghz/scenes/subghz_scene_test_packet.c | 2 +- .../subghz/scenes/subghz_scene_test_static.c | 2 +- applications/subghz/subghz.h | 2 +- applications/subghz/subghz_cli.c | 7 +++ applications/subghz/views/receiver.c | 11 ++-- .../subghz/views/subghz_test_packet.c | 1 + applications/system/system_settings.c | 2 + applications/u2f/scenes/u2f_scene_main.c | 1 + applications/u2f/u2f_app.c | 1 + applications/u2f/views/u2f_view.c | 1 + .../flipper_format_string_test.c | 2 +- applications/unit_tests/furi_pubsub_test.c | 2 +- .../infrared_decoder_encoder_test.c | 6 +-- applications/unit_tests/minunit_vars.h | 2 +- applications/unit_tests/minunit_vars_ex.h | 2 +- applications/unit_tests/rpc/rpc_test.c | 13 +++-- .../unit_tests/storage/storage_test.c | 2 +- applications/unit_tests/stream/stream_test.c | 2 +- applications/unit_tests/subghz/subghz_test.c | 2 + applications/unit_tests/test_index.c | 3 ++ applications/updater/cli/updater_cli.c | 3 ++ .../updater/scenes/updater_scene_config.h | 2 +- .../updater/scenes/updater_scene_loadcfg.c | 2 +- applications/updater/updater.c | 2 +- applications/updater/updater_i.h | 2 +- applications/updater/util/update_task.c | 2 +- applications/updater/util/update_task.h | 2 +- .../updater/util/update_task_worker_flasher.c | 2 +- applications/updater/views/updater_main.h | 2 +- core/furi/check.c | 2 +- core/furi/check.h | 5 +- core/furi/common_defines.h | 5 -- core/furi/memmgr.c | 5 ++ core/furi/memmgr_heap.c | 1 + core/furi/stdglue.c | 2 + core/furi/thread.h | 2 +- core/furi/valuemutex.c | 2 +- core/furi/valuemutex.h | 2 +- docker-compose.yml | 2 +- firmware/targets/f7/Inc/FreeRTOSConfig.h | 1 + firmware/targets/f7/Inc/stm32_assert.h | 52 +++++++++++++++++++ firmware/targets/f7/Src/main.c | 13 ----- firmware/targets/f7/ble_glue/app_debug.h | 2 +- firmware/targets/f7/ble_glue/ble_app.c | 4 ++ firmware/targets/f7/ble_glue/ble_glue.c | 1 + firmware/targets/f7/ble_glue/ble_glue.h | 2 +- firmware/targets/f7/ble_glue/gap.c | 2 + firmware/targets/f7/fatfs/stm32_adafruit_sd.c | 2 + firmware/targets/f7/fatfs/user_diskio.c | 7 ++- firmware/targets/f7/furi_hal/furi_hal_crc.h | 2 +- .../targets/f7/furi_hal/furi_hal_i2c_config.h | 2 +- .../targets/f7/furi_hal/furi_hal_i2c_types.h | 2 +- firmware/targets/f7/furi_hal/furi_hal_info.c | 2 +- firmware/targets/f7/furi_hal/furi_hal_nfc.c | 3 +- firmware/targets/f7/furi_hal/furi_hal_os.c | 5 ++ .../targets/f7/furi_hal/furi_hal_random.c | 1 + firmware/targets/f7/furi_hal/furi_hal_rfid.c | 1 + firmware/targets/f7/furi_hal/furi_hal_spi.c | 1 + .../targets/f7/furi_hal/furi_hal_spi_config.h | 2 +- .../targets/f7/furi_hal/furi_hal_spi_types.h | 2 +- firmware/targets/f7/furi_hal/furi_hal_usb.c | 10 ++++ .../targets/f7/furi_hal/furi_hal_usb_cdc.c | 8 +++ .../targets/f7/furi_hal/furi_hal_usb_hid.c | 17 ++++-- .../targets/f7/furi_hal/furi_hal_usb_u2f.c | 37 ++++++++++--- .../targets/f7/furi_hal/furi_hal_version.c | 18 +++---- firmware/targets/f7/target.mk | 6 ++- .../furi_hal_include/furi_hal_random.h | 2 +- .../targets/furi_hal_include/furi_hal_sd.h | 1 + .../furi_hal_include/furi_hal_usb_hid.h | 2 +- lib/ST25RFAL002/platform.c | 1 + lib/ST25RFAL002/source/rfal_t4t.c | 1 + .../source/st25r3916/st25r3916_com.c | 3 +- lib/ST25RFAL002/timer.h | 4 +- lib/app-scened-template/file_worker.c | 3 ++ lib/app-scened-template/generic_scene.hpp | 2 +- lib/app-scened-template/record_controller.hpp | 2 +- lib/app-scened-template/scene_controller.hpp | 4 +- lib/app-scened-template/text_store.h | 2 +- lib/app-scened-template/typeindex_no_rtti.hpp | 2 +- .../view_modules/byte_input_vm.h | 2 +- .../view_modules/dialog_ex_vm.h | 2 +- .../view_modules/generic_view_module.h | 2 +- .../view_modules/popup_vm.h | 2 +- .../view_modules/submenu_vm.h | 2 +- .../view_modules/text_input_vm.h | 2 +- lib/app-template/app_template.h | 2 +- lib/callback-connector/callback-connector.h | 2 +- lib/drivers/bq27220.c | 6 +-- lib/drivers/cc1101.h | 9 +--- lib/drivers/cc1101_regs.h | 2 +- lib/fatfs/ff.c | 4 +- lib/fatfs/ff_gen_drv.c | 1 + lib/flipper_format/flipper_format.c | 2 +- lib/flipper_format/flipper_format.h | 2 +- lib/flipper_format/flipper_format_i.h | 2 +- lib/flipper_format/flipper_format_stream.c | 6 +-- lib/flipper_format/flipper_format_stream.h | 2 +- lib/flipper_format/flipper_format_stream_i.h | 2 +- lib/fnv1a-hash/fnv1a-hash.c | 2 +- lib/fnv1a-hash/fnv1a-hash.h | 2 +- lib/heatshrink/heatshrink_encoder.c | 1 + .../common/infrared_common_decoder.c | 16 +++--- .../common/infrared_common_encoder.c | 4 +- lib/infrared/encoder_decoder/infrared.c | 12 ++--- .../nec/infrared_decoder_nec.c | 4 +- .../rc6/infrared_decoder_rc6.c | 4 +- .../samsung/infrared_decoder_samsung.c | 3 +- .../sirc/infrared_encoder_sirc.c | 2 +- lib/infrared/worker/infrared_worker.c | 1 + lib/lfs_config.h | 4 +- lib/libusb_stm32 | 2 +- lib/micro-ecc/asm_arm.inc | 1 + lib/micro-ecc/curve-specific.inc | 1 + lib/nfc_protocols/mifare_classic.c | 3 +- lib/nfc_protocols/mifare_desfire.c | 2 +- lib/nfc_protocols/mifare_ultralight.h | 2 +- lib/nfc_protocols/nfc_util.c | 16 ------ lib/nfc_protocols/nfc_util.h | 16 ------ lib/nfc_protocols/nfca.c | 2 +- lib/one_wire/ibutton/encoder/encoder_cyfral.h | 2 +- .../ibutton/encoder/encoder_metakom.h | 2 +- lib/one_wire/ibutton/ibutton_key.c | 2 +- lib/one_wire/ibutton/ibutton_key.h | 2 +- lib/one_wire/ibutton/ibutton_key_command.h | 2 +- lib/one_wire/ibutton/ibutton_worker.h | 2 +- lib/one_wire/ibutton/ibutton_worker_i.h | 8 +-- lib/one_wire/ibutton/ibutton_worker_modes.c | 9 +++- lib/one_wire/ibutton/ibutton_writer.h | 2 +- .../ibutton/pulse_protocols/protocol_cyfral.h | 2 +- .../pulse_protocols/protocol_metakom.h | 2 +- lib/one_wire/maxim_crc.c | 2 +- lib/one_wire/maxim_crc.h | 2 +- lib/one_wire/one_wire_device.h | 2 +- lib/one_wire/one_wire_host.c | 5 ++ lib/one_wire/one_wire_host.h | 2 +- lib/one_wire/one_wire_slave.c | 2 + lib/one_wire/pulse_protocols/pulse_decoder.h | 2 +- lib/one_wire/pulse_protocols/pulse_glue.h | 2 +- lib/one_wire/pulse_protocols/pulse_protocol.c | 2 +- lib/one_wire/pulse_protocols/pulse_protocol.h | 2 +- lib/qrcode/qrcode.c | 2 +- lib/qrcode/qrcode.h | 2 +- lib/subghz/protocols/came.c | 2 + lib/subghz/protocols/came_atomo.c | 2 +- lib/subghz/protocols/came_twee.c | 4 +- lib/subghz/protocols/faac_slh.c | 3 +- lib/subghz/protocols/firefly.c | 2 + lib/subghz/protocols/gate_tx.c | 4 +- lib/subghz/protocols/hormann.c | 2 + lib/subghz/protocols/ido.c | 5 +- lib/subghz/protocols/ido.h | 2 +- lib/subghz/protocols/keeloq.c | 2 +- lib/subghz/protocols/keeloq_common.c | 2 +- lib/subghz/protocols/kia.c | 3 +- lib/subghz/protocols/nero_radio.c | 4 +- lib/subghz/protocols/nero_sketch.c | 2 + lib/subghz/protocols/nice_flo.c | 2 + lib/subghz/protocols/nice_flo.h | 2 +- lib/subghz/protocols/princeton.c | 4 +- lib/subghz/protocols/princeton_for_testing.c | 2 +- lib/subghz/protocols/raw.c | 2 + lib/subghz/protocols/scher_khan.c | 3 +- lib/subghz/protocols/secplus_v1.c | 3 +- lib/subghz/protocols/secplus_v2.c | 3 +- lib/subghz/protocols/somfy_keytis.c | 1 + lib/subghz/protocols/somfy_telis.c | 1 + lib/subghz/subghz_keystore.c | 4 +- lib/toolbox/args.c | 2 +- lib/toolbox/args.h | 2 +- lib/toolbox/hex.c | 2 +- lib/toolbox/hex.h | 2 +- lib/toolbox/level_duration.h | 2 +- lib/toolbox/manchester_decoder.h | 2 +- lib/toolbox/manchester_encoder.c | 2 +- lib/toolbox/manchester_encoder.h | 2 +- lib/toolbox/md5.c | 2 +- lib/toolbox/md5.h | 2 +- lib/toolbox/random_name.c | 4 +- lib/toolbox/stream/file_stream.c | 2 +- lib/toolbox/stream/file_stream.h | 2 +- lib/toolbox/stream/stream.c | 4 +- lib/toolbox/stream/stream.h | 2 +- lib/toolbox/stream/stream_i.h | 2 +- lib/toolbox/stream/string_stream.c | 2 +- lib/toolbox/stream/string_stream.h | 2 +- lib/toolbox/tar/tar_archive.c | 2 +- lib/toolbox/tar/tar_archive.h | 2 +- lib/toolbox/version.c | 2 +- lib/toolbox/version.h | 2 +- lib/u8g2/u8g2_glue.c | 3 ++ lib/u8g2/u8x8_display.c | 2 +- lib/u8g2/u8x8_gpio.c | 2 +- lib/update_util/update_manifest.c | 2 +- lib/update_util/update_manifest.h | 2 +- lib/update_util/update_operation.c | 2 +- lib/update_util/update_operation.h | 2 +- make/base.mk | 2 +- make/defaults.mk | 2 +- make/freertos-heap.mk | 2 +- scripts/ReadMe.md | 2 +- 461 files changed, 940 insertions(+), 519 deletions(-) create mode 100644 firmware/targets/f7/Inc/stm32_assert.h diff --git a/.clang-format b/.clang-format index ad9757abf0f..3337a7409cf 100644 --- a/.clang-format +++ b/.clang-format @@ -83,4 +83,4 @@ SpacesInParentheses: false SpacesInSquareBrackets: false Standard: Cpp03 TabWidth: 4 -UseTab: Never \ No newline at end of file +UseTab: Never diff --git a/.github/workflows/build_toolchain.yml b/.github/workflows/build_toolchain.yml index 2068730c1dd..452dfbee6b7 100644 --- a/.github/workflows/build_toolchain.yml +++ b/.github/workflows/build_toolchain.yml @@ -43,4 +43,4 @@ jobs: labels: ${{ steps.meta.outputs.labels }} platforms: linux/amd64,linux/arm64 cache-from: type=registry,ref=flipperdevices/flipperzero-toolchain:buildcache - cache-to: type=registry,ref=flipperdevices/flipperzero-toolchain:buildcache,mode=max \ No newline at end of file + cache-to: type=registry,ref=flipperdevices/flipperzero-toolchain:buildcache,mode=max diff --git a/.github/workflows/check_submodules.yml b/.github/workflows/check_submodules.yml index db3a3afbda9..b02f9a8d0b7 100644 --- a/.github/workflows/check_submodules.yml +++ b/.github/workflows/check_submodules.yml @@ -14,4 +14,4 @@ jobs: with: path: assets/protobuf branch: dev - fetch_depth: 50 \ No newline at end of file + fetch_depth: 50 diff --git a/applications/about/about.c b/applications/about/about.c index 9e3fd34eb2f..7c8a4c6970e 100644 --- a/applications/about/about.c +++ b/applications/about/about.c @@ -149,6 +149,7 @@ const AboutDialogScreen about_screens[] = { const size_t about_screens_count = sizeof(about_screens) / sizeof(AboutDialogScreen); int32_t about_settings_app(void* p) { + UNUSED(p); DialogsApp* dialogs = furi_record_open("dialogs"); DialogMessage* message = dialog_message_alloc(); diff --git a/applications/accessor/accessor.cpp b/applications/accessor/accessor.cpp index 000c214b1f8..d7b687ede94 100644 --- a/applications/accessor/accessor.cpp +++ b/applications/accessor/accessor.cpp @@ -2,9 +2,10 @@ // app enter function extern "C" int32_t accessor_app(void* p) { + UNUSED(p); AccessorApp* app = new AccessorApp(); app->run(); delete app; return 255; -} \ No newline at end of file +} diff --git a/applications/accessor/accessor_app.h b/applications/accessor/accessor_app.h index ce18c177ae2..2afd796d5a9 100644 --- a/applications/accessor/accessor_app.h +++ b/applications/accessor/accessor_app.h @@ -51,4 +51,4 @@ class AccessorApp { OneWireHost* onewire_host; NotificationApp* notification; -}; \ No newline at end of file +}; diff --git a/applications/accessor/accessor_view_manager.cpp b/applications/accessor/accessor_view_manager.cpp index 604e4304969..f54ad62f7e1 100644 --- a/applications/accessor/accessor_view_manager.cpp +++ b/applications/accessor/accessor_view_manager.cpp @@ -64,7 +64,7 @@ void AccessorAppViewManager::send_event(AccessorEvent* event) { furi_check(result == osOK); } -uint32_t AccessorAppViewManager::previous_view_callback(void* context) { +uint32_t AccessorAppViewManager::previous_view_callback(void*) { if(event_queue != NULL) { AccessorEvent event; event.type = AccessorEvent::Type::Back; @@ -76,4 +76,4 @@ uint32_t AccessorAppViewManager::previous_view_callback(void* context) { void AccessorAppViewManager::add_view(ViewType view_type, View* view) { view_dispatcher_add_view(view_dispatcher, static_cast(view_type), view); -} \ No newline at end of file +} diff --git a/applications/accessor/accessor_view_manager.h b/applications/accessor/accessor_view_manager.h index 1e9d8e04496..f2c6f2bb288 100644 --- a/applications/accessor/accessor_view_manager.h +++ b/applications/accessor/accessor_view_manager.h @@ -36,4 +36,4 @@ class AccessorAppViewManager { // view elements Submenu* submenu; Popup* popup; -}; \ No newline at end of file +}; diff --git a/applications/accessor/helpers/wiegand.h b/applications/accessor/helpers/wiegand.h index 2822d95a0d8..8127f42865c 100644 --- a/applications/accessor/helpers/wiegand.h +++ b/applications/accessor/helpers/wiegand.h @@ -27,4 +27,4 @@ class WIEGAND { static int _wiegandType; static unsigned long _code; static unsigned long _codeHigh; -}; \ No newline at end of file +}; diff --git a/applications/accessor/scene/accessor_scene_generic.h b/applications/accessor/scene/accessor_scene_generic.h index b403f152d42..62a4eafe692 100644 --- a/applications/accessor/scene/accessor_scene_generic.h +++ b/applications/accessor/scene/accessor_scene_generic.h @@ -10,4 +10,4 @@ class AccessorScene { virtual void on_exit(AccessorApp* app) = 0; private: -}; \ No newline at end of file +}; diff --git a/applications/accessor/scene/accessor_scene_start.h b/applications/accessor/scene/accessor_scene_start.h index 3be88bb3925..1717d1e7970 100644 --- a/applications/accessor/scene/accessor_scene_start.h +++ b/applications/accessor/scene/accessor_scene_start.h @@ -6,4 +6,4 @@ class AccessorSceneStart : public AccessorScene { void on_enter(AccessorApp* app) final; bool on_event(AccessorApp* app, AccessorEvent* event) final; void on_exit(AccessorApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/archive/archive.c b/applications/archive/archive.c index 79f26f0ef92..5a38700b7fe 100644 --- a/applications/archive/archive.c +++ b/applications/archive/archive.c @@ -66,6 +66,7 @@ void archive_free(ArchiveApp* archive) { } int32_t archive_app(void* p) { + UNUSED(p); ArchiveApp* archive = archive_alloc(); scene_manager_next_scene(archive->scene_manager, ArchiveAppSceneBrowser); view_dispatcher_run(archive->view_dispatcher); diff --git a/applications/archive/helpers/archive_apps.c b/applications/archive/helpers/archive_apps.c index e1c429a78ee..f5edbbb32f5 100644 --- a/applications/archive/helpers/archive_apps.c +++ b/applications/archive/helpers/archive_apps.c @@ -7,8 +7,8 @@ static const char* known_apps[] = { }; ArchiveAppTypeEnum archive_get_app_type(const char* path) { - for(size_t i = 0; i < SIZEOF_ARRAY(known_apps); i++) { - if(strncmp(path, known_apps[i], strlen(known_apps[i])) != STRING_FAILURE) { + for(size_t i = 0; i < COUNT_OF(known_apps); i++) { + if(strncmp(path, known_apps[i], strlen(known_apps[i])) == 0) { return i; } } @@ -16,6 +16,7 @@ ArchiveAppTypeEnum archive_get_app_type(const char* path) { } bool archive_app_is_available(void* context, const char* path) { + UNUSED(context); furi_assert(path); ArchiveAppTypeEnum app = archive_get_app_type(path); diff --git a/applications/archive/helpers/archive_apps.h b/applications/archive/helpers/archive_apps.h index 5abc27a5be5..8bc904587bd 100644 --- a/applications/archive/helpers/archive_apps.h +++ b/applications/archive/helpers/archive_apps.h @@ -11,7 +11,7 @@ static const ArchiveFileTypeEnum app_file_types[] = { [ArchiveAppTypeUnknown] = ArchiveFileTypeUnknown, }; -static inline const ArchiveFileTypeEnum archive_get_app_filetype(ArchiveAppTypeEnum app) { +static inline ArchiveFileTypeEnum archive_get_app_filetype(ArchiveAppTypeEnum app) { return app_file_types[app]; } diff --git a/applications/archive/helpers/archive_browser.c b/applications/archive/helpers/archive_browser.c index cbe57c06e2a..faf10de98d2 100644 --- a/applications/archive/helpers/archive_browser.c +++ b/applications/archive/helpers/archive_browser.c @@ -6,7 +6,8 @@ bool archive_is_item_in_array(ArchiveBrowserViewModel* model, uint32_t idx) { size_t array_size = files_array_size(model->files); - if((idx >= model->array_offset + array_size) || (idx < model->array_offset)) { + if((idx >= (uint32_t)model->array_offset + array_size) || + (idx < (uint32_t)model->array_offset)) { return false; } @@ -20,12 +21,14 @@ void archive_update_offset(ArchiveBrowserView* browser) { browser->view, (ArchiveBrowserViewModel * model) { uint16_t bounds = model->item_cnt > 3 ? 2 : model->item_cnt; - if(model->item_cnt > 3 && model->item_idx >= model->item_cnt - 1) { + if((model->item_cnt > 3u) && ((uint32_t)model->item_idx >= (model->item_cnt - 1))) { model->list_offset = model->item_idx - 3; } else if(model->list_offset < model->item_idx - bounds) { - model->list_offset = CLAMP(model->item_idx - 2, model->item_cnt - bounds, 0); + model->list_offset = + CLAMP((uint32_t)model->item_idx - 2, model->item_cnt - bounds, 0u); } else if(model->list_offset > model->item_idx - bounds) { - model->list_offset = CLAMP(model->item_idx - 1, model->item_cnt - bounds, 0); + model->list_offset = + CLAMP((uint32_t)model->item_idx - 1, model->item_cnt - bounds, 0u); } return true; @@ -77,7 +80,7 @@ void archive_set_item_count(ArchiveBrowserView* browser, uint32_t count) { with_view_model( browser->view, (ArchiveBrowserViewModel * model) { model->item_cnt = count; - model->item_idx = CLAMP(model->item_idx, model->item_cnt - 1, 0); + model->item_idx = CLAMP((uint32_t)model->item_idx, model->item_cnt - 1, 0u); return false; }); archive_update_offset(browser); @@ -94,7 +97,7 @@ void archive_file_array_rm_selected(ArchiveBrowserView* browser) { model->item_idx - model->array_offset, model->item_idx - model->array_offset + 1); model->item_cnt--; - model->item_idx = CLAMP(model->item_idx, model->item_cnt - 1, 0); + model->item_idx = CLAMP((uint32_t)model->item_idx, model->item_cnt - 1, 0u); items_cnt = model->item_cnt; return false; }); @@ -113,14 +116,14 @@ void archive_file_array_swap(ArchiveBrowserView* browser, int8_t dir) { browser->view, (ArchiveBrowserViewModel * model) { ArchiveFile_t temp; size_t array_size = files_array_size(model->files) - 1; - uint8_t swap_idx = CLAMP(model->item_idx + dir, array_size, 0); + uint8_t swap_idx = CLAMP((size_t)(model->item_idx + dir), array_size, 0u); if(model->item_idx == 0 && dir < 0) { ArchiveFile_t_init(&temp); files_array_pop_at(&temp, model->files, array_size); files_array_push_at(model->files, model->item_idx, temp); ArchiveFile_t_clear(&temp); - } else if(model->item_idx == array_size && dir > 0) { + } else if(((uint32_t)model->item_idx == array_size) && (dir > 0)) { ArchiveFile_t_init(&temp); files_array_pop_at(&temp, model->files, 0); files_array_push_at(model->files, array_size, temp); @@ -157,7 +160,7 @@ bool archive_file_array_load(ArchiveBrowserView* browser, int8_t dir) { } else { offset_new = model->item_idx - FILE_LIST_BUF_LEN / 4 * 1; } - offset_new = CLAMP(offset_new, model->item_cnt - FILE_LIST_BUF_LEN, 0); + offset_new = CLAMP((uint32_t)offset_new, model->item_cnt - FILE_LIST_BUF_LEN, 0u); } return false; }); @@ -196,7 +199,7 @@ ArchiveFile_t* archive_get_file_at(ArchiveBrowserView* browser, size_t idx) { with_view_model( browser->view, (ArchiveBrowserViewModel * model) { - idx = CLAMP(idx - model->array_offset, files_array_size(model->files), 0); + idx = CLAMP(idx - model->array_offset, files_array_size(model->files), 0u); selected = files_array_size(model->files) ? files_array_get(model->files, idx) : NULL; return false; }); @@ -247,6 +250,7 @@ void archive_set_tab(ArchiveBrowserView* browser, ArchiveTabEnum tab) { }); } void archive_set_last_tab(ArchiveBrowserView* browser, ArchiveTabEnum tab) { + UNUSED(tab); // FIXME? furi_assert(browser); with_view_model( diff --git a/applications/archive/helpers/archive_browser.h b/applications/archive/helpers/archive_browser.h index 593a9be0db7..3395541e3ca 100644 --- a/applications/archive/helpers/archive_browser.h +++ b/applications/archive/helpers/archive_browser.h @@ -42,7 +42,7 @@ static const ArchiveFileTypeEnum known_type[] = { [ArchiveTabBrowser] = ArchiveFileTypeUnknown, }; -static inline const ArchiveFileTypeEnum archive_get_tab_filetype(ArchiveTabEnum tab) { +static inline ArchiveFileTypeEnum archive_get_tab_filetype(ArchiveTabEnum tab) { return known_type[tab]; } diff --git a/applications/archive/helpers/archive_files.c b/applications/archive/helpers/archive_files.c index 156e66f5d4b..3b1e8944678 100644 --- a/applications/archive/helpers/archive_files.c +++ b/applications/archive/helpers/archive_files.c @@ -54,7 +54,7 @@ void archive_set_file_type(ArchiveFile_t* file, FileInfo* file_info, const char* } else { furi_assert(file_info); - for(size_t i = 0; i < SIZEOF_ARRAY(known_ext); i++) { + for(size_t i = 0; i < COUNT_OF(known_ext); i++) { if((known_ext[i][0] == '?') || (known_ext[i][0] == '*')) continue; if(string_search_str(file->name, known_ext[i], 0) != STRING_FAILURE) { if(i == ArchiveFileTypeBadUsb) { diff --git a/applications/archive/scenes/archive_scene_browser.c b/applications/archive/scenes/archive_scene_browser.c index 0091bc9938c..9df3463befe 100644 --- a/applications/archive/scenes/archive_scene_browser.c +++ b/applications/archive/scenes/archive_scene_browser.c @@ -31,6 +31,7 @@ static void archive_loader_callback(const void* message, void* context) { } static void archive_run_in_app(ArchiveBrowserView* browser, ArchiveFile_t* selected) { + UNUSED(browser); Loader* loader = furi_record_open("loader"); LoaderStatus status; diff --git a/applications/archive/views/archive_browser_view.c b/applications/archive/views/archive_browser_view.c index ed75621d87c..dc6962f21e0 100644 --- a/applications/archive/views/archive_browser_view.c +++ b/applications/archive/views/archive_browser_view.c @@ -106,17 +106,17 @@ static void draw_list(Canvas* canvas, ArchiveBrowserViewModel* model) { size_t array_size = files_array_size(model->files); bool scrollbar = model->item_cnt > 4; - for(size_t i = 0; i < MIN(model->item_cnt, MENU_ITEMS); ++i) { + for(uint32_t i = 0; i < MIN(model->item_cnt, MENU_ITEMS); ++i) { string_t str_buff; char cstr_buff[MAX_NAME_LEN]; - size_t idx = CLAMP(i + model->list_offset, model->item_cnt, 0); + int32_t idx = CLAMP((uint32_t)(i + model->list_offset), model->item_cnt, 0u); uint8_t x_offset = (model->move_fav && model->item_idx == idx) ? MOVE_OFFSET : 0; ArchiveFileTypeEnum file_type = ArchiveFileTypeLoading; if(archive_is_item_in_array(model, idx)) { - ArchiveFile_t* file = - files_array_get(model->files, CLAMP(idx - model->array_offset, array_size - 1, 0)); + ArchiveFile_t* file = files_array_get( + model->files, CLAMP(idx - model->array_offset, (int32_t)(array_size - 1), 0)); strlcpy(cstr_buff, string_get_cstr(file->name), string_size(file->name) + 1); archive_trim_file_path(cstr_buff, archive_is_known_app(file->type)); string_init_set_str(str_buff, cstr_buff); @@ -216,7 +216,7 @@ static bool is_file_list_load_required(ArchiveBrowserViewModel* model) { } if(((model->array_offset + array_size) < model->item_cnt) && - (model->item_idx > (model->array_offset + array_size - FILE_LIST_BUF_LEN / 4))) { + (model->item_idx > (int32_t)(model->array_offset + array_size - FILE_LIST_BUF_LEN / 4))) { return true; } @@ -376,4 +376,4 @@ void browser_free(ArchiveBrowserView* browser) { view_free(browser->view); free(browser); -} \ No newline at end of file +} diff --git a/applications/archive/views/archive_browser_view.h b/applications/archive/views/archive_browser_view.h index 3aabe962eca..db079d6bc1c 100644 --- a/applications/archive/views/archive_browser_view.h +++ b/applications/archive/views/archive_browser_view.h @@ -13,8 +13,8 @@ #define MAX_NAME_LEN 255 #define MAX_EXT_LEN 6 #define FRAME_HEIGHT 12 -#define MENU_ITEMS 4 -#define MOVE_OFFSET 5 +#define MENU_ITEMS 4u +#define MOVE_OFFSET 5u typedef enum { ArchiveTabFavorites, diff --git a/applications/bad_usb/scenes/bad_usb_scene_file_select.c b/applications/bad_usb/scenes/bad_usb_scene_file_select.c index b1ab3194a61..82f03bab08c 100644 --- a/applications/bad_usb/scenes/bad_usb_scene_file_select.c +++ b/applications/bad_usb/scenes/bad_usb_scene_file_select.c @@ -31,10 +31,13 @@ void bad_usb_scene_file_select_on_enter(void* context) { } bool bad_usb_scene_file_select_on_event(void* context, SceneManagerEvent event) { + UNUSED(context); + UNUSED(event); // BadUsbApp* bad_usb = context; return false; } void bad_usb_scene_file_select_on_exit(void* context) { + UNUSED(context); // BadUsbApp* bad_usb = context; } diff --git a/applications/bad_usb/views/bad_usb_view.c b/applications/bad_usb/views/bad_usb_view.c index 22e5143d039..5b6fe6e89c8 100644 --- a/applications/bad_usb/views/bad_usb_view.c +++ b/applications/bad_usb/views/bad_usb_view.c @@ -142,6 +142,7 @@ void bad_usb_set_ok_callback(BadUsb* bad_usb, BadUsbOkCallback callback, void* c furi_assert(callback); with_view_model( bad_usb->view, (BadUsbModel * model) { + UNUSED(model); bad_usb->callback = callback; bad_usb->context = context; return true; diff --git a/applications/bt/bt_cli.c b/applications/bt/bt_cli.c index 64d69a12fc4..122eedf96fa 100644 --- a/applications/bt/bt_cli.c +++ b/applications/bt/bt_cli.c @@ -13,6 +13,9 @@ static const char* bt_cli_address_types[] = { }; static void bt_cli_command_hci_info(Cli* cli, string_t args, void* context) { + UNUSED(cli); + UNUSED(args); + UNUSED(context); string_t buffer; string_init(buffer); furi_hal_bt_dump_state(buffer); @@ -21,6 +24,7 @@ static void bt_cli_command_hci_info(Cli* cli, string_t args, void* context) { } static void bt_cli_command_carrier_tx(Cli* cli, string_t args, void* context) { + UNUSED(context); int channel = 0; int power = 0; @@ -47,6 +51,7 @@ static void bt_cli_command_carrier_tx(Cli* cli, string_t args, void* context) { } static void bt_cli_command_carrier_rx(Cli* cli, string_t args, void* context) { + UNUSED(context); int channel = 0; do { @@ -72,6 +77,7 @@ static void bt_cli_command_carrier_rx(Cli* cli, string_t args, void* context) { } static void bt_cli_command_packet_tx(Cli* cli, string_t args, void* context) { + UNUSED(context); int channel = 0; int pattern = 0; int datarate = 1; @@ -115,6 +121,7 @@ static void bt_cli_command_packet_tx(Cli* cli, string_t args, void* context) { } static void bt_cli_command_packet_rx(Cli* cli, string_t args, void* context) { + UNUSED(context); int channel = 0; int datarate = 1; @@ -152,6 +159,8 @@ static void bt_cli_scan_callback(GapAddress address, void* context) { } static void bt_cli_command_scan(Cli* cli, string_t args, void* context) { + UNUSED(context); + UNUSED(args); osMessageQueueId_t queue = osMessageQueueNew(20, sizeof(GapAddress), NULL); furi_hal_bt_start_scan(bt_cli_scan_callback, queue); @@ -189,6 +198,7 @@ static void bt_cli_print_usage() { } static void bt_cli(Cli* cli, string_t args, void* context) { + UNUSED(context); furi_record_open("bt"); string_t cmd; diff --git a/applications/bt/bt_debug_app/bt_debug_app.c b/applications/bt/bt_debug_app/bt_debug_app.c index a4363b91cf3..58119f5dc8f 100644 --- a/applications/bt/bt_debug_app/bt_debug_app.c +++ b/applications/bt/bt_debug_app/bt_debug_app.c @@ -19,10 +19,12 @@ void bt_debug_submenu_callback(void* context, uint32_t index) { } uint32_t bt_debug_exit(void* context) { + UNUSED(context); return VIEW_NONE; } uint32_t bt_debug_start_view(void* context) { + UNUSED(context); return BtDebugAppViewSubmenu; } @@ -94,6 +96,7 @@ void bt_debug_app_free(BtDebugApp* app) { } int32_t bt_debug_app(void* p) { + UNUSED(p); if(furi_hal_bt_get_radio_stack() != FuriHalBtStackHciLayer) { FURI_LOG_E(TAG, "Incorrect radio stack, replace with HciLayer for tests."); DialogsApp* dialogs = furi_record_open("dialogs"); diff --git a/applications/bt/bt_debug_app/views/bt_carrier_test.c b/applications/bt/bt_debug_app/views/bt_carrier_test.c index 22b80cd888f..0e0b3792bb7 100755 --- a/applications/bt/bt_debug_app/views/bt_carrier_test.c +++ b/applications/bt/bt_debug_app/views/bt_carrier_test.c @@ -141,7 +141,7 @@ BtCarrierTest* bt_carrier_test_alloc() { param = bt_test_param_add( bt_carrier_test->bt_test, "Mode", - SIZEOF_ARRAY(bt_param_mode), + COUNT_OF(bt_param_mode), bt_carrier_test_mode_changed, bt_carrier_test); bt_test_set_current_value_index(param, 0); @@ -151,7 +151,7 @@ BtCarrierTest* bt_carrier_test_alloc() { param = bt_test_param_add( bt_carrier_test->bt_test, "Channel", - SIZEOF_ARRAY(bt_param_channel), + COUNT_OF(bt_param_channel), bt_carrier_test_channel_changed, bt_carrier_test); bt_test_set_current_value_index(param, 0); @@ -162,7 +162,7 @@ BtCarrierTest* bt_carrier_test_alloc() { param = bt_test_param_add( bt_carrier_test->bt_test, "Power", - SIZEOF_ARRAY(bt_param_power), + COUNT_OF(bt_param_power), bt_carrier_test_param_channel, bt_carrier_test); bt_test_set_current_value_index(param, 0); diff --git a/applications/bt/bt_debug_app/views/bt_packet_test.c b/applications/bt/bt_debug_app/views/bt_packet_test.c index e9d3883ad01..e9b3bd75782 100644 --- a/applications/bt/bt_debug_app/views/bt_packet_test.c +++ b/applications/bt/bt_debug_app/views/bt_packet_test.c @@ -109,7 +109,7 @@ BtPacketTest* bt_packet_test_alloc() { param = bt_test_param_add( bt_packet_test->bt_test, "Mode", - SIZEOF_ARRAY(bt_param_mode), + COUNT_OF(bt_param_mode), bt_packet_test_mode_changed, bt_packet_test); bt_test_set_current_value_index(param, 0); @@ -119,7 +119,7 @@ BtPacketTest* bt_packet_test_alloc() { param = bt_test_param_add( bt_packet_test->bt_test, "Channel", - SIZEOF_ARRAY(bt_param_channel), + COUNT_OF(bt_param_channel), bt_packet_test_channel_changed, bt_packet_test); bt_test_set_current_value_index(param, 0); @@ -129,7 +129,7 @@ BtPacketTest* bt_packet_test_alloc() { param = bt_test_param_add( bt_packet_test->bt_test, "Data rate", - SIZEOF_ARRAY(bt_param_data_rate), + COUNT_OF(bt_param_data_rate), bt_packet_test_param_channel, bt_packet_test); bt_test_set_current_value_index(param, 0); diff --git a/applications/bt/bt_hid_app/bt_hid.c b/applications/bt/bt_hid_app/bt_hid.c index ab13f6f35fb..4b1037cdd73 100755 --- a/applications/bt/bt_hid_app/bt_hid.c +++ b/applications/bt/bt_hid_app/bt_hid.c @@ -33,10 +33,12 @@ void bt_hid_dialog_callback(DialogExResult result, void* context) { } uint32_t bt_hid_exit_confirm_view(void* context) { + UNUSED(context); return BtHidViewExitConfirm; } uint32_t bt_hid_exit(void* context) { + UNUSED(context); return VIEW_NONE; } @@ -139,6 +141,7 @@ void bt_hid_app_free(BtHid* app) { } int32_t bt_hid_app(void* p) { + UNUSED(p); // Switch profile to Hid BtHid* app = bt_hid_app_alloc(); bt_set_status_changed_callback(app->bt, bt_hid_connection_status_changed_callback, app); diff --git a/applications/bt/bt_settings_app/bt_settings_app.c b/applications/bt/bt_settings_app/bt_settings_app.c index d9dfa74dcf1..cb55e9310ed 100755 --- a/applications/bt/bt_settings_app/bt_settings_app.c +++ b/applications/bt/bt_settings_app/bt_settings_app.c @@ -76,6 +76,7 @@ void bt_settings_app_free(BtSettingsApp* app) { } extern int32_t bt_settings_app(void* p) { + UNUSED(p); BtSettingsApp* app = bt_settings_app_alloc(); view_dispatcher_run(app->view_dispatcher); bt_settings_save(&app->settings); diff --git a/applications/cli/cli.c b/applications/cli/cli.c index 4e200d6bdee..eefbb305225 100644 --- a/applications/cli/cli.c +++ b/applications/cli/cli.c @@ -130,10 +130,12 @@ void cli_motd() { } void cli_nl(Cli* cli) { + UNUSED(cli); printf("\r\n"); } void cli_prompt(Cli* cli) { + UNUSED(cli); printf("\r\n>: %s", string_get_cstr(cli->line)); fflush(stdout); } @@ -451,6 +453,7 @@ void cli_session_close(Cli* cli) { } int32_t cli_srv(void* p) { + UNUSED(p); Cli* cli = cli_alloc(); // Init basic cli commands diff --git a/applications/cli/cli_commands.c b/applications/cli/cli_commands.c index bdec231b0b1..2d059bd3ffe 100644 --- a/applications/cli/cli_commands.c +++ b/applications/cli/cli_commands.c @@ -12,6 +12,8 @@ #define CLI_DATE_FORMAT "%.4d-%.2d-%.2d %.2d:%.2d:%.2d %d" void cli_command_device_info_callback(const char* key, const char* value, bool last, void* context) { + UNUSED(context); + UNUSED(last); printf("%-24s: %s\r\n", key, value); } @@ -20,11 +22,14 @@ void cli_command_device_info_callback(const char* key, const char* value, bool l * This command is intended to be used by humans */ void cli_command_device_info(Cli* cli, string_t args, void* context) { + UNUSED(cli); + UNUSED(args); furi_hal_info_get(cli_command_device_info_callback, context); } void cli_command_help(Cli* cli, string_t args, void* context) { - (void)args; + UNUSED(args); + UNUSED(context); printf("Commands we have:"); // Command count @@ -62,6 +67,9 @@ void cli_command_help(Cli* cli, string_t args, void* context) { } void cli_command_date(Cli* cli, string_t args, void* context) { + UNUSED(cli); + UNUSED(context); + FuriHalRtcDateTime datetime = {0}; if(string_size(args) > 0) { @@ -135,6 +143,8 @@ void cli_command_log_tx_callback(const uint8_t* buffer, size_t size, void* conte } void cli_command_log(Cli* cli, string_t args, void* context) { + UNUSED(args); + UNUSED(context); StreamBufferHandle_t ring = xStreamBufferCreate(CLI_COMMAND_LOG_RING_SIZE, 1); uint8_t buffer[CLI_COMMAND_LOG_BUFFER_SIZE]; @@ -152,6 +162,8 @@ void cli_command_log(Cli* cli, string_t args, void* context) { } void cli_command_vibro(Cli* cli, string_t args, void* context) { + UNUSED(cli); + UNUSED(context); if(!string_cmp(args, "0")) { NotificationApp* notification = furi_record_open("notification"); notification_message_block(notification, &sequence_reset_vibro); @@ -166,6 +178,8 @@ void cli_command_vibro(Cli* cli, string_t args, void* context) { } void cli_command_debug(Cli* cli, string_t args, void* context) { + UNUSED(cli); + UNUSED(context); if(!string_cmp(args, "0")) { furi_hal_rtc_reset_flag(FuriHalRtcFlagDebug); loader_update_menu(); @@ -180,6 +194,8 @@ void cli_command_debug(Cli* cli, string_t args, void* context) { } void cli_command_led(Cli* cli, string_t args, void* context) { + UNUSED(cli); + UNUSED(context); // Get first word as light name NotificationMessage notification_led_message; string_t light_name; @@ -233,6 +249,7 @@ void cli_command_led(Cli* cli, string_t args, void* context) { } void cli_command_gpio_set(Cli* cli, string_t args, void* context) { + UNUSED(context); char pin_names[][4] = { "PC0", "PC1", @@ -313,6 +330,8 @@ void cli_command_gpio_set(Cli* cli, string_t args, void* context) { return; } } +#else + UNUSED(cli); #endif LL_GPIO_SetPinMode(gpio[num].port, gpio[num].pin, LL_GPIO_MODE_OUTPUT); @@ -325,6 +344,10 @@ void cli_command_gpio_set(Cli* cli, string_t args, void* context) { } void cli_command_ps(Cli* cli, string_t args, void* context) { + UNUSED(cli); + UNUSED(args); + UNUSED(context); + const uint8_t threads_num_max = 32; osThreadId_t threads_id[threads_num_max]; uint8_t thread_num = osThreadEnumerate(threads_id, threads_num_max); @@ -344,6 +367,10 @@ void cli_command_ps(Cli* cli, string_t args, void* context) { } void cli_command_free(Cli* cli, string_t args, void* context) { + UNUSED(cli); + UNUSED(args); + UNUSED(context); + printf("Free heap size: %d\r\n", memmgr_get_free_heap()); printf("Total heap size: %d\r\n", memmgr_get_total_heap()); printf("Minimum heap size: %d\r\n", memmgr_get_minimum_free_heap()); @@ -351,10 +378,18 @@ void cli_command_free(Cli* cli, string_t args, void* context) { } void cli_command_free_blocks(Cli* cli, string_t args, void* context) { + UNUSED(cli); + UNUSED(args); + UNUSED(context); + memmgr_heap_printf_free_blocks(); } void cli_command_i2c(Cli* cli, string_t args, void* context) { + UNUSED(cli); + UNUSED(args); + UNUSED(context); + furi_hal_i2c_acquire(&furi_hal_i2c_handle_external); printf("Scanning external i2c on PC0(SCL)/PC1(SDA)\r\n" "Clock: 100khz, 7bit address\r\n" @@ -391,4 +426,4 @@ void cli_commands_init(Cli* cli) { cli_add_command(cli, "led", CliCommandFlagDefault, cli_command_led, NULL); cli_add_command(cli, "gpio_set", CliCommandFlagDefault, cli_command_gpio_set, NULL); cli_add_command(cli, "i2c", CliCommandFlagDefault, cli_command_i2c, NULL); -} +} \ No newline at end of file diff --git a/applications/cli/cli_commands.h b/applications/cli/cli_commands.h index b82dae292c0..184eeb3739e 100644 --- a/applications/cli/cli_commands.h +++ b/applications/cli/cli_commands.h @@ -2,4 +2,4 @@ #include "cli_i.h" -void cli_commands_init(Cli* cli); \ No newline at end of file +void cli_commands_init(Cli* cli); diff --git a/applications/cli/cli_vcp.c b/applications/cli/cli_vcp.c index f570aee158e..84edca1835d 100644 --- a/applications/cli/cli_vcp.c +++ b/applications/cli/cli_vcp.c @@ -86,6 +86,7 @@ static void cli_vcp_deinit() { } static int32_t vcp_worker(void* context) { + UNUSED(context); bool tx_idle = true; size_t missed_rx = 0; uint8_t last_tx_pkt_len = 0; @@ -148,7 +149,7 @@ static int32_t vcp_worker(void* context) { if(len > 0) { furi_check( xStreamBufferSend(vcp->rx_stream, vcp->data_buffer, len, osWaitForever) == - len); + (size_t)len); } } else { #ifdef CLI_VCP_DEBUG @@ -275,16 +276,19 @@ static void cli_vcp_tx(const uint8_t* buffer, size_t size) { } static void cli_vcp_tx_stdout(void* _cookie, const char* data, size_t size) { + UNUSED(_cookie); cli_vcp_tx((const uint8_t*)data, size); } static void vcp_state_callback(void* context, uint8_t state) { + UNUSED(context); if(state == 0) { osThreadFlagsSet(furi_thread_get_thread_id(vcp->thread), VcpEvtDisconnect); } } static void vcp_on_cdc_control_line(void* context, uint8_t state) { + UNUSED(context); // bit 0: DTR state, bit 1: RTS state bool dtr = state & (1 << 0); @@ -296,11 +300,13 @@ static void vcp_on_cdc_control_line(void* context, uint8_t state) { } static void vcp_on_cdc_rx(void* context) { + UNUSED(context); uint32_t ret = osThreadFlagsSet(furi_thread_get_thread_id(vcp->thread), VcpEvtRx); furi_check((ret & osFlagsError) == 0); } static void vcp_on_cdc_tx_complete(void* context) { + UNUSED(context); osThreadFlagsSet(furi_thread_get_thread_id(vcp->thread), VcpEvtTx); } diff --git a/applications/crypto/crypto_cli.c b/applications/crypto/crypto_cli.c index 7cd9d5ccb17..a5ea80f8dc8 100644 --- a/applications/crypto/crypto_cli.c +++ b/applications/crypto/crypto_cli.c @@ -164,6 +164,7 @@ void crypto_cli_decrypt(Cli* cli, string_t args) { } void crypto_cli_has_key(Cli* cli, string_t args) { + UNUSED(cli); int key_slot = 0; uint8_t iv[16]; @@ -185,6 +186,7 @@ void crypto_cli_has_key(Cli* cli, string_t args) { } void crypto_cli_store_key(Cli* cli, string_t args) { + UNUSED(cli); int key_slot = 0; int key_size = 0; string_t key_type; @@ -277,6 +279,7 @@ void crypto_cli_store_key(Cli* cli, string_t args) { } static void crypto_cli(Cli* cli, string_t args, void* context) { + UNUSED(context); string_t cmd; string_init(cmd); diff --git a/applications/debug_tools/blink_test.c b/applications/debug_tools/blink_test.c index 35f9f434924..2efaa4dabb2 100644 --- a/applications/debug_tools/blink_test.c +++ b/applications/debug_tools/blink_test.c @@ -27,6 +27,7 @@ static void blink_test_update(void* ctx) { } static void blink_test_draw_callback(Canvas* canvas, void* ctx) { + UNUSED(ctx); canvas_clear(canvas); canvas_set_font(canvas, FontPrimary); canvas_draw_str(canvas, 2, 10, "Blink application"); @@ -41,6 +42,7 @@ static void blink_test_input_callback(InputEvent* input_event, void* ctx) { } int32_t blink_test_app(void* p) { + UNUSED(p); osMessageQueueId_t event_queue = osMessageQueueNew(8, sizeof(BlinkEvent), NULL); // Configure view port diff --git a/applications/debug_tools/display_test/display_test.c b/applications/debug_tools/display_test/display_test.c index 1a9a0e43870..95aea1deb70 100644 --- a/applications/debug_tools/display_test/display_test.c +++ b/applications/debug_tools/display_test/display_test.c @@ -70,10 +70,12 @@ static void display_test_submenu_callback(void* context, uint32_t index) { } static uint32_t display_test_previous_callback(void* context) { + UNUSED(context); return DisplayTestViewSubmenu; } static uint32_t display_test_exit_callback(void* context) { + UNUSED(context); return VIEW_NONE; } @@ -210,6 +212,7 @@ void display_test_free(DisplayTest* instance) { } int32_t display_test_run(DisplayTest* instance) { + UNUSED(instance); view_dispatcher_switch_to_view(instance->view_dispatcher, DisplayTestViewSubmenu); view_dispatcher_run(instance->view_dispatcher); @@ -217,6 +220,8 @@ int32_t display_test_run(DisplayTest* instance) { } int32_t display_test_app(void* p) { + UNUSED(p); + DisplayTest* instance = display_test_alloc(); int32_t ret = display_test_run(instance); diff --git a/applications/debug_tools/display_test/view_display_test.c b/applications/debug_tools/display_test/view_display_test.c index cc5f5dcfa07..133195d0f62 100644 --- a/applications/debug_tools/display_test/view_display_test.c +++ b/applications/debug_tools/display_test/view_display_test.c @@ -13,6 +13,7 @@ struct ViewDisplayTest { }; static void view_display_test_draw_callback_intro(Canvas* canvas, void* _model) { + UNUSED(_model); canvas_draw_str(canvas, 12, 24, "Use < and > to switch tests"); canvas_draw_str(canvas, 12, 36, "Use ^ and v to switch size"); canvas_draw_str(canvas, 32, 48, "Use (o) to flip"); diff --git a/applications/debug_tools/keypad_test.c b/applications/debug_tools/keypad_test.c index ae980317fde..705a1542695 100644 --- a/applications/debug_tools/keypad_test.c +++ b/applications/debug_tools/keypad_test.c @@ -60,6 +60,7 @@ static void keypad_test_input_callback(InputEvent* input_event, void* ctx) { } int32_t keypad_test_app(void* p) { + UNUSED(p); osMessageQueueId_t event_queue = osMessageQueueNew(32, sizeof(InputEvent), NULL); furi_check(event_queue); diff --git a/applications/debug_tools/text_box_test.c b/applications/debug_tools/text_box_test.c index 1c7ce18b106..bc56e88b88c 100644 --- a/applications/debug_tools/text_box_test.c +++ b/applications/debug_tools/text_box_test.c @@ -70,6 +70,7 @@ static void text_box_test_input_callback(InputEvent* input_event, void* ctx) { } int32_t text_box_test_app(void* p) { + UNUSED(p); osMessageQueueId_t event_queue = osMessageQueueNew(32, sizeof(InputEvent), NULL); furi_check(event_queue); @@ -90,7 +91,7 @@ int32_t text_box_test_app(void* p) { Gui* gui = furi_record_open("gui"); gui_add_view_port(gui, view_port, GuiLayerFullscreen); - uint32_t test_renders_num = SIZEOF_ARRAY(text_box_test_render); + uint32_t test_renders_num = COUNT_OF(text_box_test_render); InputEvent event; while(osMessageQueueGet(event_queue, &event, NULL, osWaitForever) == osOK) { TextBoxTestState* state = acquire_mutex_block(&state_mutex); diff --git a/applications/debug_tools/uart_echo.c b/applications/debug_tools/uart_echo.c index 0e4ee1d8976..206c6c06f86 100644 --- a/applications/debug_tools/uart_echo.c +++ b/applications/debug_tools/uart_echo.c @@ -80,11 +80,13 @@ static void uart_echo_view_draw_callback(Canvas* canvas, void* _model) { } static bool uart_echo_view_input_callback(InputEvent* event, void* context) { - bool consumed = false; - return consumed; + UNUSED(event); + UNUSED(context); + return false; } static uint32_t uart_echo_exit(void* context) { + UNUSED(context); return VIEW_NONE; } @@ -170,7 +172,10 @@ static int32_t uart_echo_worker(void* context) { notification_message(app->notification, &sequence_notification); with_view_model( - app->view, (UartDumpModel * model) { return true; }); + app->view, (UartDumpModel * model) { + UNUSED(model); + return true; + }); } } @@ -261,6 +266,7 @@ static void uart_echo_app_free(UartEchoApp* app) { } int32_t uart_echo_app(void* p) { + UNUSED(p); UartEchoApp* app = uart_echo_app_alloc(); view_dispatcher_run(app->view_dispatcher); uart_echo_app_free(app); diff --git a/applications/debug_tools/usb_mouse.c b/applications/debug_tools/usb_mouse.c index 6943e189d5e..a136375ac5f 100644 --- a/applications/debug_tools/usb_mouse.c +++ b/applications/debug_tools/usb_mouse.c @@ -18,6 +18,7 @@ typedef struct { } UsbMouseEvent; static void usb_mouse_render_callback(Canvas* canvas, void* ctx) { + UNUSED(ctx); canvas_clear(canvas); canvas_set_font(canvas, FontPrimary); @@ -37,6 +38,7 @@ static void usb_mouse_input_callback(InputEvent* input_event, void* ctx) { } int32_t usb_mouse_app(void* p) { + UNUSED(p); osMessageQueueId_t event_queue = osMessageQueueNew(8, sizeof(UsbMouseEvent), NULL); furi_check(event_queue); ViewPort* view_port = view_port_alloc(); diff --git a/applications/debug_tools/usb_test.c b/applications/debug_tools/usb_test.c index 0e8f068f5d1..44a17ceb84b 100644 --- a/applications/debug_tools/usb_test.c +++ b/applications/debug_tools/usb_test.c @@ -51,6 +51,7 @@ void usb_test_submenu_callback(void* context, uint32_t index) { } uint32_t usb_test_exit(void* context) { + UNUSED(context); return VIEW_NONE; } @@ -113,6 +114,7 @@ void usb_test_app_free(UsbTestApp* app) { } int32_t usb_test_app(void* p) { + UNUSED(p); UsbTestApp* app = usb_test_app_alloc(); view_dispatcher_run(app->view_dispatcher); diff --git a/applications/debug_tools/vibro_test.c b/applications/debug_tools/vibro_test.c index 07ce93b7a32..af6d336deeb 100644 --- a/applications/debug_tools/vibro_test.c +++ b/applications/debug_tools/vibro_test.c @@ -6,6 +6,7 @@ #include void vibro_test_draw_callback(Canvas* canvas, void* ctx) { + UNUSED(ctx); canvas_clear(canvas); canvas_set_font(canvas, FontPrimary); canvas_draw_str(canvas, 2, 10, "Vibro application"); @@ -22,6 +23,7 @@ void vibro_test_input_callback(InputEvent* input_event, void* ctx) { } int32_t vibro_test_app(void* p) { + UNUSED(p); osMessageQueueId_t event_queue = osMessageQueueNew(8, sizeof(InputEvent), NULL); // Configure view port diff --git a/applications/desktop/animations/animation_manager.c b/applications/desktop/animations/animation_manager.c index ea241ec3397..f8e937162bf 100644 --- a/applications/desktop/animations/animation_manager.c +++ b/applications/desktop/animations/animation_manager.c @@ -364,6 +364,7 @@ static bool animation_manager_is_valid_idle_animation( static StorageAnimation* animation_manager_select_idle_animation(AnimationManager* animation_manager) { + UNUSED(animation_manager); StorageAnimationList_t animation_list; StorageAnimationList_init(animation_list); animation_storage_fill_animation_list(&animation_list); diff --git a/applications/desktop/animations/animation_storage.c b/applications/desktop/animations/animation_storage.c index aa0f274b6d7..8f2740a7f1f 100644 --- a/applications/desktop/animations/animation_storage.c +++ b/applications/desktop/animations/animation_storage.c @@ -130,7 +130,7 @@ void animation_storage_fill_animation_list(StorageAnimationList_t* animation_lis flipper_format_free(file); // add hard-coded animations - for(int i = 0; i < dolphin_internal_size; ++i) { + for(size_t i = 0; i < dolphin_internal_size; ++i) { StorageAnimationList_push_back(*animation_list, (StorageAnimation*)&dolphin_internal[i]); } @@ -142,7 +142,7 @@ StorageAnimation* animation_storage_find_animation(const char* name) { furi_assert(strlen(name)); StorageAnimation* storage_animation = NULL; - for(int i = 0; i < dolphin_blocking_size; ++i) { + for(size_t i = 0; i < dolphin_blocking_size; ++i) { if(!strcmp(dolphin_blocking[i].manifest_info.name, name)) { storage_animation = (StorageAnimation*)&dolphin_blocking[i]; break; @@ -150,7 +150,7 @@ StorageAnimation* animation_storage_find_animation(const char* name) { } if(!storage_animation) { - for(int i = 0; i < dolphin_internal_size; ++i) { + for(size_t i = 0; i < dolphin_internal_size; ++i) { if(!strcmp(dolphin_internal[i].manifest_info.name, name)) { storage_animation = (StorageAnimation*)&dolphin_internal[i]; break; @@ -365,7 +365,7 @@ static bool animation_storage_load_bubbles(BubbleAnimation* animation, FlipperFo animation->frame_bubble_sequences = malloc(sizeof(FrameBubble*) * animation->frame_bubble_sequences_count); - uint32_t current_slot = 0; + int32_t current_slot = 0; for(int i = 0; i < animation->frame_bubble_sequences_count; ++i) { FURI_CONST_ASSIGN_PTR( animation->frame_bubble_sequences[i], malloc(sizeof(FrameBubble))); @@ -374,7 +374,7 @@ static bool animation_storage_load_bubbles(BubbleAnimation* animation, FlipperFo const FrameBubble* bubble = animation->frame_bubble_sequences[0]; int8_t index = -1; for(;;) { - if(!flipper_format_read_uint32(ff, "Slot", ¤t_slot, 1)) break; + if(!flipper_format_read_int32(ff, "Slot", ¤t_slot, 1)) break; if((current_slot != 0) && (index == -1)) break; if(current_slot == index) { diff --git a/applications/desktop/desktop.c b/applications/desktop/desktop.c index 7686a14568f..34c169e07a9 100644 --- a/applications/desktop/desktop.c +++ b/applications/desktop/desktop.c @@ -33,6 +33,7 @@ static void desktop_loader_callback(const void* message, void* context) { } static void desktop_lock_icon_callback(Canvas* canvas, void* context) { + UNUSED(context); furi_assert(canvas); canvas_draw_icon(canvas, 0, 0, &I_Lock_8x8); } @@ -298,6 +299,7 @@ static bool desktop_is_first_start() { } int32_t desktop_srv(void* p) { + UNUSED(p); Desktop* desktop = desktop_alloc(); bool loaded = LOAD_DESKTOP_SETTINGS(&desktop->settings); diff --git a/applications/desktop/desktop_settings/scenes/desktop_settings_scene_pin_disable.c b/applications/desktop/desktop_settings/scenes/desktop_settings_scene_pin_disable.c index 7486d4aa3c2..c0b3190e496 100644 --- a/applications/desktop/desktop_settings/scenes/desktop_settings_scene_pin_disable.c +++ b/applications/desktop/desktop_settings/scenes/desktop_settings_scene_pin_disable.c @@ -53,4 +53,5 @@ bool desktop_settings_scene_pin_disable_on_event(void* context, SceneManagerEven } void desktop_settings_scene_pin_disable_on_exit(void* context) { + UNUSED(context); } diff --git a/applications/desktop/desktop_settings/scenes/desktop_settings_scene_pin_error.c b/applications/desktop/desktop_settings/scenes/desktop_settings_scene_pin_error.c index 882b8f0ac70..a023d6b7aa6 100644 --- a/applications/desktop/desktop_settings/scenes/desktop_settings_scene_pin_error.c +++ b/applications/desktop/desktop_settings/scenes/desktop_settings_scene_pin_error.c @@ -18,6 +18,7 @@ static void pin_error_back_callback(void* context) { } static void pin_error_done_callback(const PinCode* pin_code, void* context) { + UNUSED(pin_code); furi_assert(context); DesktopSettingsApp* app = context; view_dispatcher_send_custom_event(app->view_dispatcher, SCENE_EVENT_EXIT); diff --git a/applications/desktop/desktop_settings/scenes/desktop_settings_scene_pin_setup_howto.c b/applications/desktop/desktop_settings/scenes/desktop_settings_scene_pin_setup_howto.c index 22727a7a096..b8d630f2eed 100644 --- a/applications/desktop/desktop_settings/scenes/desktop_settings_scene_pin_setup_howto.c +++ b/applications/desktop/desktop_settings/scenes/desktop_settings_scene_pin_setup_howto.c @@ -41,4 +41,5 @@ bool desktop_settings_scene_pin_setup_howto_on_event(void* context, SceneManager } void desktop_settings_scene_pin_setup_howto_on_exit(void* context) { + UNUSED(context); } diff --git a/applications/desktop/scenes/desktop_scene_fault.c b/applications/desktop/scenes/desktop_scene_fault.c index b75b32aa63b..36c958af58c 100644 --- a/applications/desktop/scenes/desktop_scene_fault.c +++ b/applications/desktop/scenes/desktop_scene_fault.c @@ -47,5 +47,6 @@ bool desktop_scene_fault_on_event(void* context, SceneManagerEvent event) { } void desktop_scene_fault_on_exit(void* context) { + UNUSED(context); furi_hal_rtc_set_fault_data(0); } diff --git a/applications/desktop/scenes/desktop_scene_first_start.c b/applications/desktop/scenes/desktop_scene_first_start.c index 9563094cf0b..dbdf8919e85 100644 --- a/applications/desktop/scenes/desktop_scene_first_start.c +++ b/applications/desktop/scenes/desktop_scene_first_start.c @@ -50,4 +50,5 @@ bool desktop_scene_first_start_on_event(void* context, SceneManagerEvent event) } void desktop_scene_first_start_on_exit(void* context) { + UNUSED(context); } diff --git a/applications/desktop/scenes/desktop_scene_lock_menu.c b/applications/desktop/scenes/desktop_scene_lock_menu.c index 11478810d15..a86bb184b6c 100644 --- a/applications/desktop/scenes/desktop_scene_lock_menu.c +++ b/applications/desktop/scenes/desktop_scene_lock_menu.c @@ -81,4 +81,5 @@ bool desktop_scene_lock_menu_on_event(void* context, SceneManagerEvent event) { } void desktop_scene_lock_menu_on_exit(void* context) { + UNUSED(context); } diff --git a/applications/desktop/scenes/desktop_scene_locked.c b/applications/desktop/scenes/desktop_scene_locked.c index 90df22269da..f4c08d32563 100644 --- a/applications/desktop/scenes/desktop_scene_locked.c +++ b/applications/desktop/scenes/desktop_scene_locked.c @@ -109,4 +109,5 @@ bool desktop_scene_locked_on_event(void* context, SceneManagerEvent event) { } void desktop_scene_locked_on_exit(void* context) { + UNUSED(context); } diff --git a/applications/desktop/scenes/desktop_scene_pin_timeout.c b/applications/desktop/scenes/desktop_scene_pin_timeout.c index 3c267a0dd55..ebe825e6a91 100644 --- a/applications/desktop/scenes/desktop_scene_pin_timeout.c +++ b/applications/desktop/scenes/desktop_scene_pin_timeout.c @@ -43,4 +43,5 @@ bool desktop_scene_pin_timeout_on_event(void* context, SceneManagerEvent event) } void desktop_scene_pin_timeout_on_exit(void* context) { + UNUSED(context); } diff --git a/applications/desktop/views/desktop_view_pin_timeout.c b/applications/desktop/views/desktop_view_pin_timeout.c index d9827339374..6e1e807fdb1 100644 --- a/applications/desktop/views/desktop_view_pin_timeout.c +++ b/applications/desktop/views/desktop_view_pin_timeout.c @@ -51,6 +51,8 @@ static void desktop_view_pin_timeout_timer_callback(TimerHandle_t timer) { } static bool desktop_view_pin_timeout_input(InputEvent* event, void* context) { + UNUSED(event); + UNUSED(context); return true; } diff --git a/applications/dialogs/dialogs.c b/applications/dialogs/dialogs.c index 2c8d24181ca..cf4a2ad6887 100644 --- a/applications/dialogs/dialogs.c +++ b/applications/dialogs/dialogs.c @@ -11,6 +11,7 @@ static DialogsApp* dialogs_app_alloc() { } static void dialogs_app_process_message(DialogsApp* app, DialogsAppMessage* message) { + UNUSED(app); switch(message->command) { case DialogsAppCommandFileOpen: message->return_data->bool_value = @@ -25,6 +26,7 @@ static void dialogs_app_process_message(DialogsApp* app, DialogsAppMessage* mess } int32_t dialogs_srv(void* p) { + UNUSED(p); DialogsApp* app = dialogs_app_alloc(); furi_record_create("dialogs", app); diff --git a/applications/dialogs/dialogs.h b/applications/dialogs/dialogs.h index 2a05ef417d1..9c71c0989f1 100644 --- a/applications/dialogs/dialogs.h +++ b/applications/dialogs/dialogs.h @@ -132,4 +132,4 @@ void dialog_message_show_storage_error(DialogsApp* context, const char* error_te #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/dialogs/dialogs_api.c b/applications/dialogs/dialogs_api.c index 261d9d4e1f7..c4efb287d92 100644 --- a/applications/dialogs/dialogs_api.c +++ b/applications/dialogs/dialogs_api.c @@ -70,4 +70,4 @@ void dialog_message_show_storage_error(DialogsApp* context, const char* error_te dialog_message_set_buttons(message, "Back", NULL, NULL); dialog_message_show(context, message); dialog_message_free(message); -} \ No newline at end of file +} diff --git a/applications/dialogs/dialogs_i.h b/applications/dialogs/dialogs_i.h index 7b601eda745..b61e10ab980 100644 --- a/applications/dialogs/dialogs_i.h +++ b/applications/dialogs/dialogs_i.h @@ -12,4 +12,4 @@ struct DialogsApp { #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/dialogs/dialogs_message.h b/applications/dialogs/dialogs_message.h index 48324b15cf0..d7b5fabf4d2 100644 --- a/applications/dialogs/dialogs_message.h +++ b/applications/dialogs/dialogs_message.h @@ -43,4 +43,4 @@ typedef struct { #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/dialogs/dialogs_module_file_select.h b/applications/dialogs/dialogs_module_file_select.h index da012fb4e29..749fe9c1d7f 100644 --- a/applications/dialogs/dialogs_module_file_select.h +++ b/applications/dialogs/dialogs_module_file_select.h @@ -9,4 +9,4 @@ bool dialogs_app_process_module_file_select(const DialogsAppMessageDataFileSelec #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/dialogs/dialogs_module_message.h b/applications/dialogs/dialogs_module_message.h index 189870acd89..b4f1b162cb7 100644 --- a/applications/dialogs/dialogs_module_message.h +++ b/applications/dialogs/dialogs_module_message.h @@ -9,4 +9,4 @@ DialogMessageButton dialogs_app_process_module_message(const DialogsAppMessageDa #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/dialogs/view_holder.h b/applications/dialogs/view_holder.h index 785ad20a8f5..8e7db3b857f 100644 --- a/applications/dialogs/view_holder.h +++ b/applications/dialogs/view_holder.h @@ -95,4 +95,4 @@ void view_holder_update(View* view, void* context); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/dolphin/dolphin.c b/applications/dolphin/dolphin.c index 60068afff89..479602868ed 100644 --- a/applications/dolphin/dolphin.c +++ b/applications/dolphin/dolphin.c @@ -118,6 +118,7 @@ void dolphin_event_send_wait(Dolphin* dolphin, DolphinEvent* event) { } void dolphin_event_release(Dolphin* dolphin, DolphinEvent* event) { + UNUSED(dolphin); if(event->flag) { osEventFlagsSet(event->flag, DOLPHIN_LOCK_EVENT_FLAG); } @@ -149,6 +150,7 @@ static void dolphin_update_clear_limits_timer_period(Dolphin* dolphin) { } int32_t dolphin_srv(void* p) { + UNUSED(p); Dolphin* dolphin = dolphin_alloc(); furi_record_create("dolphin", dolphin); diff --git a/applications/dolphin/helpers/dolphin_state.h b/applications/dolphin/helpers/dolphin_state.h index 07d0b427c38..3e02fb87201 100644 --- a/applications/dolphin/helpers/dolphin_state.h +++ b/applications/dolphin/helpers/dolphin_state.h @@ -12,7 +12,7 @@ typedef struct { uint32_t flags; uint32_t icounter; - uint32_t butthurt; + int32_t butthurt; uint64_t timestamp; } DolphinStoreData; diff --git a/applications/dolphin/passport/passport.c b/applications/dolphin/passport/passport.c index 3df88a8355e..13bf086b5dc 100644 --- a/applications/dolphin/passport/passport.c +++ b/applications/dolphin/passport/passport.c @@ -90,6 +90,7 @@ static void render_callback(Canvas* canvas, void* ctx) { } int32_t passport_app(void* p) { + UNUSED(p); osSemaphoreId_t semaphore = osSemaphoreNew(1, 0, NULL); furi_assert(semaphore); diff --git a/applications/gpio/gpio_app.c b/applications/gpio/gpio_app.c index 7dfce83667a..b5f5184a665 100644 --- a/applications/gpio/gpio_app.c +++ b/applications/gpio/gpio_app.c @@ -95,6 +95,7 @@ void gpio_app_free(GpioApp* app) { } int32_t gpio_app(void* p) { + UNUSED(p); GpioApp* gpio_app = gpio_app_alloc(); view_dispatcher_run(gpio_app->view_dispatcher); diff --git a/applications/gpio/scenes/gpio_scene_test.c b/applications/gpio/scenes/gpio_scene_test.c index 009e2ff4300..b015d80902e 100644 --- a/applications/gpio/scenes/gpio_scene_test.c +++ b/applications/gpio/scenes/gpio_scene_test.c @@ -19,9 +19,12 @@ void gpio_scene_test_on_enter(void* context) { } bool gpio_scene_test_on_event(void* context, SceneManagerEvent event) { + UNUSED(context); + UNUSED(event); return false; } void gpio_scene_test_on_exit(void* context) { + UNUSED(context); gpio_item_configure_all_pins(GpioModeAnalog); } diff --git a/applications/gpio/scenes/gpio_scene_usb_uart_config.c b/applications/gpio/scenes/gpio_scene_usb_uart_config.c index 6fba0d1ecdb..653a306aa56 100644 --- a/applications/gpio/scenes/gpio_scene_usb_uart_config.c +++ b/applications/gpio/scenes/gpio_scene_usb_uart_config.c @@ -28,12 +28,9 @@ static const uint32_t baudrate_list[] = { }; bool gpio_scene_usb_uart_cfg_on_event(void* context, SceneManagerEvent event) { - //GpioApp* app = context; - bool consumed = false; - - if(event.type == SceneManagerEventTypeCustom) { - } - return consumed; + UNUSED(context); + UNUSED(event); + return false; } static void line_vcp_cb(VariableItem* item) { diff --git a/applications/gpio/usb_uart_bridge.c b/applications/gpio/usb_uart_bridge.c index 8f27340e402..f70cf640d8c 100644 --- a/applications/gpio/usb_uart_bridge.c +++ b/applications/gpio/usb_uart_bridge.c @@ -101,6 +101,7 @@ static void usb_uart_vcp_init(UsbUartBridge* usb_uart, uint8_t vcp_ch) { } static void usb_uart_vcp_deinit(UsbUartBridge* usb_uart, uint8_t vcp_ch) { + UNUSED(usb_uart); furi_hal_cdc_set_callbacks(vcp_ch, NULL, NULL); FURI_LOG_I("", "Deinit %d", vcp_ch); if(vcp_ch != 0) { @@ -120,6 +121,7 @@ static void usb_uart_serial_init(UsbUartBridge* usb_uart, uint8_t uart_ch) { } static void usb_uart_serial_deinit(UsbUartBridge* usb_uart, uint8_t uart_ch) { + UNUSED(usb_uart); furi_hal_uart_set_irq_cb(uart_ch, NULL, NULL); if(uart_ch == FuriHalUartIdUSART1) furi_hal_console_enable(); @@ -143,7 +145,7 @@ static void usb_uart_set_baudrate(UsbUartBridge* usb_uart, uint32_t baudrate) { static void usb_uart_update_ctrl_lines(UsbUartBridge* usb_uart) { if(usb_uart->cfg.flow_pins != 0) { - furi_assert((usb_uart->cfg.flow_pins - 1) < (sizeof(flow_pins) / sizeof(flow_pins[0]))); + furi_assert((size_t)(usb_uart->cfg.flow_pins - 1) < COUNT_OF(flow_pins)); uint8_t state = furi_hal_cdc_get_ctrl_line_state(usb_uart->cfg.vcp_ch); furi_hal_gpio_write(flow_pins[usb_uart->cfg.flow_pins - 1][0], !(state & USB_CDC_BIT_RTS)); @@ -171,7 +173,7 @@ static int32_t usb_uart_worker(void* context) { usb_uart_serial_init(usb_uart, usb_uart->cfg.uart_ch); usb_uart_set_baudrate(usb_uart, usb_uart->cfg.baudrate); if(usb_uart->cfg.flow_pins != 0) { - furi_assert((usb_uart->cfg.flow_pins - 1) < (sizeof(flow_pins) / sizeof(flow_pins[0]))); + furi_assert((size_t)(usb_uart->cfg.flow_pins - 1) < COUNT_OF(flow_pins)); furi_hal_gpio_init_simple( flow_pins[usb_uart->cfg.flow_pins - 1][0], GpioModeOutputPushPull); furi_hal_gpio_init_simple( @@ -238,9 +240,7 @@ static int32_t usb_uart_worker(void* context) { flow_pins[usb_uart->cfg.flow_pins - 1][1], GpioModeAnalog); } if(usb_uart->cfg_new.flow_pins != 0) { - furi_assert( - (usb_uart->cfg_new.flow_pins - 1) < - (sizeof(flow_pins) / sizeof(flow_pins[0]))); + furi_assert((size_t)(usb_uart->cfg_new.flow_pins - 1) < COUNT_OF(flow_pins)); furi_hal_gpio_init_simple( flow_pins[usb_uart->cfg_new.flow_pins - 1][0], GpioModeOutputPushPull); furi_hal_gpio_init_simple( @@ -318,14 +318,18 @@ static void vcp_on_cdc_rx(void* context) { } static void vcp_state_callback(void* context, uint8_t state) { + UNUSED(context); + UNUSED(state); } static void vcp_on_cdc_control_line(void* context, uint8_t state) { + UNUSED(state); UsbUartBridge* usb_uart = (UsbUartBridge*)context; osThreadFlagsSet(furi_thread_get_thread_id(usb_uart->thread), WorkerEvtCtrlLineSet); } static void vcp_on_line_config(void* context, struct usb_cdc_line_coding* config) { + UNUSED(config); UsbUartBridge* usb_uart = (UsbUartBridge*)context; osThreadFlagsSet(furi_thread_get_thread_id(usb_uart->thread), WorkerEvtLineCfgSet); } diff --git a/applications/gpio/views/gpio_test.c b/applications/gpio/views/gpio_test.c index cf05dafadea..37c2f408326 100755 --- a/applications/gpio/views/gpio_test.c +++ b/applications/gpio/views/gpio_test.c @@ -123,6 +123,7 @@ void gpio_test_set_ok_callback(GpioTest* gpio_test, GpioTestOkCallback callback, furi_assert(callback); with_view_model( gpio_test->view, (GpioTestModel * model) { + UNUSED(model); gpio_test->callback = callback; gpio_test->context = context; return false; diff --git a/applications/gpio/views/gpio_usb_uart.c b/applications/gpio/views/gpio_usb_uart.c index cd507570166..d2d371b6822 100644 --- a/applications/gpio/views/gpio_usb_uart.c +++ b/applications/gpio/views/gpio_usb_uart.c @@ -130,6 +130,7 @@ void gpio_usb_uart_set_callback(GpioUsbUart* usb_uart, GpioUsbUartCallback callb with_view_model( usb_uart->view, (GpioUsbUartModel * model) { + UNUSED(model); usb_uart->callback = callback; usb_uart->context = context; return false; diff --git a/applications/gui/gui.c b/applications/gui/gui.c index 9ecfdebbf96..4fc0935ea8f 100644 --- a/applications/gui/gui.c +++ b/applications/gui/gui.c @@ -469,6 +469,7 @@ Gui* gui_alloc() { } int32_t gui_srv(void* p) { + UNUSED(p); Gui* gui = gui_alloc(); furi_record_create("gui", gui); diff --git a/applications/gui/icon.c b/applications/gui/icon.c index bbc77516911..98f35b12a1a 100644 --- a/applications/gui/icon.c +++ b/applications/gui/icon.c @@ -10,4 +10,4 @@ uint8_t icon_get_height(const Icon* instance) { const uint8_t* icon_get_data(const Icon* instance) { return instance->frames[0]; -} \ No newline at end of file +} diff --git a/applications/gui/icon.h b/applications/gui/icon.h index ebe40266b4b..e33c4d34d2b 100644 --- a/applications/gui/icon.h +++ b/applications/gui/icon.h @@ -39,4 +39,4 @@ const uint8_t* icon_get_data(const Icon* instance); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/gui/modules/button_menu.c b/applications/gui/modules/button_menu.c index 8f38efc4651..36fd6f3abca 100644 --- a/applications/gui/modules/button_menu.c +++ b/applications/gui/modules/button_menu.c @@ -331,7 +331,7 @@ void button_menu_set_selected_item(ButtonMenu* button_menu, uint32_t index) { ButtonMenuItemArray_it_t it; for(ButtonMenuItemArray_it(it, model->items); !ButtonMenuItemArray_end_p(it); ButtonMenuItemArray_next(it), ++item_position) { - if(ButtonMenuItemArray_cref(it)->index == index) { + if((uint32_t)ButtonMenuItemArray_cref(it)->index == index) { model->position = item_position; break; } diff --git a/applications/gui/modules/button_panel.c b/applications/gui/modules/button_panel.c index c2328d20656..e3ae59a3671 100644 --- a/applications/gui/modules/button_panel.c +++ b/applications/gui/modules/button_panel.c @@ -215,8 +215,8 @@ static void button_panel_view_draw_callback(Canvas* canvas, void* _model) { static void button_panel_process_down(ButtonPanel* button_panel) { with_view_model( button_panel->view, (ButtonPanelModel * model) { - size_t new_selected_item_x = model->selected_item_x; - size_t new_selected_item_y = model->selected_item_y; + uint16_t new_selected_item_x = model->selected_item_x; + uint16_t new_selected_item_y = model->selected_item_y; size_t i; if(new_selected_item_y >= (model->reserve_y - 1)) return false; @@ -291,8 +291,8 @@ static void button_panel_process_left(ButtonPanel* button_panel) { static void button_panel_process_right(ButtonPanel* button_panel) { with_view_model( button_panel->view, (ButtonPanelModel * model) { - size_t new_selected_item_x = model->selected_item_x; - size_t new_selected_item_y = model->selected_item_y; + uint16_t new_selected_item_x = model->selected_item_x; + uint16_t new_selected_item_y = model->selected_item_y; size_t i; if(new_selected_item_x >= (model->reserve_x - 1)) return false; diff --git a/applications/gui/modules/byte_input.h b/applications/gui/modules/byte_input.h index b2f94f3cacc..42c4b5d65f9 100644 --- a/applications/gui/modules/byte_input.h +++ b/applications/gui/modules/byte_input.h @@ -66,4 +66,4 @@ void byte_input_set_header_text(ByteInput* byte_input, const char* text); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/gui/modules/empty_screen.c b/applications/gui/modules/empty_screen.c index 61b4af36c39..0a51bc71c6a 100644 --- a/applications/gui/modules/empty_screen.c +++ b/applications/gui/modules/empty_screen.c @@ -6,10 +6,13 @@ struct EmptyScreen { }; static void empty_screen_view_draw_callback(Canvas* canvas, void* _model) { + UNUSED(_model); canvas_clear(canvas); } static bool empty_screen_view_input_callback(InputEvent* event, void* context) { + UNUSED(event); + UNUSED(context); return false; } diff --git a/applications/gui/modules/empty_screen.h b/applications/gui/modules/empty_screen.h index 43d2fe04995..23ebeb3a05d 100644 --- a/applications/gui/modules/empty_screen.h +++ b/applications/gui/modules/empty_screen.h @@ -38,4 +38,4 @@ View* empty_screen_get_view(EmptyScreen* empty_screen); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/gui/modules/file_select.h b/applications/gui/modules/file_select.h index 7318c87c7cf..ed3d5b60c3f 100644 --- a/applications/gui/modules/file_select.h +++ b/applications/gui/modules/file_select.h @@ -28,4 +28,4 @@ void file_select_set_selected_file(FileSelect* file_select, const char* filename #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/gui/modules/loading.c b/applications/gui/modules/loading.c index 7f623e24549..60dc8338d1a 100644 --- a/applications/gui/modules/loading.c +++ b/applications/gui/modules/loading.c @@ -34,6 +34,7 @@ static void loading_draw_callback(Canvas* canvas, void* _model) { } static bool loading_input_callback(InputEvent* event, void* context) { + UNUSED(event); furi_assert(context); return true; } diff --git a/applications/gui/modules/text_box.c b/applications/gui/modules/text_box.c index a7d0d7630cc..52307ec25d5 100755 --- a/applications/gui/modules/text_box.c +++ b/applications/gui/modules/text_box.c @@ -87,7 +87,7 @@ static void text_box_insert_endline(Canvas* canvas, TextBoxModel* model) { model->scroll_num = line_num - 4; model->scroll_pos = line_num - 5; } else { - model->scroll_num = MAX(line_num - 4, 0); + model->scroll_num = MAX(line_num - 4, 0u); model->scroll_pos = 0; } } diff --git a/applications/gui/modules/text_input.c b/applications/gui/modules/text_input.c index 058762adf5d..04cd2d7f843 100644 --- a/applications/gui/modules/text_input.c +++ b/applications/gui/modules/text_input.c @@ -122,15 +122,15 @@ static const TextInputKey* get_row(uint8_t row_index) { return row; } -static const char get_selected_char(TextInputModel* model) { +static char get_selected_char(TextInputModel* model) { return get_row(model->selected_row)[model->selected_column].text; } -static const bool char_is_lowercase(char letter) { +static bool char_is_lowercase(char letter) { return (letter >= 0x61 && letter <= 0x7A); } -static const char char_to_uppercase(const char letter) { +static char char_to_uppercase(const char letter) { if(isalpha(letter)) { return (letter - 0x20); } else { @@ -260,6 +260,7 @@ static void text_input_view_draw_callback(Canvas* canvas, void* _model) { } static void text_input_handle_up(TextInput* text_input, TextInputModel* model) { + UNUSED(text_input); if(model->selected_row > 0) { model->selected_row--; if(model->selected_column > get_row_size(model->selected_row) - 6) { @@ -269,6 +270,7 @@ static void text_input_handle_up(TextInput* text_input, TextInputModel* model) { } static void text_input_handle_down(TextInput* text_input, TextInputModel* model) { + UNUSED(text_input); if(model->selected_row < keyboard_row_count - 1) { model->selected_row++; if(model->selected_column > get_row_size(model->selected_row) - 4) { @@ -278,6 +280,7 @@ static void text_input_handle_down(TextInput* text_input, TextInputModel* model) } static void text_input_handle_left(TextInput* text_input, TextInputModel* model) { + UNUSED(text_input); if(model->selected_column > 0) { model->selected_column--; } else { @@ -286,6 +289,7 @@ static void text_input_handle_left(TextInput* text_input, TextInputModel* model) } static void text_input_handle_right(TextInput* text_input, TextInputModel* model) { + UNUSED(text_input); if(model->selected_column < get_row_size(model->selected_row) - 1) { model->selected_column++; } else { diff --git a/applications/gui/modules/validators.h b/applications/gui/modules/validators.h index 3a834a8a606..15dbe901f67 100644 --- a/applications/gui/modules/validators.h +++ b/applications/gui/modules/validators.h @@ -19,4 +19,4 @@ bool validator_is_file_callback(const char* text, string_t error, void* context) #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/gui/modules/variable_item_list.c b/applications/gui/modules/variable_item_list.c index ebbdd434cd8..4e5e4664f2c 100644 --- a/applications/gui/modules/variable_item_list.c +++ b/applications/gui/modules/variable_item_list.c @@ -364,6 +364,7 @@ void variable_item_list_set_enter_callback( furi_assert(callback); with_view_model( variable_item_list->view, (VariableItemListModel * model) { + UNUSED(model); variable_item_list->callback = callback; variable_item_list->context = context; return false; diff --git a/applications/gui/view.c b/applications/gui/view.c index e9642d9b85e..ec73882de55 100644 --- a/applications/gui/view.c +++ b/applications/gui/view.c @@ -126,6 +126,7 @@ void view_commit_model(View* view, bool update) { } void view_icon_animation_callback(IconAnimation* instance, void* context) { + UNUSED(instance); furi_assert(context); View* view = context; if(view->update_callback) { diff --git a/applications/ibutton/ibutton.cpp b/applications/ibutton/ibutton.cpp index 35dc2ce6c9f..aae0d31738c 100644 --- a/applications/ibutton/ibutton.cpp +++ b/applications/ibutton/ibutton.cpp @@ -7,4 +7,4 @@ extern "C" int32_t ibutton_app(void* p) { delete app; return 255; -} \ No newline at end of file +} diff --git a/applications/ibutton/ibutton_app.h b/applications/ibutton/ibutton_app.h index d3d8cac68e2..08af38573a8 100644 --- a/applications/ibutton/ibutton_app.h +++ b/applications/ibutton/ibutton_app.h @@ -141,4 +141,4 @@ class iButtonApp { bool load_key_data(string_t key_path); void make_app_folder(); -}; \ No newline at end of file +}; diff --git a/applications/ibutton/ibutton_cli.c b/applications/ibutton/ibutton_cli.c index c50ec210e8d..4592cdad9ee 100644 --- a/applications/ibutton/ibutton_cli.c +++ b/applications/ibutton/ibutton_cli.c @@ -240,6 +240,7 @@ void ibutton_cli_emulate(Cli* cli, string_t args) { }; static void ibutton_cli(Cli* cli, string_t args, void* context) { + UNUSED(context); string_t cmd; string_init(cmd); @@ -268,6 +269,7 @@ void onewire_cli_print_usage() { }; static void onewire_cli_search(Cli* cli) { + UNUSED(cli); OneWireHost* onewire = onewire_host_alloc(); uint8_t address[8]; bool done = false; @@ -297,6 +299,7 @@ static void onewire_cli_search(Cli* cli) { } void onewire_cli(Cli* cli, string_t args, void* context) { + UNUSED(context); string_t cmd; string_init(cmd); @@ -311,4 +314,4 @@ void onewire_cli(Cli* cli, string_t args, void* context) { } string_clear(cmd); -} \ No newline at end of file +} diff --git a/applications/ibutton/ibutton_event.h b/applications/ibutton/ibutton_event.h index b4dac2f4bfa..8b1775c1b4d 100644 --- a/applications/ibutton/ibutton_event.h +++ b/applications/ibutton/ibutton_event.h @@ -24,6 +24,7 @@ class iButtonEvent { // payload union { + uint32_t dummy; uint32_t menu_index; DialogExResult dialog_result; GuiButtonType widget_button_result; diff --git a/applications/ibutton/ibutton_view_manager.cpp b/applications/ibutton/ibutton_view_manager.cpp index efaa6f817d5..5a2c94f1e0b 100755 --- a/applications/ibutton/ibutton_view_manager.cpp +++ b/applications/ibutton/ibutton_view_manager.cpp @@ -129,7 +129,7 @@ void iButtonAppViewManager::send_event(iButtonEvent* event) { furi_check(result == osOK); } -uint32_t iButtonAppViewManager::previous_view_callback(void* context) { +uint32_t iButtonAppViewManager::previous_view_callback(void*) { if(event_queue != NULL) { iButtonEvent event; event.type = iButtonEvent::Type::EventTypeBack; @@ -137,4 +137,4 @@ uint32_t iButtonAppViewManager::previous_view_callback(void* context) { } return VIEW_IGNORE; -} \ No newline at end of file +} diff --git a/applications/ibutton/ibutton_view_manager.h b/applications/ibutton/ibutton_view_manager.h index 89d084baf18..336ba6e2fa2 100644 --- a/applications/ibutton/ibutton_view_manager.h +++ b/applications/ibutton/ibutton_view_manager.h @@ -48,4 +48,4 @@ class iButtonAppViewManager { Gui* gui; uint32_t previous_view_callback(void* context); -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_add_type.h b/applications/ibutton/scene/ibutton_scene_add_type.h index d49ac128de3..6a3d07e591f 100644 --- a/applications/ibutton/scene/ibutton_scene_add_type.h +++ b/applications/ibutton/scene/ibutton_scene_add_type.h @@ -9,4 +9,4 @@ class iButtonSceneAddType : public iButtonScene { private: uint32_t submenu_item_selected = 0; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_add_value.cpp b/applications/ibutton/scene/ibutton_scene_add_value.cpp index cb1e287cb6c..d0108ae5764 100755 --- a/applications/ibutton/scene/ibutton_scene_add_value.cpp +++ b/applications/ibutton/scene/ibutton_scene_add_value.cpp @@ -50,4 +50,4 @@ void iButtonSceneAddValue::on_exit(iButtonApp* app) { byte_input_set_result_callback(byte_input, NULL, NULL, NULL, NULL, 0); byte_input_set_header_text(byte_input, {0}); -} \ No newline at end of file +} diff --git a/applications/ibutton/scene/ibutton_scene_add_value.h b/applications/ibutton/scene/ibutton_scene_add_value.h index ff6de577588..7a734160397 100644 --- a/applications/ibutton/scene/ibutton_scene_add_value.h +++ b/applications/ibutton/scene/ibutton_scene_add_value.h @@ -10,4 +10,4 @@ class iButtonSceneAddValue : public iButtonScene { private: uint8_t new_key_data[IBUTTON_KEY_DATA_SIZE] = {}; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_delete_confirm.h b/applications/ibutton/scene/ibutton_scene_delete_confirm.h index d82c376d0d3..cacbb7fe5e6 100644 --- a/applications/ibutton/scene/ibutton_scene_delete_confirm.h +++ b/applications/ibutton/scene/ibutton_scene_delete_confirm.h @@ -6,4 +6,4 @@ class iButtonSceneDeleteConfirm : public iButtonScene { void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_delete_success.cpp b/applications/ibutton/scene/ibutton_scene_delete_success.cpp index 8c645a5f5e5..ba1381610fc 100644 --- a/applications/ibutton/scene/ibutton_scene_delete_success.cpp +++ b/applications/ibutton/scene/ibutton_scene_delete_success.cpp @@ -44,4 +44,4 @@ void iButtonSceneDeleteSuccess::on_exit(iButtonApp* app) { popup_disable_timeout(popup); popup_set_context(popup, NULL); popup_set_callback(popup, NULL); -} \ No newline at end of file +} diff --git a/applications/ibutton/scene/ibutton_scene_delete_success.h b/applications/ibutton/scene/ibutton_scene_delete_success.h index 0c17c7ed80d..1fbe5230aed 100644 --- a/applications/ibutton/scene/ibutton_scene_delete_success.h +++ b/applications/ibutton/scene/ibutton_scene_delete_success.h @@ -6,4 +6,4 @@ class iButtonSceneDeleteSuccess : public iButtonScene { void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_emulate.cpp b/applications/ibutton/scene/ibutton_scene_emulate.cpp index da6021fe38b..c00535f8c87 100644 --- a/applications/ibutton/scene/ibutton_scene_emulate.cpp +++ b/applications/ibutton/scene/ibutton_scene_emulate.cpp @@ -6,7 +6,10 @@ static void emulate_callback(void* context, bool emulated) { furi_assert(context); if(emulated) { iButtonApp* app = static_cast(context); - iButtonEvent event = {.type = iButtonEvent::Type::EventTypeWorkerEmulated}; + iButtonEvent event = { + .payload = {.worker_write_result = iButtonWorkerWriteOK}, + .type = iButtonEvent::Type::EventTypeWorkerEmulated, + }; app->get_view_manager()->send_event(&event); } } diff --git a/applications/ibutton/scene/ibutton_scene_emulate.h b/applications/ibutton/scene/ibutton_scene_emulate.h index c2bedcc511c..61107b94bb0 100644 --- a/applications/ibutton/scene/ibutton_scene_emulate.h +++ b/applications/ibutton/scene/ibutton_scene_emulate.h @@ -6,4 +6,4 @@ class iButtonSceneEmulate : public iButtonScene { void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_exit_confirm.h b/applications/ibutton/scene/ibutton_scene_exit_confirm.h index dc5981e13e9..f621a59a5ee 100644 --- a/applications/ibutton/scene/ibutton_scene_exit_confirm.h +++ b/applications/ibutton/scene/ibutton_scene_exit_confirm.h @@ -6,4 +6,4 @@ class iButtonSceneExitConfirm : public iButtonScene { void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_info.cpp b/applications/ibutton/scene/ibutton_scene_info.cpp index e51b2095f51..dd779789293 100755 --- a/applications/ibutton/scene/ibutton_scene_info.cpp +++ b/applications/ibutton/scene/ibutton_scene_info.cpp @@ -44,9 +44,8 @@ void iButtonSceneInfo::on_enter(iButtonApp* app) { view_manager->switch_to(iButtonAppViewManager::Type::iButtonAppViewWidget); } -bool iButtonSceneInfo::on_event(iButtonApp* app, iButtonEvent* event) { - bool consumed = false; - return consumed; +bool iButtonSceneInfo::on_event(iButtonApp*, iButtonEvent*) { + return false; } void iButtonSceneInfo::on_exit(iButtonApp* app) { diff --git a/applications/ibutton/scene/ibutton_scene_info.h b/applications/ibutton/scene/ibutton_scene_info.h index e2c6b2cfa73..bbfb0c607c0 100644 --- a/applications/ibutton/scene/ibutton_scene_info.h +++ b/applications/ibutton/scene/ibutton_scene_info.h @@ -6,4 +6,4 @@ class iButtonSceneInfo : public iButtonScene { void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_read.cpp b/applications/ibutton/scene/ibutton_scene_read.cpp index 7162652d57f..1cfdbfe320f 100644 --- a/applications/ibutton/scene/ibutton_scene_read.cpp +++ b/applications/ibutton/scene/ibutton_scene_read.cpp @@ -5,7 +5,10 @@ static void read_callback(void* context) { furi_assert(context); iButtonApp* app = static_cast(context); - iButtonEvent event = {.type = iButtonEvent::Type::EventTypeWorkerRead}; + iButtonEvent event = { + .payload = {.dummy = 0}, + .type = iButtonEvent::Type::EventTypeWorkerRead, + }; app->get_view_manager()->send_event(&event); } diff --git a/applications/ibutton/scene/ibutton_scene_read.h b/applications/ibutton/scene/ibutton_scene_read.h index b9fefb0c7f5..5654777847d 100644 --- a/applications/ibutton/scene/ibutton_scene_read.h +++ b/applications/ibutton/scene/ibutton_scene_read.h @@ -6,4 +6,4 @@ class iButtonSceneRead : public iButtonScene { void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_read_crc_error.cpp b/applications/ibutton/scene/ibutton_scene_read_crc_error.cpp index 213266cbb4e..d9d3ffd5cc4 100644 --- a/applications/ibutton/scene/ibutton_scene_read_crc_error.cpp +++ b/applications/ibutton/scene/ibutton_scene_read_crc_error.cpp @@ -71,4 +71,4 @@ void iButtonSceneReadCRCError::on_exit(iButtonApp* app) { dialog_ex_set_context(dialog_ex, NULL); app->notify_red_off(); -} \ No newline at end of file +} diff --git a/applications/ibutton/scene/ibutton_scene_read_crc_error.h b/applications/ibutton/scene/ibutton_scene_read_crc_error.h index 43a4dfac449..db72d068a32 100644 --- a/applications/ibutton/scene/ibutton_scene_read_crc_error.h +++ b/applications/ibutton/scene/ibutton_scene_read_crc_error.h @@ -6,4 +6,4 @@ class iButtonSceneReadCRCError : public iButtonScene { void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_read_key_menu.h b/applications/ibutton/scene/ibutton_scene_read_key_menu.h index e85ad815d4d..d68a4d1db38 100644 --- a/applications/ibutton/scene/ibutton_scene_read_key_menu.h +++ b/applications/ibutton/scene/ibutton_scene_read_key_menu.h @@ -9,4 +9,4 @@ class iButtonSceneReadKeyMenu : public iButtonScene { private: uint32_t submenu_item_selected = 0; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_read_not_key_error.cpp b/applications/ibutton/scene/ibutton_scene_read_not_key_error.cpp index 7d0a235f1dd..58ea853c181 100644 --- a/applications/ibutton/scene/ibutton_scene_read_not_key_error.cpp +++ b/applications/ibutton/scene/ibutton_scene_read_not_key_error.cpp @@ -71,4 +71,4 @@ void iButtonSceneReadNotKeyError::on_exit(iButtonApp* app) { dialog_ex_set_context(dialog_ex, NULL); app->notify_red_off(); -} \ No newline at end of file +} diff --git a/applications/ibutton/scene/ibutton_scene_read_not_key_error.h b/applications/ibutton/scene/ibutton_scene_read_not_key_error.h index 6643a206ac3..30d20033eaa 100644 --- a/applications/ibutton/scene/ibutton_scene_read_not_key_error.h +++ b/applications/ibutton/scene/ibutton_scene_read_not_key_error.h @@ -6,4 +6,4 @@ class iButtonSceneReadNotKeyError : public iButtonScene { void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_read_success.h b/applications/ibutton/scene/ibutton_scene_read_success.h index 9548d6b4bd7..bf9003c2328 100644 --- a/applications/ibutton/scene/ibutton_scene_read_success.h +++ b/applications/ibutton/scene/ibutton_scene_read_success.h @@ -6,4 +6,4 @@ class iButtonSceneReadSuccess : public iButtonScene { void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_retry_confirm.h b/applications/ibutton/scene/ibutton_scene_retry_confirm.h index 2f96e13f1ee..0fa71ad1110 100644 --- a/applications/ibutton/scene/ibutton_scene_retry_confirm.h +++ b/applications/ibutton/scene/ibutton_scene_retry_confirm.h @@ -6,4 +6,4 @@ class iButtonSceneRetryConfirm : public iButtonScene { void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_save_name.h b/applications/ibutton/scene/ibutton_scene_save_name.h index 8be593da728..2d7f102e14a 100644 --- a/applications/ibutton/scene/ibutton_scene_save_name.h +++ b/applications/ibutton/scene/ibutton_scene_save_name.h @@ -6,4 +6,4 @@ class iButtonSceneSaveName : public iButtonScene { void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_save_success.cpp b/applications/ibutton/scene/ibutton_scene_save_success.cpp index 13e173d2d9c..92c0e695685 100644 --- a/applications/ibutton/scene/ibutton_scene_save_success.cpp +++ b/applications/ibutton/scene/ibutton_scene_save_success.cpp @@ -49,4 +49,4 @@ void iButtonSceneSaveSuccess::on_exit(iButtonApp* app) { popup_disable_timeout(popup); popup_set_context(popup, NULL); popup_set_callback(popup, NULL); -} \ No newline at end of file +} diff --git a/applications/ibutton/scene/ibutton_scene_save_success.h b/applications/ibutton/scene/ibutton_scene_save_success.h index 95742bda7e0..14c7412dc9b 100644 --- a/applications/ibutton/scene/ibutton_scene_save_success.h +++ b/applications/ibutton/scene/ibutton_scene_save_success.h @@ -6,4 +6,4 @@ class iButtonSceneSaveSuccess : public iButtonScene { void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_saved_key_menu.h b/applications/ibutton/scene/ibutton_scene_saved_key_menu.h index 399ed1ce33a..08809779d11 100644 --- a/applications/ibutton/scene/ibutton_scene_saved_key_menu.h +++ b/applications/ibutton/scene/ibutton_scene_saved_key_menu.h @@ -9,4 +9,4 @@ class iButtonSceneSavedKeyMenu : public iButtonScene { private: uint32_t submenu_item_selected = 0; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_select_key.cpp b/applications/ibutton/scene/ibutton_scene_select_key.cpp index 1f1ece352b1..6a1246a49f2 100644 --- a/applications/ibutton/scene/ibutton_scene_select_key.cpp +++ b/applications/ibutton/scene/ibutton_scene_select_key.cpp @@ -10,9 +10,9 @@ void iButtonSceneSelectKey::on_enter(iButtonApp* app) { } } -bool iButtonSceneSelectKey::on_event(iButtonApp* app, iButtonEvent* event) { +bool iButtonSceneSelectKey::on_event(iButtonApp*, iButtonEvent*) { return false; } -void iButtonSceneSelectKey::on_exit(iButtonApp* app) { +void iButtonSceneSelectKey::on_exit(iButtonApp*) { } diff --git a/applications/ibutton/scene/ibutton_scene_select_key.h b/applications/ibutton/scene/ibutton_scene_select_key.h index 39e8d9a369c..d6819909973 100644 --- a/applications/ibutton/scene/ibutton_scene_select_key.h +++ b/applications/ibutton/scene/ibutton_scene_select_key.h @@ -6,4 +6,4 @@ class iButtonSceneSelectKey : public iButtonScene { void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_start.h b/applications/ibutton/scene/ibutton_scene_start.h index be1ce79fbb9..28ef28d3513 100644 --- a/applications/ibutton/scene/ibutton_scene_start.h +++ b/applications/ibutton/scene/ibutton_scene_start.h @@ -9,4 +9,4 @@ class iButtonSceneStart : public iButtonScene { private: uint32_t submenu_item_selected = 0; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_write.cpp b/applications/ibutton/scene/ibutton_scene_write.cpp index 31da6dbe59e..d4f84e11c9c 100644 --- a/applications/ibutton/scene/ibutton_scene_write.cpp +++ b/applications/ibutton/scene/ibutton_scene_write.cpp @@ -108,4 +108,4 @@ void iButtonSceneWrite::on_exit(iButtonApp* app) { popup_set_header(popup, NULL, 0, 0, AlignCenter, AlignBottom); popup_set_text(popup, NULL, 0, 0, AlignCenter, AlignTop); popup_set_icon(popup, 0, 0, NULL); -} \ No newline at end of file +} diff --git a/applications/ibutton/scene/ibutton_scene_write.h b/applications/ibutton/scene/ibutton_scene_write.h index bd99b377695..8b52473af54 100644 --- a/applications/ibutton/scene/ibutton_scene_write.h +++ b/applications/ibutton/scene/ibutton_scene_write.h @@ -9,4 +9,4 @@ class iButtonSceneWrite : public iButtonScene { private: bool blink_yellow; -}; \ No newline at end of file +}; diff --git a/applications/ibutton/scene/ibutton_scene_write_success.cpp b/applications/ibutton/scene/ibutton_scene_write_success.cpp index 397347046ec..3f27c672417 100644 --- a/applications/ibutton/scene/ibutton_scene_write_success.cpp +++ b/applications/ibutton/scene/ibutton_scene_write_success.cpp @@ -49,4 +49,4 @@ void iButtonSceneWriteSuccess::on_exit(iButtonApp* app) { popup_disable_timeout(popup); popup_set_context(popup, NULL); popup_set_callback(popup, NULL); -} \ No newline at end of file +} diff --git a/applications/ibutton/scene/ibutton_scene_write_success.h b/applications/ibutton/scene/ibutton_scene_write_success.h index c6e7688567c..99680c7dd2c 100644 --- a/applications/ibutton/scene/ibutton_scene_write_success.h +++ b/applications/ibutton/scene/ibutton_scene_write_success.h @@ -6,4 +6,4 @@ class iButtonSceneWriteSuccess : public iButtonScene { void on_enter(iButtonApp* app) final; bool on_event(iButtonApp* app, iButtonEvent* event) final; void on_exit(iButtonApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/infrared/cli/infrared_cli.cpp b/applications/infrared/cli/infrared_cli.cpp index 15de2d852bf..b60e459958b 100644 --- a/applications/infrared/cli/infrared_cli.cpp +++ b/applications/infrared/cli/infrared_cli.cpp @@ -60,6 +60,8 @@ static void signal_received_callback(void* context, InfraredWorkerSignal* receiv } static void infrared_cli_start_ir_rx(Cli* cli, string_t args) { + UNUSED(cli); + UNUSED(args); InfraredWorker* worker = infrared_worker_alloc(); infrared_worker_rx_start(worker); infrared_worker_rx_set_received_signal_callback(worker, signal_received_callback, cli); @@ -140,6 +142,7 @@ static bool parse_signal_raw( } static void infrared_cli_start_ir_tx(Cli* cli, string_t args) { + UNUSED(cli); InfraredMessage message; const char* str = string_get_cstr(args); uint32_t frequency; @@ -160,6 +163,7 @@ static void infrared_cli_start_ir_tx(Cli* cli, string_t args) { } static void infrared_cli_start_ir(Cli* cli, string_t args, void* context) { + UNUSED(context); if(furi_hal_infrared_is_busy()) { printf("INFRARED is busy. Exit."); return; diff --git a/applications/infrared/infrared_app_event.h b/applications/infrared/infrared_app_event.h index fdea826acb6..168ba0b1cbb 100644 --- a/applications/infrared/infrared_app_event.h +++ b/applications/infrared/infrared_app_event.h @@ -36,6 +36,7 @@ class InfraredAppEvent { }; union { + int32_t dummy; /** Menu selected event type payload. Selected index. */ int32_t menu_index; /** DialogEx view module event type payload */ diff --git a/applications/infrared/infrared_app_view_manager.cpp b/applications/infrared/infrared_app_view_manager.cpp index 1e08471d453..f1e48ed4aba 100644 --- a/applications/infrared/infrared_app_view_manager.cpp +++ b/applications/infrared/infrared_app_view_manager.cpp @@ -148,7 +148,7 @@ void InfraredAppViewManager::send_event(InfraredAppEvent* event) { osMessageQueuePut(event_queue, event, 0, timeout); } -uint32_t InfraredAppViewManager::previous_view_callback(void* context) { +uint32_t InfraredAppViewManager::previous_view_callback(void*) { if(event_queue != NULL) { InfraredAppEvent event; event.type = InfraredAppEvent::Type::Back; diff --git a/applications/infrared/scene/infrared_app_scene_ask_back.cpp b/applications/infrared/scene/infrared_app_scene_ask_back.cpp index 751816af80b..65d7ca578ce 100644 --- a/applications/infrared/scene/infrared_app_scene_ask_back.cpp +++ b/applications/infrared/scene/infrared_app_scene_ask_back.cpp @@ -69,5 +69,5 @@ bool InfraredAppSceneAskBack::on_event(InfraredApp* app, InfraredAppEvent* event return consumed; } -void InfraredAppSceneAskBack::on_exit(InfraredApp* app) { +void InfraredAppSceneAskBack::on_exit(InfraredApp*) { } diff --git a/applications/infrared/scene/infrared_app_scene_edit_delete.cpp b/applications/infrared/scene/infrared_app_scene_edit_delete.cpp index d49acec528d..e17cfee076e 100644 --- a/applications/infrared/scene/infrared_app_scene_edit_delete.cpp +++ b/applications/infrared/scene/infrared_app_scene_edit_delete.cpp @@ -96,5 +96,5 @@ bool InfraredAppSceneEditDelete::on_event(InfraredApp* app, InfraredAppEvent* ev return consumed; } -void InfraredAppSceneEditDelete::on_exit(InfraredApp* app) { +void InfraredAppSceneEditDelete::on_exit(InfraredApp*) { } diff --git a/applications/infrared/scene/infrared_app_scene_edit_rename_done.cpp b/applications/infrared/scene/infrared_app_scene_edit_rename_done.cpp index 2b6afafd675..803481f6b3c 100644 --- a/applications/infrared/scene/infrared_app_scene_edit_rename_done.cpp +++ b/applications/infrared/scene/infrared_app_scene_edit_rename_done.cpp @@ -26,5 +26,5 @@ bool InfraredAppSceneEditRenameDone::on_event(InfraredApp* app, InfraredAppEvent return consumed; } -void InfraredAppSceneEditRenameDone::on_exit(InfraredApp* app) { +void InfraredAppSceneEditRenameDone::on_exit(InfraredApp*) { } diff --git a/applications/infrared/scene/infrared_app_scene_learn_enter_name.cpp b/applications/infrared/scene/infrared_app_scene_learn_enter_name.cpp index 0f148e8076b..7d15a7c5660 100644 --- a/applications/infrared/scene/infrared_app_scene_learn_enter_name.cpp +++ b/applications/infrared/scene/infrared_app_scene_learn_enter_name.cpp @@ -56,5 +56,5 @@ bool InfraredAppSceneLearnEnterName::on_event(InfraredApp* app, InfraredAppEvent return consumed; } -void InfraredAppSceneLearnEnterName::on_exit(InfraredApp* app) { +void InfraredAppSceneLearnEnterName::on_exit(InfraredApp*) { } diff --git a/applications/infrared/scene/infrared_app_scene_remote_list.cpp b/applications/infrared/scene/infrared_app_scene_remote_list.cpp index 95ef2e4112d..f59ff3e91e2 100644 --- a/applications/infrared/scene/infrared_app_scene_remote_list.cpp +++ b/applications/infrared/scene/infrared_app_scene_remote_list.cpp @@ -40,11 +40,9 @@ void InfraredAppSceneRemoteList::on_enter(InfraredApp* app) { } } -bool InfraredAppSceneRemoteList::on_event(InfraredApp* app, InfraredAppEvent* event) { - bool consumed = false; - - return consumed; +bool InfraredAppSceneRemoteList::on_event(InfraredApp*, InfraredAppEvent*) { + return false; } -void InfraredAppSceneRemoteList::on_exit(InfraredApp* app) { +void InfraredAppSceneRemoteList::on_exit(InfraredApp*) { } diff --git a/applications/infrared/scene/infrared_app_scene_universal_common.cpp b/applications/infrared/scene/infrared_app_scene_universal_common.cpp index a9220eaf769..9e7a18f40c1 100644 --- a/applications/infrared/scene/infrared_app_scene_universal_common.cpp +++ b/applications/infrared/scene/infrared_app_scene_universal_common.cpp @@ -25,6 +25,7 @@ static void infrared_progress_back_callback(void* context) { auto app = static_cast(context); InfraredAppEvent infrared_event = { + .payload = {.dummy = 0}, .type = InfraredAppEvent::Type::Back, }; app->get_view_manager()->clear_events(); @@ -57,7 +58,10 @@ bool InfraredAppSceneUniversalCommon::on_event(InfraredApp* app, InfraredAppEven if(event->type == InfraredAppEvent::Type::Tick) { auto view_manager = app->get_view_manager(); app->notify_blink_send(); - InfraredAppEvent tick_event = {.type = InfraredAppEvent::Type::Tick}; + InfraredAppEvent tick_event = { + .payload = {.dummy = 0}, + .type = InfraredAppEvent::Type::Tick, + }; view_manager->send_event(&tick_event); bool result = brute_force.send_next_bruteforce(); if(result) { diff --git a/applications/input/input.c b/applications/input/input.c index a2dd62f74ea..dd824dcbc00 100644 --- a/applications/input/input.c +++ b/applications/input/input.c @@ -35,6 +35,7 @@ void input_press_timer_callback(void* arg) { } void input_isr(void* _ctx) { + UNUSED(_ctx); osThreadFlagsSet(input->thread, INPUT_THREAD_FLAG_ISR); } diff --git a/applications/input/input_cli.c b/applications/input/input_cli.c index 00591a75c01..afb05afd433 100644 --- a/applications/input/input_cli.c +++ b/applications/input/input_cli.c @@ -20,6 +20,7 @@ static void input_cli_dump_events_callback(const void* value, void* ctx) { } static void input_cli_dump(Cli* cli, string_t args, Input* input) { + UNUSED(args); osMessageQueueId_t input_queue = osMessageQueueNew(8, sizeof(InputEvent), NULL); FuriPubSubSubscription* input_subscription = furi_pubsub_subscribe(input->event_pubsub, input_cli_dump_events_callback, input_queue); @@ -47,6 +48,7 @@ static void input_cli_send_print_usage() { } static void input_cli_send(Cli* cli, string_t args, Input* input) { + UNUSED(cli); InputEvent event; string_t key_str; string_init(key_str); diff --git a/applications/lfrfid/helpers/decoder_analyzer.cpp b/applications/lfrfid/helpers/decoder_analyzer.cpp index 8142f14cf7b..8d344b8809a 100644 --- a/applications/lfrfid/helpers/decoder_analyzer.cpp +++ b/applications/lfrfid/helpers/decoder_analyzer.cpp @@ -2,7 +2,8 @@ #include #include -bool DecoderAnalyzer::read(uint8_t* _data, uint8_t _data_size) { +// FIXME: unused args? +bool DecoderAnalyzer::read(uint8_t* /* _data */, uint8_t /* _data_size */) { bool result = false; if(ready) { @@ -21,6 +22,7 @@ bool DecoderAnalyzer::read(uint8_t* _data, uint8_t _data_size) { } void DecoderAnalyzer::process_front(bool polarity, uint32_t time) { + UNUSED(polarity); if(ready) return; data[data_index] = time; diff --git a/applications/lfrfid/helpers/decoder_gpio_out.cpp b/applications/lfrfid/helpers/decoder_gpio_out.cpp index 03e0399467d..dfb43426725 100644 --- a/applications/lfrfid/helpers/decoder_gpio_out.cpp +++ b/applications/lfrfid/helpers/decoder_gpio_out.cpp @@ -2,7 +2,7 @@ #include #include -void DecoderGpioOut::process_front(bool polarity, uint32_t time) { +void DecoderGpioOut::process_front(bool polarity, uint32_t /* time */) { furi_hal_gpio_write(&gpio_ext_pa7, polarity); } diff --git a/applications/lfrfid/helpers/decoder_hid26.h b/applications/lfrfid/helpers/decoder_hid26.h index b409ca433b0..c73ff88c400 100644 --- a/applications/lfrfid/helpers/decoder_hid26.h +++ b/applications/lfrfid/helpers/decoder_hid26.h @@ -21,4 +21,4 @@ class DecoderHID26 { void reset_state(); ProtocolHID10301 hid; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/helpers/decoder_indala.cpp b/applications/lfrfid/helpers/decoder_indala.cpp index eb711fa2a4b..100dde73bdf 100644 --- a/applications/lfrfid/helpers/decoder_indala.cpp +++ b/applications/lfrfid/helpers/decoder_indala.cpp @@ -73,4 +73,4 @@ void DecoderIndala::reset_state() { cursed_raw_data = 0; ready = false; cursed_data_valid = false; -} \ No newline at end of file +} diff --git a/applications/lfrfid/helpers/decoder_indala.h b/applications/lfrfid/helpers/decoder_indala.h index 94ad8b16303..5fbde7b6bdf 100644 --- a/applications/lfrfid/helpers/decoder_indala.h +++ b/applications/lfrfid/helpers/decoder_indala.h @@ -22,4 +22,4 @@ class DecoderIndala { std::atomic ready; std::atomic cursed_data_valid; ProtocolIndala40134 indala; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/helpers/emmarin.h b/applications/lfrfid/helpers/emmarin.h index 5d2e2439c22..ff8273bf767 100644 --- a/applications/lfrfid/helpers/emmarin.h +++ b/applications/lfrfid/helpers/emmarin.h @@ -12,4 +12,4 @@ #define EM_STOP_MASK (0x1LLU << EM_STOP_POS) #define EM_HEADER_AND_STOP_MASK (EM_HEADER_MASK | EM_STOP_MASK) -#define EM_HEADER_AND_STOP_DATA (EM_HEADER_MASK) \ No newline at end of file +#define EM_HEADER_AND_STOP_DATA (EM_HEADER_MASK) diff --git a/applications/lfrfid/helpers/encoder_emmarin.h b/applications/lfrfid/helpers/encoder_emmarin.h index fa78122f345..560daec1b5a 100644 --- a/applications/lfrfid/helpers/encoder_emmarin.h +++ b/applications/lfrfid/helpers/encoder_emmarin.h @@ -19,4 +19,4 @@ class EncoderEM : public EncoderGeneric { uint64_t card_data; uint8_t card_data_index; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/helpers/encoder_hid_h10301.h b/applications/lfrfid/helpers/encoder_hid_h10301.h index e5edd0a0878..8cc5aa5cbfa 100644 --- a/applications/lfrfid/helpers/encoder_hid_h10301.h +++ b/applications/lfrfid/helpers/encoder_hid_h10301.h @@ -23,4 +23,4 @@ class EncoderHID_H10301 : public EncoderGeneric { void write_raw_bit(bool bit, uint8_t position); OscFSK* fsk; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/helpers/encoder_indala_40134.h b/applications/lfrfid/helpers/encoder_indala_40134.h index 8bdb3acdf6c..eda29457f37 100644 --- a/applications/lfrfid/helpers/encoder_indala_40134.h +++ b/applications/lfrfid/helpers/encoder_indala_40134.h @@ -20,4 +20,4 @@ class EncoderIndala_40134 : public EncoderGeneric { bool last_bit; bool current_polarity; static const uint8_t clock_per_bit = 16; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/helpers/key_info.cpp b/applications/lfrfid/helpers/key_info.cpp index 74b4fa5ca04..ed2b20a90b4 100644 --- a/applications/lfrfid/helpers/key_info.cpp +++ b/applications/lfrfid/helpers/key_info.cpp @@ -63,4 +63,4 @@ uint8_t lfrfid_key_get_type_data_count(LfrfidKeyType type) { } return 0; -} \ No newline at end of file +} diff --git a/applications/lfrfid/helpers/key_info.h b/applications/lfrfid/helpers/key_info.h index 277ede08122..e465011d01f 100644 --- a/applications/lfrfid/helpers/key_info.h +++ b/applications/lfrfid/helpers/key_info.h @@ -13,4 +13,4 @@ enum class LfrfidKeyType : uint8_t { const char* lfrfid_key_get_type_string(LfrfidKeyType type); const char* lfrfid_key_get_manufacturer_string(LfrfidKeyType type); bool lfrfid_key_get_string_type(const char* string, LfrfidKeyType* type); -uint8_t lfrfid_key_get_type_data_count(LfrfidKeyType type); \ No newline at end of file +uint8_t lfrfid_key_get_type_data_count(LfrfidKeyType type); diff --git a/applications/lfrfid/helpers/osc_fsk.h b/applications/lfrfid/helpers/osc_fsk.h index e9bd322bf13..eaaaa10ad0e 100644 --- a/applications/lfrfid/helpers/osc_fsk.h +++ b/applications/lfrfid/helpers/osc_fsk.h @@ -27,4 +27,4 @@ class OscFSK { const uint16_t freq[2]; const uint16_t osc_phase_max; int32_t osc_phase_current; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/helpers/protocols/protocol_generic.h b/applications/lfrfid/helpers/protocols/protocol_generic.h index 8d8edfb2942..d593f708995 100644 --- a/applications/lfrfid/helpers/protocols/protocol_generic.h +++ b/applications/lfrfid/helpers/protocols/protocol_generic.h @@ -57,4 +57,4 @@ class ProtocolGeneric { virtual bool can_be_decoded(const uint8_t* encoded_data, const uint8_t encoded_data_size) = 0; virtual ~ProtocolGeneric(){}; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/helpers/protocols/protocol_hid_h10301.h b/applications/lfrfid/helpers/protocols/protocol_hid_h10301.h index d769e8744b3..fbd6e0b2bf9 100644 --- a/applications/lfrfid/helpers/protocols/protocol_hid_h10301.h +++ b/applications/lfrfid/helpers/protocols/protocol_hid_h10301.h @@ -19,4 +19,4 @@ class ProtocolHID10301 : public ProtocolGeneric { const uint8_t decoded_data_size) final; bool can_be_decoded(const uint8_t* encoded_data, const uint8_t encoded_data_size) final; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/helpers/protocols/protocol_indala_40134.cpp b/applications/lfrfid/helpers/protocols/protocol_indala_40134.cpp index e77c808f969..482339def33 100644 --- a/applications/lfrfid/helpers/protocols/protocol_indala_40134.cpp +++ b/applications/lfrfid/helpers/protocols/protocol_indala_40134.cpp @@ -234,4 +234,4 @@ bool ProtocolIndala40134::can_be_decoded( } while(false); return can_be_decoded; -} \ No newline at end of file +} diff --git a/applications/lfrfid/helpers/pulse_joiner.h b/applications/lfrfid/helpers/pulse_joiner.h index 96d4482e9ba..1639d837167 100644 --- a/applications/lfrfid/helpers/pulse_joiner.h +++ b/applications/lfrfid/helpers/pulse_joiner.h @@ -33,4 +33,4 @@ class PulseJoiner { uint8_t pulse_index = 0; static const uint8_t pulse_max = 6; Pulse pulses[pulse_max]; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/helpers/rfid_key.cpp b/applications/lfrfid/helpers/rfid_key.cpp index 4a54e470b3f..02e45e6867e 100644 --- a/applications/lfrfid/helpers/rfid_key.cpp +++ b/applications/lfrfid/helpers/rfid_key.cpp @@ -36,7 +36,7 @@ const char* RfidKey::get_type_text() { return lfrfid_key_get_type_string(type); } -const uint8_t RfidKey::get_type_data_count() { +uint8_t RfidKey::get_type_data_count() const { return lfrfid_key_get_type_data_count(type); } diff --git a/applications/lfrfid/helpers/rfid_key.h b/applications/lfrfid/helpers/rfid_key.h index 83251625fe3..29b87cf9c0b 100644 --- a/applications/lfrfid/helpers/rfid_key.h +++ b/applications/lfrfid/helpers/rfid_key.h @@ -14,7 +14,7 @@ class RfidKey { LfrfidKeyType get_type(); const uint8_t* get_data(); const char* get_type_text(); - const uint8_t get_type_data_count(); + uint8_t get_type_data_count() const; char* get_name(); uint8_t get_name_length(); void clear(); diff --git a/applications/lfrfid/helpers/rfid_worker.h b/applications/lfrfid/helpers/rfid_worker.h index 27ec145cad2..2c49ad14e06 100644 --- a/applications/lfrfid/helpers/rfid_worker.h +++ b/applications/lfrfid/helpers/rfid_worker.h @@ -45,4 +45,4 @@ class RfidWorker { void sq_write_validate(); uint16_t validate_counts; void sq_write_stop_validate(); -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/helpers/rfid_writer.h b/applications/lfrfid/helpers/rfid_writer.h index 3ec3c1dd25e..38329877b19 100644 --- a/applications/lfrfid/helpers/rfid_writer.h +++ b/applications/lfrfid/helpers/rfid_writer.h @@ -17,4 +17,4 @@ class RfidWriter { void write_byte(uint8_t value); void write_block(uint8_t page, uint8_t block, bool lock_bit, uint32_t data); void write_reset(); -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/helpers/state_sequencer.h b/applications/lfrfid/helpers/state_sequencer.h index e0ad135f905..12512ab5172 100644 --- a/applications/lfrfid/helpers/state_sequencer.h +++ b/applications/lfrfid/helpers/state_sequencer.h @@ -22,4 +22,4 @@ class TickSequencer { uint32_t tick_count; void do_nothing(); -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/lfrfid_cli.cpp b/applications/lfrfid/lfrfid_cli.cpp index 235dd68fc60..dbd37ddc889 100644 --- a/applications/lfrfid/lfrfid_cli.cpp +++ b/applications/lfrfid/lfrfid_cli.cpp @@ -100,6 +100,8 @@ static void lfrfid_cli_read(Cli* cli, string_t args) { } static void lfrfid_cli_write(Cli* cli, string_t args) { + UNUSED(cli); + UNUSED(args); // TODO implement rfid write printf("Not implemented :(\r\n"); } @@ -147,6 +149,7 @@ static void lfrfid_cli_emulate(Cli* cli, string_t args) { } static void lfrfid_cli(Cli* cli, string_t args, void* context) { + UNUSED(context); string_t cmd; string_init(cmd); diff --git a/applications/lfrfid/scene/lfrfid_app_scene_delete_confirm.cpp b/applications/lfrfid/scene/lfrfid_app_scene_delete_confirm.cpp index 5b7ac0f95ea..40bd9e3609d 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_delete_confirm.cpp +++ b/applications/lfrfid/scene/lfrfid_app_scene_delete_confirm.cpp @@ -3,7 +3,7 @@ #include "../view/elements/icon_element.h" #include "../view/elements/string_element.h" -void LfRfidAppSceneDeleteConfirm::on_enter(LfRfidApp* app, bool need_restore) { +void LfRfidAppSceneDeleteConfirm::on_enter(LfRfidApp* app, bool /* need_restore */) { string_init(string_data); string_init(string_decrypted); string_init(string_header); diff --git a/applications/lfrfid/scene/lfrfid_app_scene_delete_confirm.h b/applications/lfrfid/scene/lfrfid_app_scene_delete_confirm.h index 36d436a4a1d..e30764f0232 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_delete_confirm.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_delete_confirm.h @@ -14,4 +14,4 @@ class LfRfidAppSceneDeleteConfirm : public GenericScene { string_t string_header; string_t string_data; string_t string_decrypted; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_delete_success.cpp b/applications/lfrfid/scene/lfrfid_app_scene_delete_success.cpp index a4f2bf38dc2..9820338d126 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_delete_success.cpp +++ b/applications/lfrfid/scene/lfrfid_app_scene_delete_success.cpp @@ -1,6 +1,6 @@ #include "lfrfid_app_scene_delete_success.h" -void LfRfidAppSceneDeleteSuccess::on_enter(LfRfidApp* app, bool need_restore) { +void LfRfidAppSceneDeleteSuccess::on_enter(LfRfidApp* app, bool /* need_restore */) { auto popup = app->view_controller.get(); popup->set_icon(0, 2, &I_DolphinMafia_115x62); @@ -35,4 +35,4 @@ void LfRfidAppSceneDeleteSuccess::timeout_callback(void* context) { LfRfidApp::Event event; event.type = LfRfidApp::EventType::Back; app->view_controller.send_event(&event); -} \ No newline at end of file +} diff --git a/applications/lfrfid/scene/lfrfid_app_scene_delete_success.h b/applications/lfrfid/scene/lfrfid_app_scene_delete_success.h index 01f929e715c..009b9f25dba 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_delete_success.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_delete_success.h @@ -9,4 +9,4 @@ class LfRfidAppSceneDeleteSuccess : public GenericScene { private: static void timeout_callback(void* context); -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_emulate.cpp b/applications/lfrfid/scene/lfrfid_app_scene_emulate.cpp index 17472e1674a..f1118a481c7 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_emulate.cpp +++ b/applications/lfrfid/scene/lfrfid_app_scene_emulate.cpp @@ -1,7 +1,7 @@ #include "lfrfid_app_scene_emulate.h" #include -void LfRfidAppSceneEmulate::on_enter(LfRfidApp* app, bool need_restore) { +void LfRfidAppSceneEmulate::on_enter(LfRfidApp* app, bool /* need_restore */) { string_init(data_string); DOLPHIN_DEED(DolphinDeedRfidEmulate); diff --git a/applications/lfrfid/scene/lfrfid_app_scene_emulate.h b/applications/lfrfid/scene/lfrfid_app_scene_emulate.h index ad5c8418054..937e49af9b1 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_emulate.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_emulate.h @@ -9,4 +9,4 @@ class LfRfidAppSceneEmulate : public GenericScene { private: string_t data_string; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_exit_confirm.cpp b/applications/lfrfid/scene/lfrfid_app_scene_exit_confirm.cpp index 262dfca1cb3..d423cec9b7f 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_exit_confirm.cpp +++ b/applications/lfrfid/scene/lfrfid_app_scene_exit_confirm.cpp @@ -3,7 +3,7 @@ #include "../view/elements/icon_element.h" #include "../view/elements/string_element.h" -void LfRfidAppSceneExitConfirm::on_enter(LfRfidApp* app, bool need_restore) { +void LfRfidAppSceneExitConfirm::on_enter(LfRfidApp* app, bool /* need_restore */) { auto container = app->view_controller.get(); auto button = container->add(); diff --git a/applications/lfrfid/scene/lfrfid_app_scene_exit_confirm.h b/applications/lfrfid/scene/lfrfid_app_scene_exit_confirm.h index 4f960d22f89..a0a1023258b 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_exit_confirm.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_exit_confirm.h @@ -10,4 +10,4 @@ class LfRfidAppSceneExitConfirm : public GenericScene { private: static void exit_callback(void* context); static void stay_callback(void* context); -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_read.cpp b/applications/lfrfid/scene/lfrfid_app_scene_read.cpp index 481755903f6..f87aa200a4d 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_read.cpp +++ b/applications/lfrfid/scene/lfrfid_app_scene_read.cpp @@ -1,7 +1,7 @@ #include "lfrfid_app_scene_read.h" #include -void LfRfidAppSceneRead::on_enter(LfRfidApp* app, bool need_restore) { +void LfRfidAppSceneRead::on_enter(LfRfidApp* app, bool /* need_restore */) { auto popup = app->view_controller.get(); DOLPHIN_DEED(DolphinDeedRfidRead); diff --git a/applications/lfrfid/scene/lfrfid_app_scene_read.h b/applications/lfrfid/scene/lfrfid_app_scene_read.h index b978270c2cc..b5035b72a02 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_read.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_read.h @@ -6,4 +6,4 @@ class LfRfidAppSceneRead : public GenericScene { void on_enter(LfRfidApp* app, bool need_restore) final; bool on_event(LfRfidApp* app, LfRfidApp::Event* event) final; void on_exit(LfRfidApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_read_menu.h b/applications/lfrfid/scene/lfrfid_app_scene_read_menu.h index 43d68a81ab7..2b50b96f9a9 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_read_menu.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_read_menu.h @@ -10,4 +10,4 @@ class LfRfidAppSceneReadKeyMenu : public GenericScene { private: static void submenu_callback(void* context, uint32_t index); uint32_t submenu_item_selected = 0; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_read_success.cpp b/applications/lfrfid/scene/lfrfid_app_scene_read_success.cpp index 8f6a0b57ee3..2b81a58a0b9 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_read_success.cpp +++ b/applications/lfrfid/scene/lfrfid_app_scene_read_success.cpp @@ -3,7 +3,7 @@ #include "../view/elements/icon_element.h" #include "../view/elements/string_element.h" -void LfRfidAppSceneReadSuccess::on_enter(LfRfidApp* app, bool need_restore) { +void LfRfidAppSceneReadSuccess::on_enter(LfRfidApp* app, bool /* need_restore */) { string_init(string[0]); string_init(string[1]); string_init(string[2]); diff --git a/applications/lfrfid/scene/lfrfid_app_scene_read_success.h b/applications/lfrfid/scene/lfrfid_app_scene_read_success.h index e2c182ea2bd..ac0e3c1b5c1 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_read_success.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_read_success.h @@ -12,4 +12,4 @@ class LfRfidAppSceneReadSuccess : public GenericScene { static void more_callback(void* context); string_t string[3]; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_retry_confirm.cpp b/applications/lfrfid/scene/lfrfid_app_scene_retry_confirm.cpp index 092a5f02008..e62b91bd430 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_retry_confirm.cpp +++ b/applications/lfrfid/scene/lfrfid_app_scene_retry_confirm.cpp @@ -3,7 +3,7 @@ #include "../view/elements/icon_element.h" #include "../view/elements/string_element.h" -void LfRfidAppSceneRetryConfirm::on_enter(LfRfidApp* app, bool need_restore) { +void LfRfidAppSceneRetryConfirm::on_enter(LfRfidApp* app, bool /* need_restore */) { auto container = app->view_controller.get(); auto button = container->add(); diff --git a/applications/lfrfid/scene/lfrfid_app_scene_retry_confirm.h b/applications/lfrfid/scene/lfrfid_app_scene_retry_confirm.h index af2373f0356..01b7329c90a 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_retry_confirm.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_retry_confirm.h @@ -10,4 +10,4 @@ class LfRfidAppSceneRetryConfirm : public GenericScene { private: static void exit_callback(void* context); static void stay_callback(void* context); -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_save_data.h b/applications/lfrfid/scene/lfrfid_app_scene_save_data.h index d735fba10c3..6458ae649e4 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_save_data.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_save_data.h @@ -30,4 +30,4 @@ class LfRfidAppSceneSaveData : public GenericScene { 0xBB, 0xBB, }; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_save_name.cpp b/applications/lfrfid/scene/lfrfid_app_scene_save_name.cpp index f755f0e3278..d460724e222 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_save_name.cpp +++ b/applications/lfrfid/scene/lfrfid_app_scene_save_name.cpp @@ -1,7 +1,7 @@ #include "lfrfid_app_scene_save_name.h" #include -void LfRfidAppSceneSaveName::on_enter(LfRfidApp* app, bool need_restore) { +void LfRfidAppSceneSaveName::on_enter(LfRfidApp* app, bool /* need_restore */) { const char* key_name = app->worker.key.get_name(); bool key_name_empty = !strcmp(key_name, ""); diff --git a/applications/lfrfid/scene/lfrfid_app_scene_save_name.h b/applications/lfrfid/scene/lfrfid_app_scene_save_name.h index 39201c34e0b..ced42cc0e45 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_save_name.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_save_name.h @@ -9,4 +9,4 @@ class LfRfidAppSceneSaveName : public GenericScene { private: static void save_callback(void* context); -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_save_success.cpp b/applications/lfrfid/scene/lfrfid_app_scene_save_success.cpp index 184a445ad5d..64efafa7314 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_save_success.cpp +++ b/applications/lfrfid/scene/lfrfid_app_scene_save_success.cpp @@ -3,7 +3,7 @@ #include #include -void LfRfidAppSceneSaveSuccess::on_enter(LfRfidApp* app, bool need_restore) { +void LfRfidAppSceneSaveSuccess::on_enter(LfRfidApp* app, bool /* need_restore */) { auto popup = app->view_controller.get(); DOLPHIN_DEED(DolphinDeedRfidSave); diff --git a/applications/lfrfid/scene/lfrfid_app_scene_save_success.h b/applications/lfrfid/scene/lfrfid_app_scene_save_success.h index 36aebf3efe0..62273a76be3 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_save_success.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_save_success.h @@ -9,4 +9,4 @@ class LfRfidAppSceneSaveSuccess : public GenericScene { private: static void timeout_callback(void* context); -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_save_type.h b/applications/lfrfid/scene/lfrfid_app_scene_save_type.h index 7e57a93d83f..1f6f6d742d8 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_save_type.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_save_type.h @@ -12,4 +12,4 @@ class LfRfidAppSceneSaveType : public GenericScene { uint32_t submenu_item_selected = 0; static const uint8_t keys_count = static_cast(LfrfidKeyType::KeyI40134); string_t submenu_name[keys_count + 1]; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_saved_info.cpp b/applications/lfrfid/scene/lfrfid_app_scene_saved_info.cpp index b054e141f88..73c9a403e75 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_saved_info.cpp +++ b/applications/lfrfid/scene/lfrfid_app_scene_saved_info.cpp @@ -3,7 +3,7 @@ #include "../view/elements/icon_element.h" #include "../view/elements/string_element.h" -void LfRfidAppSceneSavedInfo::on_enter(LfRfidApp* app, bool need_restore) { +void LfRfidAppSceneSavedInfo::on_enter(LfRfidApp* app, bool /* need_restore */) { string_init(string_data); string_init(string_decrypted); @@ -59,10 +59,8 @@ void LfRfidAppSceneSavedInfo::on_enter(LfRfidApp* app, bool need_restore) { app->view_controller.switch_to(); } -bool LfRfidAppSceneSavedInfo::on_event(LfRfidApp* app, LfRfidApp::Event* event) { - bool consumed = false; - - return consumed; +bool LfRfidAppSceneSavedInfo::on_event(LfRfidApp* /* app */, LfRfidApp::Event* /* event */) { + return false; } void LfRfidAppSceneSavedInfo::on_exit(LfRfidApp* app) { diff --git a/applications/lfrfid/scene/lfrfid_app_scene_saved_info.h b/applications/lfrfid/scene/lfrfid_app_scene_saved_info.h index ec15c6dcd5e..5aa33e8ad7b 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_saved_info.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_saved_info.h @@ -12,4 +12,4 @@ class LfRfidAppSceneSavedInfo : public GenericScene { string_t string_data; string_t string_decrypted; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_saved_key_menu.h b/applications/lfrfid/scene/lfrfid_app_scene_saved_key_menu.h index b3ad10ec7dd..69a6e5e58b4 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_saved_key_menu.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_saved_key_menu.h @@ -10,4 +10,4 @@ class LfRfidAppSceneSavedKeyMenu : public GenericScene { private: static void submenu_callback(void* context, uint32_t index); uint32_t submenu_item_selected = 0; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_select_key.cpp b/applications/lfrfid/scene/lfrfid_app_scene_select_key.cpp index d376056b8ee..6d5df73cb8c 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_select_key.cpp +++ b/applications/lfrfid/scene/lfrfid_app_scene_select_key.cpp @@ -8,11 +8,9 @@ void LfRfidAppSceneSelectKey::on_enter(LfRfidApp* app, bool need_restore) { } } -bool LfRfidAppSceneSelectKey::on_event(LfRfidApp* app, LfRfidApp::Event* event) { - bool consumed = false; - - return consumed; +bool LfRfidAppSceneSelectKey::on_event(LfRfidApp* /* app */, LfRfidApp::Event* /* event */) { + return false; } -void LfRfidAppSceneSelectKey::on_exit(LfRfidApp* app) { -} \ No newline at end of file +void LfRfidAppSceneSelectKey::on_exit(LfRfidApp* /* app */) { +} diff --git a/applications/lfrfid/scene/lfrfid_app_scene_select_key.h b/applications/lfrfid/scene/lfrfid_app_scene_select_key.h index 10f11c61452..be565a91c56 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_select_key.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_select_key.h @@ -6,4 +6,4 @@ class LfRfidAppSceneSelectKey : public GenericScene { void on_enter(LfRfidApp* app, bool need_restore) final; bool on_event(LfRfidApp* app, LfRfidApp::Event* event) final; void on_exit(LfRfidApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_start.h b/applications/lfrfid/scene/lfrfid_app_scene_start.h index 3f48db707ea..255590d6acc 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_start.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_start.h @@ -10,4 +10,4 @@ class LfRfidAppSceneStart : public GenericScene { private: static void submenu_callback(void* context, uint32_t index); uint32_t submenu_item_selected = 0; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_write.cpp b/applications/lfrfid/scene/lfrfid_app_scene_write.cpp index 24f9fd0c5b1..d6c9e9f4fee 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_write.cpp +++ b/applications/lfrfid/scene/lfrfid_app_scene_write.cpp @@ -1,6 +1,6 @@ #include "lfrfid_app_scene_write.h" -void LfRfidAppSceneWrite::on_enter(LfRfidApp* app, bool need_restore) { +void LfRfidAppSceneWrite::on_enter(LfRfidApp* app, bool /* need_restore */) { card_not_supported = false; string_init(data_string); diff --git a/applications/lfrfid/scene/lfrfid_app_scene_write.h b/applications/lfrfid/scene/lfrfid_app_scene_write.h index 603f59d8e07..3abadebab5a 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_write.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_write.h @@ -10,4 +10,4 @@ class LfRfidAppSceneWrite : public GenericScene { private: string_t data_string; bool card_not_supported; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/scene/lfrfid_app_scene_write_success.cpp b/applications/lfrfid/scene/lfrfid_app_scene_write_success.cpp index 0539e623504..3cf00183d71 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_write_success.cpp +++ b/applications/lfrfid/scene/lfrfid_app_scene_write_success.cpp @@ -1,6 +1,6 @@ #include "lfrfid_app_scene_write_success.h" -void LfRfidAppSceneWriteSuccess::on_enter(LfRfidApp* app, bool need_restore) { +void LfRfidAppSceneWriteSuccess::on_enter(LfRfidApp* app, bool /* need_restore */) { auto popup = app->view_controller.get(); popup->set_header("Successfully\nwritten!", 94, 3, AlignCenter, AlignTop); popup->set_icon(0, 6, &I_RFIDDolphinSuccess_108x57); diff --git a/applications/lfrfid/scene/lfrfid_app_scene_write_success.h b/applications/lfrfid/scene/lfrfid_app_scene_write_success.h index 94b8efc1758..4ac9f0892f8 100644 --- a/applications/lfrfid/scene/lfrfid_app_scene_write_success.h +++ b/applications/lfrfid/scene/lfrfid_app_scene_write_success.h @@ -9,4 +9,4 @@ class LfRfidAppSceneWriteSuccess : public GenericScene { private: static void timeout_callback(void* context); -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/view/container_vm.cpp b/applications/lfrfid/view/container_vm.cpp index 8c0e72e2bf8..3c01ba30423 100644 --- a/applications/lfrfid/view/container_vm.cpp +++ b/applications/lfrfid/view/container_vm.cpp @@ -112,4 +112,4 @@ bool ContainerVM::view_input_callback(InputEvent* event, void* context) { template StringElement* ContainerVM::add(); template IconElement* ContainerVM::add(); -template ButtonElement* ContainerVM::add(); \ No newline at end of file +template ButtonElement* ContainerVM::add(); diff --git a/applications/lfrfid/view/elements/generic_element.h b/applications/lfrfid/view/elements/generic_element.h index 269373f16c0..f5a58b2d923 100644 --- a/applications/lfrfid/view/elements/generic_element.h +++ b/applications/lfrfid/view/elements/generic_element.h @@ -18,4 +18,4 @@ class GenericElement { private: View* view = nullptr; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid/view/elements/icon_element.cpp b/applications/lfrfid/view/elements/icon_element.cpp index e4cb19ade72..0b6fba7dad4 100644 --- a/applications/lfrfid/view/elements/icon_element.cpp +++ b/applications/lfrfid/view/elements/icon_element.cpp @@ -12,7 +12,7 @@ void IconElement::draw(Canvas* canvas) { } } -bool IconElement::input(InputEvent* event) { +bool IconElement::input(InputEvent* /* event */) { return false; } diff --git a/applications/lfrfid/view/elements/string_element.cpp b/applications/lfrfid/view/elements/string_element.cpp index 028bd7fdae7..44c11e01a4c 100644 --- a/applications/lfrfid/view/elements/string_element.cpp +++ b/applications/lfrfid/view/elements/string_element.cpp @@ -23,7 +23,7 @@ void StringElement::draw(Canvas* canvas) { } } -bool StringElement::input(InputEvent* event) { +bool StringElement::input(InputEvent* /* event */) { return false; } @@ -44,4 +44,4 @@ void StringElement::set_text( vertical = _vertical; font = _font; unlock_model(true); -} \ No newline at end of file +} diff --git a/applications/lfrfid_debug/lfrfid_debug_app.cpp b/applications/lfrfid_debug/lfrfid_debug_app.cpp index 5de1de71d50..9cd9dcad8fb 100644 --- a/applications/lfrfid_debug/lfrfid_debug_app.cpp +++ b/applications/lfrfid_debug/lfrfid_debug_app.cpp @@ -13,4 +13,4 @@ void LfRfidDebugApp::run() { scene_controller.add_scene(SceneType::Start, new LfRfidDebugAppSceneStart()); scene_controller.add_scene(SceneType::TuneScene, new LfRfidDebugAppSceneTune()); scene_controller.process(100); -} \ No newline at end of file +} diff --git a/applications/lfrfid_debug/lfrfid_debug_app_launcher.cpp b/applications/lfrfid_debug/lfrfid_debug_app_launcher.cpp index 0ee458f4684..4551a17cb4f 100644 --- a/applications/lfrfid_debug/lfrfid_debug_app_launcher.cpp +++ b/applications/lfrfid_debug/lfrfid_debug_app_launcher.cpp @@ -2,6 +2,7 @@ // app enter function extern "C" int32_t lfrfid_debug_app(void* p) { + UNUSED(p); LfRfidDebugApp* app = new LfRfidDebugApp(); app->run(); delete app; diff --git a/applications/lfrfid_debug/scene/lfrfid_debug_app_scene_start.h b/applications/lfrfid_debug/scene/lfrfid_debug_app_scene_start.h index b8f811d07c9..7fc0b07d97d 100644 --- a/applications/lfrfid_debug/scene/lfrfid_debug_app_scene_start.h +++ b/applications/lfrfid_debug/scene/lfrfid_debug_app_scene_start.h @@ -10,4 +10,4 @@ class LfRfidDebugAppSceneStart : public GenericScene { private: void submenu_callback(void* context, uint32_t index); uint32_t submenu_item_selected = 0; -}; \ No newline at end of file +}; diff --git a/applications/lfrfid_debug/scene/lfrfid_debug_app_scene_tune.cpp b/applications/lfrfid_debug/scene/lfrfid_debug_app_scene_tune.cpp index 536794026f7..4b6276497f5 100644 --- a/applications/lfrfid_debug/scene/lfrfid_debug_app_scene_tune.cpp +++ b/applications/lfrfid_debug/scene/lfrfid_debug_app_scene_tune.cpp @@ -2,10 +2,11 @@ #include static void comparator_trigger_callback(bool level, void* comp_ctx) { + UNUSED(comp_ctx); furi_hal_gpio_write(&gpio_ext_pa7, !level); } -void LfRfidDebugAppSceneTune::on_enter(LfRfidDebugApp* app, bool need_restore) { +void LfRfidDebugAppSceneTune::on_enter(LfRfidDebugApp* app, bool /* need_restore */) { app->view_controller.switch_to(); furi_hal_gpio_init_simple(&gpio_ext_pa7, GpioModeOutputPushPull); @@ -17,7 +18,7 @@ void LfRfidDebugAppSceneTune::on_enter(LfRfidDebugApp* app, bool need_restore) { furi_hal_rfid_tim_read_start(); } -bool LfRfidDebugAppSceneTune::on_event(LfRfidDebugApp* app, LfRfidDebugApp::Event* event) { +bool LfRfidDebugAppSceneTune::on_event(LfRfidDebugApp* app, LfRfidDebugApp::Event* /* event */) { bool consumed = false; LfRfidViewTuneVM* tune = app->view_controller; @@ -30,7 +31,7 @@ bool LfRfidDebugAppSceneTune::on_event(LfRfidDebugApp* app, LfRfidDebugApp::Even return consumed; } -void LfRfidDebugAppSceneTune::on_exit(LfRfidDebugApp* app) { +void LfRfidDebugAppSceneTune::on_exit(LfRfidDebugApp* /* app */) { furi_hal_rfid_comp_stop(); furi_hal_rfid_comp_set_callback(NULL, NULL); diff --git a/applications/lfrfid_debug/scene/lfrfid_debug_app_scene_tune.h b/applications/lfrfid_debug/scene/lfrfid_debug_app_scene_tune.h index 94dfea973bd..53399efc9b7 100644 --- a/applications/lfrfid_debug/scene/lfrfid_debug_app_scene_tune.h +++ b/applications/lfrfid_debug/scene/lfrfid_debug_app_scene_tune.h @@ -6,4 +6,4 @@ class LfRfidDebugAppSceneTune : public GenericScene { void on_enter(LfRfidDebugApp* app, bool need_restore) final; bool on_event(LfRfidDebugApp* app, LfRfidDebugApp::Event* event) final; void on_exit(LfRfidDebugApp* app) final; -}; \ No newline at end of file +}; diff --git a/applications/loader/loader.c b/applications/loader/loader.c index 43e275ab988..e5d5970292d 100644 --- a/applications/loader/loader.c +++ b/applications/loader/loader.c @@ -39,6 +39,7 @@ static bool } static void loader_menu_callback(void* _ctx, uint32_t index) { + UNUSED(index); const FlipperApplication* application = _ctx; furi_assert(application->app); @@ -53,6 +54,7 @@ static void loader_menu_callback(void* _ctx, uint32_t index) { } static void loader_submenu_callback(void* context, uint32_t index) { + UNUSED(index); uint32_t view_id = (uint32_t)context; view_dispatcher_switch_to_view(loader_instance->view_dispatcher, view_id); } @@ -101,6 +103,7 @@ const FlipperApplication* loader_find_application_by_name(const char* name) { } void loader_cli_open(Cli* cli, string_t args, Loader* instance) { + UNUSED(cli); if(loader_is_locked(instance)) { printf("Can't start, furi application is running"); return; @@ -139,6 +142,9 @@ void loader_cli_open(Cli* cli, string_t args, Loader* instance) { } void loader_cli_list(Cli* cli, string_t args, Loader* instance) { + UNUSED(cli); + UNUSED(args); + UNUSED(instance); printf("Applications:\r\n"); for(size_t i = 0; i < FLIPPER_APPS_COUNT; i++) { printf("\t%s\r\n", FLIPPER_APPS[i].name); @@ -187,6 +193,7 @@ static void loader_cli(Cli* cli, string_t args, void* _ctx) { } LoaderStatus loader_start(Loader* instance, const char* name, const char* args) { + UNUSED(instance); furi_assert(name); const FlipperApplication* application = loader_find_application_by_name(name); @@ -265,6 +272,7 @@ static void loader_thread_state_callback(FuriThreadState thread_state, void* con } static uint32_t loader_hide_menu(void* context) { + UNUSED(context); return VIEW_NONE; } @@ -445,6 +453,7 @@ void loader_update_menu() { } int32_t loader_srv(void* p) { + UNUSED(p); FURI_LOG_I(TAG, "Executing system start hooks"); for(size_t i = 0; i < FLIPPER_ON_SYSTEM_START_COUNT; i++) { FLIPPER_ON_SYSTEM_START[i](); diff --git a/applications/music_player/music_player_cli.c b/applications/music_player/music_player_cli.c index 3c76cb84057..0d98101e73b 100644 --- a/applications/music_player/music_player_cli.c +++ b/applications/music_player/music_player_cli.c @@ -4,6 +4,7 @@ #include "music_player_worker.h" static void music_player_cli(Cli* cli, string_t args, void* context) { + UNUSED(context); MusicPlayerWorker* music_player_worker = music_player_worker_alloc(); Storage* storage = furi_record_open("storage"); diff --git a/applications/music_player/music_player_worker.c b/applications/music_player/music_player_worker.c index 2c80e6f5e8f..9a0087aa6a9 100644 --- a/applications/music_player/music_player_worker.c +++ b/applications/music_player/music_player_worker.c @@ -250,8 +250,8 @@ static bool music_player_worker_parse_notes(MusicPlayerWorker* instance, const c is_valid &= (duration >= 1 && duration <= 128); is_valid &= ((note_char >= 'A' && note_char <= 'G') || note_char == 'P'); is_valid &= (sharp_char == '#' || sharp_char == '\0'); - is_valid &= (octave >= 0 && octave <= 16); - is_valid &= (dots >= 0 && dots <= 16); + is_valid &= (octave <= 16); + is_valid &= (dots <= 16); if(!is_valid) { FURI_LOG_E( TAG, diff --git a/applications/nfc/helpers/nfc_custom_event.h b/applications/nfc/helpers/nfc_custom_event.h index bab7c0aac37..5de44001730 100644 --- a/applications/nfc/helpers/nfc_custom_event.h +++ b/applications/nfc/helpers/nfc_custom_event.h @@ -9,4 +9,4 @@ enum NfcCustomEvent { NfcCustomEventByteInputDone, NfcCustomEventTextInputDone, NfcCustomEventDictAttackDone, -}; \ No newline at end of file +}; diff --git a/applications/nfc/nfc_cli.c b/applications/nfc/nfc_cli.c index 52c971ef4a1..9b77a29f3d1 100755 --- a/applications/nfc/nfc_cli.c +++ b/applications/nfc/nfc_cli.c @@ -17,6 +17,7 @@ static void nfc_cli_print_usage() { } static void nfc_cli_detect(Cli* cli, string_t args) { + UNUSED(args); // Check if nfc worker is not busy if(furi_hal_nfc_is_busy()) { printf("Nfc is busy\r\n"); @@ -45,6 +46,7 @@ static void nfc_cli_detect(Cli* cli, string_t args) { } static void nfc_cli_emulate(Cli* cli, string_t args) { + UNUSED(args); // Check if nfc worker is not busy if(furi_hal_nfc_is_busy()) { printf("Nfc is busy\r\n"); @@ -74,6 +76,7 @@ static void nfc_cli_emulate(Cli* cli, string_t args) { } static void nfc_cli_field(Cli* cli, string_t args) { + UNUSED(args); // Check if nfc worker is not busy if(furi_hal_nfc_is_busy()) { printf("Nfc is busy\r\n"); @@ -95,6 +98,7 @@ static void nfc_cli_field(Cli* cli, string_t args) { } static void nfc_cli(Cli* cli, string_t args, void* context) { + UNUSED(context); string_t cmd; string_init(cmd); diff --git a/applications/nfc/nfc_device.c b/applications/nfc/nfc_device.c index 6b769803cc9..14fdb67b7c2 100644 --- a/applications/nfc/nfc_device.c +++ b/applications/nfc/nfc_device.c @@ -373,7 +373,7 @@ bool nfc_device_load_mifare_df_app(FlipperFormat* file, MifareDesfireApplication if(!flipper_format_read_hex(file, string_get_cstr(key), tmp, n_files)) break; MifareDesfireFile** file_head = &app->file_head; bool parsed_files = true; - for(int i = 0; i < n_files; i++) { + for(uint32_t i = 0; i < n_files; i++) { parsed_files = false; f = malloc(sizeof(MifareDesfireFile)); memset(f, 0, sizeof(MifareDesfireFile)); @@ -528,7 +528,7 @@ bool nfc_device_load_mifare_df_data(FlipperFormat* file, NfcDevice* dev) { if(!flipper_format_read_hex(file, "Application IDs", tmp, n_apps * 3)) break; bool parsed_apps = true; MifareDesfireApplication** app_head = &data->app_head; - for(int i = 0; i < n_apps; i++) { + for(uint32_t i = 0; i < n_apps; i++) { MifareDesfireApplication* app = malloc(sizeof(MifareDesfireApplication)); memset(app, 0, sizeof(MifareDesfireApplication)); memcpy(app->id, &tmp[i * 3], 3); diff --git a/applications/nfc/scenes/nfc_scene_delete_success.c b/applications/nfc/scenes/nfc_scene_delete_success.c index a52c40d867e..547aeab7e0c 100755 --- a/applications/nfc/scenes/nfc_scene_delete_success.c +++ b/applications/nfc/scenes/nfc_scene_delete_success.c @@ -37,4 +37,4 @@ void nfc_scene_delete_success_on_exit(void* context) { // Clear view popup_reset(nfc->popup); -} \ No newline at end of file +} diff --git a/applications/nfc/scenes/nfc_scene_device_info.c b/applications/nfc/scenes/nfc_scene_device_info.c index 10851e860b9..03464c6625f 100644 --- a/applications/nfc/scenes/nfc_scene_device_info.c +++ b/applications/nfc/scenes/nfc_scene_device_info.c @@ -21,6 +21,7 @@ void nfc_scene_device_info_dialog_callback(DialogExResult result, void* context) } void nfc_scene_device_info_bank_card_callback(GuiButtonType result, InputType type, void* context) { + UNUSED(result); Nfc* nfc = context; if(type == InputTypeShort) { view_dispatcher_send_custom_event(nfc->view_dispatcher, NfcCustomEventViewExit); diff --git a/applications/nfc/scenes/nfc_scene_emulate_mifare_ul.c b/applications/nfc/scenes/nfc_scene_emulate_mifare_ul.c index 871ca636432..eda7637c2a6 100755 --- a/applications/nfc/scenes/nfc_scene_emulate_mifare_ul.c +++ b/applications/nfc/scenes/nfc_scene_emulate_mifare_ul.c @@ -5,6 +5,7 @@ #define NFC_MF_UL_DATA_CHANGED (1UL) void nfc_emulate_mifare_ul_worker_callback(NfcWorkerEvent event, void* context) { + UNUSED(event); Nfc* nfc = context; scene_manager_set_scene_state( diff --git a/applications/nfc/scenes/nfc_scene_emulate_uid.c b/applications/nfc/scenes/nfc_scene_emulate_uid.c index 58ac138e7ef..e67b727401d 100755 --- a/applications/nfc/scenes/nfc_scene_emulate_uid.c +++ b/applications/nfc/scenes/nfc_scene_emulate_uid.c @@ -9,6 +9,7 @@ enum { }; void nfc_emulate_uid_worker_callback(NfcWorkerEvent event, void* context) { + UNUSED(event); furi_assert(context); Nfc* nfc = context; view_dispatcher_send_custom_event(nfc->view_dispatcher, NfcCustomEventWorkerExit); diff --git a/applications/nfc/scenes/nfc_scene_field.c b/applications/nfc/scenes/nfc_scene_field.c index 31cf74b8e75..e3eb6a7088b 100644 --- a/applications/nfc/scenes/nfc_scene_field.c +++ b/applications/nfc/scenes/nfc_scene_field.c @@ -19,6 +19,8 @@ void nfc_scene_field_on_enter(void* context) { } bool nfc_scene_field_on_event(void* context, SceneManagerEvent event) { + UNUSED(context); + UNUSED(event); return false; } diff --git a/applications/nfc/scenes/nfc_scene_file_select.c b/applications/nfc/scenes/nfc_scene_file_select.c index a8126456f2d..36614bb8fb2 100755 --- a/applications/nfc/scenes/nfc_scene_file_select.c +++ b/applications/nfc/scenes/nfc_scene_file_select.c @@ -11,8 +11,11 @@ void nfc_scene_file_select_on_enter(void* context) { } bool nfc_scene_file_select_on_event(void* context, SceneManagerEvent event) { + UNUSED(context); + UNUSED(event); return false; } void nfc_scene_file_select_on_exit(void* context) { + UNUSED(context); } diff --git a/applications/nfc/scenes/nfc_scene_mifare_desfire_app.c b/applications/nfc/scenes/nfc_scene_mifare_desfire_app.c index 0974c062cea..fdfbd2ecb98 100644 --- a/applications/nfc/scenes/nfc_scene_mifare_desfire_app.c +++ b/applications/nfc/scenes/nfc_scene_mifare_desfire_app.c @@ -11,7 +11,7 @@ MifareDesfireApplication* nfc_scene_mifare_desfire_app_get_app(Nfc* nfc) { uint32_t app_idx = scene_manager_get_scene_state(nfc->scene_manager, NfcSceneMifareDesfireApp) >> 1; MifareDesfireApplication* app = nfc->dev->dev_data.mf_df_data.app_head; - for(int i = 0; i < app_idx && app; i++) { + for(uint32_t i = 0; i < app_idx && app; i++) { app = app->next; } return app; diff --git a/applications/nfc/scenes/nfc_scene_read_card.c b/applications/nfc/scenes/nfc_scene_read_card.c index 4d151c08ee6..645b8deb223 100755 --- a/applications/nfc/scenes/nfc_scene_read_card.c +++ b/applications/nfc/scenes/nfc_scene_read_card.c @@ -2,6 +2,7 @@ #include void nfc_read_card_worker_callback(NfcWorkerEvent event, void* context) { + UNUSED(event); Nfc* nfc = context; view_dispatcher_send_custom_event(nfc->view_dispatcher, NfcCustomEventWorkerExit); } diff --git a/applications/nfc/scenes/nfc_scene_read_emv_app.c b/applications/nfc/scenes/nfc_scene_read_emv_app.c index f0192cb9a2a..4a64622dc78 100755 --- a/applications/nfc/scenes/nfc_scene_read_emv_app.c +++ b/applications/nfc/scenes/nfc_scene_read_emv_app.c @@ -2,6 +2,7 @@ #include void nfc_read_emv_app_worker_callback(NfcWorkerEvent event, void* context) { + UNUSED(event); Nfc* nfc = context; view_dispatcher_send_custom_event(nfc->view_dispatcher, NfcCustomEventWorkerExit); } diff --git a/applications/nfc/scenes/nfc_scene_read_emv_data.c b/applications/nfc/scenes/nfc_scene_read_emv_data.c index b72c873e4b4..85df4121212 100755 --- a/applications/nfc/scenes/nfc_scene_read_emv_data.c +++ b/applications/nfc/scenes/nfc_scene_read_emv_data.c @@ -2,6 +2,7 @@ #include void nfc_read_emv_data_worker_callback(NfcWorkerEvent event, void* context) { + UNUSED(event); Nfc* nfc = context; view_dispatcher_send_custom_event(nfc->view_dispatcher, NfcCustomEventWorkerExit); } diff --git a/applications/nfc/scenes/nfc_scene_read_mifare_desfire.c b/applications/nfc/scenes/nfc_scene_read_mifare_desfire.c index ebd7289b911..f14f81bad09 100644 --- a/applications/nfc/scenes/nfc_scene_read_mifare_desfire.c +++ b/applications/nfc/scenes/nfc_scene_read_mifare_desfire.c @@ -2,6 +2,7 @@ #include void nfc_read_mifare_desfire_worker_callback(NfcWorkerEvent event, void* context) { + UNUSED(event); Nfc* nfc = context; view_dispatcher_send_custom_event(nfc->view_dispatcher, NfcCustomEventWorkerExit); } diff --git a/applications/nfc/scenes/nfc_scene_read_mifare_ul.c b/applications/nfc/scenes/nfc_scene_read_mifare_ul.c index 8903e2c433e..659e08fbe10 100755 --- a/applications/nfc/scenes/nfc_scene_read_mifare_ul.c +++ b/applications/nfc/scenes/nfc_scene_read_mifare_ul.c @@ -2,6 +2,7 @@ #include void nfc_read_mifare_ul_worker_callback(NfcWorkerEvent event, void* context) { + UNUSED(event); Nfc* nfc = context; view_dispatcher_send_custom_event(nfc->view_dispatcher, NfcCustomEventWorkerExit); } diff --git a/applications/notification/notification_app.c b/applications/notification/notification_app.c index 4db12bbf23e..7db4986d5ae 100644 --- a/applications/notification/notification_app.c +++ b/applications/notification/notification_app.c @@ -298,7 +298,6 @@ void notification_process_notification_message( need_minimal_delay = true; } - led_active = false; notification_apply_notification_leds(app, led_values); reset_mask |= reset_red_mask; reset_mask |= reset_green_mask; @@ -489,6 +488,7 @@ static NotificationApp* notification_app_alloc() { // App int32_t notification_srv(void* p) { + UNUSED(p); NotificationApp* app = notification_app_alloc(); if(!notification_load_settings(app)) { diff --git a/applications/notification/notification_app_api.c b/applications/notification/notification_app_api.c index ed39b7d6848..d11a289ba03 100644 --- a/applications/notification/notification_app_api.c +++ b/applications/notification/notification_app_api.c @@ -34,4 +34,4 @@ void notification_internal_message_block( furi_check(osMessageQueuePut(app->queue, &m, 0, osWaitForever) == osOK); osEventFlagsWait(m.back_event, NOTIFICATION_EVENT_COMPLETE, osFlagsWaitAny, osWaitForever); osEventFlagsDelete(m.back_event); -}; \ No newline at end of file +}; diff --git a/applications/notification/notification_settings_app.c b/applications/notification/notification_settings_app.c index eef14ebf5e3..bcb1b6a2735 100644 --- a/applications/notification/notification_settings_app.c +++ b/applications/notification/notification_settings_app.c @@ -120,6 +120,7 @@ static void vibro_changed(VariableItem* item) { } static uint32_t notification_app_settings_exit(void* context) { + UNUSED(context); return VIEW_NONE; } @@ -189,6 +190,7 @@ static void free_settings(NotificationAppSettings* app) { } int32_t notification_settings_app(void* p) { + UNUSED(p); NotificationAppSettings* app = alloc_settings(); view_dispatcher_run(app->view_dispatcher); notification_message_save_settings(app->notification); diff --git a/applications/power/battery_test_app/battery_test_app.c b/applications/power/battery_test_app/battery_test_app.c index 1588a525fc2..f24de32ba87 100755 --- a/applications/power/battery_test_app/battery_test_app.c +++ b/applications/power/battery_test_app/battery_test_app.c @@ -89,6 +89,7 @@ void battery_test_free(BatteryTestApp* app) { } int32_t battery_test_app(void* p) { + UNUSED(p); BatteryTestApp* app = battery_test_alloc(); // Disable battery low level notification power_enable_low_battery_level_notification(app->power, false); diff --git a/applications/power/power_cli.c b/applications/power/power_cli.c index 09e75fa90b6..d474a729ce5 100644 --- a/applications/power/power_cli.c +++ b/applications/power/power_cli.c @@ -6,6 +6,8 @@ #include void power_cli_off(Cli* cli, string_t args) { + UNUSED(cli); + UNUSED(args); Power* power = furi_record_open("power"); printf("It's now safe to disconnect USB from your flipper\r\n"); osDelay(666); @@ -13,26 +15,37 @@ void power_cli_off(Cli* cli, string_t args) { } void power_cli_reboot(Cli* cli, string_t args) { + UNUSED(cli); + UNUSED(args); power_reboot(PowerBootModeNormal); } void power_cli_reboot2dfu(Cli* cli, string_t args) { + UNUSED(cli); + UNUSED(args); power_reboot(PowerBootModeDfu); } static void power_cli_info_callback(const char* key, const char* value, bool last, void* context) { + UNUSED(last); + UNUSED(context); printf("%-24s: %s\r\n", key, value); } void power_cli_info(Cli* cli, string_t args) { + UNUSED(cli); + UNUSED(args); furi_hal_power_info_get(power_cli_info_callback, NULL); } void power_cli_debug(Cli* cli, string_t args) { + UNUSED(cli); + UNUSED(args); furi_hal_power_dump_state(); } void power_cli_5v(Cli* cli, string_t args) { + UNUSED(cli); if(!string_cmp(args, "0")) { furi_hal_power_disable_otg(); } else if(!string_cmp(args, "1")) { @@ -43,6 +56,7 @@ void power_cli_5v(Cli* cli, string_t args) { } void power_cli_3v3(Cli* cli, string_t args) { + UNUSED(cli); if(!string_cmp(args, "0")) { furi_hal_power_disable_external_3_3v(); } else if(!string_cmp(args, "1")) { @@ -69,6 +83,7 @@ static void power_cli_command_print_usage() { } void power_cli(Cli* cli, string_t args, void* context) { + UNUSED(context); string_t cmd; string_init(cmd); diff --git a/applications/power/power_settings_app/power_settings_app.c b/applications/power/power_settings_app/power_settings_app.c index 1e87e7d619f..822c51bcccf 100755 --- a/applications/power/power_settings_app/power_settings_app.c +++ b/applications/power/power_settings_app/power_settings_app.c @@ -75,6 +75,7 @@ void power_settings_app_free(PowerSettingsApp* app) { } int32_t power_settings_app(void* p) { + UNUSED(p); PowerSettingsApp* app = power_settings_app_alloc(); view_dispatcher_run(app->view_dispatcher); power_settings_app_free(app); diff --git a/applications/power/power_settings_app/scenes/power_settings_scene_battery_info.c b/applications/power/power_settings_app/scenes/power_settings_scene_battery_info.c index 4dd04f8c349..0085c31dce2 100755 --- a/applications/power/power_settings_app/scenes/power_settings_scene_battery_info.c +++ b/applications/power/power_settings_app/scenes/power_settings_scene_battery_info.c @@ -31,4 +31,5 @@ bool power_settings_scene_battery_info_on_event(void* context, SceneManagerEvent } void power_settings_scene_battery_info_on_exit(void* context) { + UNUSED(context); } diff --git a/applications/power/power_settings_app/scenes/power_settings_scene_reboot.c b/applications/power/power_settings_app/scenes/power_settings_scene_reboot.c index 8edc8138dca..2d879612e77 100755 --- a/applications/power/power_settings_app/scenes/power_settings_scene_reboot.c +++ b/applications/power/power_settings_app/scenes/power_settings_scene_reboot.c @@ -33,6 +33,7 @@ void power_settings_scene_reboot_on_enter(void* context) { } bool power_settings_scene_reboot_on_event(void* context, SceneManagerEvent event) { + UNUSED(context); bool consumed = false; if(event.type == SceneManagerEventTypeCustom) { diff --git a/applications/rpc/rpc.c b/applications/rpc/rpc.c index efd5ed876cd..7d51defd762 100644 --- a/applications/rpc/rpc.c +++ b/applications/rpc/rpc.c @@ -102,7 +102,7 @@ static size_t rpc_sprintf_msg_file( size_t msg_files_size) { size_t cnt = 0; - for(int i = 0; i < msg_files_size; ++i, ++msg_file) { + for(size_t i = 0; i < msg_files_size; ++i, ++msg_file) { string_cat_printf( str, "%s[%c] size: %5ld", @@ -136,7 +136,7 @@ void rpc_print_data(const char* prefix, uint8_t* buffer, size_t size) { string_reserve(str, 100 + size * 5); string_cat_printf(str, "\r\n%s DEC(%d): {", prefix, size); - for(int i = 0; i < size; ++i) { + for(size_t i = 0; i < size; ++i) { string_cat_printf(str, "%d, ", buffer[i]); } string_cat_printf(str, "}\r\n"); @@ -146,7 +146,7 @@ void rpc_print_data(const char* prefix, uint8_t* buffer, size_t size) { string_reserve(str, 100 + size * 3); string_cat_printf(str, "%s HEX(%d): {", prefix, size); - for(int i = 0; i < size; ++i) { + for(size_t i = 0; i < size; ++i) { string_cat_printf(str, "%02X", buffer[i]); } string_cat_printf(str, "}\r\n\r\n"); @@ -573,7 +573,7 @@ static void rpc_session_free_callback(FuriThreadState thread_state, void* contex RpcSession* session = (RpcSession*)context; if(thread_state == FuriThreadStateStopped) { - for(int i = 0; i < COUNT_OF(rpc_systems); ++i) { + for(size_t i = 0; i < COUNT_OF(rpc_systems); ++i) { if(rpc_systems[i].free) { rpc_systems[i].free(session->system_contexts[i]); } @@ -611,7 +611,7 @@ RpcSession* rpc_session_open(Rpc* rpc) { session->decoded_message->cb_content.arg = session; session->system_contexts = malloc(COUNT_OF(rpc_systems) * sizeof(void*)); - for(int i = 0; i < COUNT_OF(rpc_systems); ++i) { + for(size_t i = 0; i < COUNT_OF(rpc_systems); ++i) { session->system_contexts[i] = rpc_systems[i].alloc(session); } @@ -647,6 +647,7 @@ void rpc_session_close(RpcSession* session) { } int32_t rpc_srv(void* p) { + UNUSED(p); Rpc* rpc = malloc(sizeof(Rpc)); rpc->busy_mutex = osMutexNew(NULL); diff --git a/applications/rpc/rpc_cli.c b/applications/rpc/rpc_cli.c index b9304367876..1c8991bc630 100644 --- a/applications/rpc/rpc_cli.c +++ b/applications/rpc/rpc_cli.c @@ -38,6 +38,7 @@ static void rpc_session_terminated_callback(void* context) { } void rpc_cli_command_start_session(Cli* cli, string_t args, void* context) { + UNUSED(args); Rpc* rpc = context; uint32_t mem_before = memmgr_get_free_heap(); diff --git a/applications/rpc/rpc_storage.c b/applications/rpc/rpc_storage.c index a21fec8ea3d..e6a59ea8de3 100644 --- a/applications/rpc/rpc_storage.c +++ b/applications/rpc/rpc_storage.c @@ -31,8 +31,6 @@ typedef struct { uint32_t current_command_id; } RpcStorageSystem; -void rpc_print_message(const PB_Main* message); - static void rpc_system_storage_reset_state( RpcStorageSystem* rpc_storage, RpcSession* session, diff --git a/applications/scened_app_example/scene/scened_app_scene_byte_input.cpp b/applications/scened_app_example/scene/scened_app_scene_byte_input.cpp index 6d618748622..200252ad6cd 100644 --- a/applications/scened_app_example/scene/scened_app_scene_byte_input.cpp +++ b/applications/scened_app_example/scene/scened_app_scene_byte_input.cpp @@ -1,6 +1,6 @@ #include "scened_app_scene_byte_input.h" -void ScenedAppSceneByteInput::on_enter(ScenedApp* app, bool need_restore) { +void ScenedAppSceneByteInput::on_enter(ScenedApp* app, bool /* need_restore */) { ByteInputVM* byte_input = app->view_controller; auto callback = cbc::obtain_connector(this, &ScenedAppSceneByteInput::result_callback); diff --git a/applications/scened_app_example/scene/scened_app_scene_byte_input.h b/applications/scened_app_example/scene/scened_app_scene_byte_input.h index 12daf310a7d..0f0b02acb91 100644 --- a/applications/scened_app_example/scene/scened_app_scene_byte_input.h +++ b/applications/scened_app_example/scene/scened_app_scene_byte_input.h @@ -16,4 +16,4 @@ class ScenedAppSceneByteInput : public GenericScene { 0xF4, 0xD3, }; -}; \ No newline at end of file +}; diff --git a/applications/scened_app_example/scene/scened_app_scene_start.h b/applications/scened_app_example/scene/scened_app_scene_start.h index 19e1b78d68e..8324a20fddc 100644 --- a/applications/scened_app_example/scene/scened_app_scene_start.h +++ b/applications/scened_app_example/scene/scened_app_scene_start.h @@ -10,4 +10,4 @@ class ScenedAppSceneStart : public GenericScene { private: void submenu_callback(void* context, uint32_t index); uint32_t submenu_item_selected = 0; -}; \ No newline at end of file +}; diff --git a/applications/scened_app_example/scened_app.cpp b/applications/scened_app_example/scened_app.cpp index e658d6d0185..64040b22d87 100644 --- a/applications/scened_app_example/scened_app.cpp +++ b/applications/scened_app_example/scened_app.cpp @@ -17,4 +17,4 @@ void ScenedApp::run() { notification_message(notification, &sequence_blink_green_10); scene_controller.process(100); -} \ No newline at end of file +} diff --git a/applications/scened_app_example/scened_app_launcher.cpp b/applications/scened_app_example/scened_app_launcher.cpp index 1664b87dfa0..3d0bdfcaf0b 100644 --- a/applications/scened_app_example/scened_app_launcher.cpp +++ b/applications/scened_app_example/scened_app_launcher.cpp @@ -2,6 +2,7 @@ // app enter function extern "C" int32_t scened_app(void* p) { + UNUSED(p); ScenedApp* app = new ScenedApp(); app->run(); delete app; diff --git a/applications/snake_game/snake_game.c b/applications/snake_game/snake_game.c index 2bc0a6a332c..bb9e207de25 100644 --- a/applications/snake_game/snake_game.c +++ b/applications/snake_game/snake_game.c @@ -313,6 +313,7 @@ static void snake_game_process_game_step(SnakeState* const snake_state) { } int32_t snake_game_app(void* p) { + UNUSED(p); srand(DWT->CYCCNT); osMessageQueueId_t event_queue = osMessageQueueNew(8, sizeof(SnakeEvent), NULL); diff --git a/applications/storage/filesystem_api.c b/applications/storage/filesystem_api.c index 42a10c6b710..b979967acb5 100644 --- a/applications/storage/filesystem_api.c +++ b/applications/storage/filesystem_api.c @@ -35,4 +35,4 @@ const char* filesystem_api_error_get_desc(FS_Error error_id) { break; } return result; -} \ No newline at end of file +} diff --git a/applications/storage/filesystem_api_defines.h b/applications/storage/filesystem_api_defines.h index cc33de26627..b6f1d8f1306 100644 --- a/applications/storage/filesystem_api_defines.h +++ b/applications/storage/filesystem_api_defines.h @@ -57,4 +57,4 @@ const char* filesystem_api_error_get_desc(FS_Error error_id); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/storage/storage.c b/applications/storage/storage.c index 078a136cddf..b280547b7a2 100644 --- a/applications/storage/storage.c +++ b/applications/storage/storage.c @@ -100,6 +100,7 @@ void storage_tick(Storage* app) { } int32_t storage_srv(void* p) { + UNUSED(p); Storage* app = storage_app_alloc(); furi_record_create("storage", app); diff --git a/applications/storage/storage.h b/applications/storage/storage.h index eb51adefa38..eecd1beb4c3 100644 --- a/applications/storage/storage.h +++ b/applications/storage/storage.h @@ -325,4 +325,4 @@ void storage_get_next_filename( #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/storage/storage_cli.c b/applications/storage/storage_cli.c index 3cb345bdf69..70da21d216c 100644 --- a/applications/storage/storage_cli.c +++ b/applications/storage/storage_cli.c @@ -37,6 +37,7 @@ static void storage_cli_print_error(FS_Error error) { } static void storage_cli_info(Cli* cli, string_t path) { + UNUSED(cli); Storage* api = furi_record_open("storage"); if(string_cmp_str(path, "/int") == 0) { @@ -101,6 +102,7 @@ static void storage_cli_format(Cli* cli, string_t path) { }; static void storage_cli_list(Cli* cli, string_t path) { + UNUSED(cli); if(string_cmp_str(path, "/") == 0) { printf("\t[D] int\r\n"); printf("\t[D] ext\r\n"); @@ -137,6 +139,7 @@ static void storage_cli_list(Cli* cli, string_t path) { } static void storage_cli_read(Cli* cli, string_t path) { + UNUSED(cli); Storage* api = furi_record_open("storage"); File* file = storage_file_alloc(api); @@ -295,6 +298,7 @@ static void storage_cli_write_chunk(Cli* cli, string_t path, string_t args) { } static void storage_cli_stat(Cli* cli, string_t path) { + UNUSED(cli); Storage* api = furi_record_open("storage"); if(string_cmp_str(path, "/") == 0) { @@ -334,6 +338,7 @@ static void storage_cli_stat(Cli* cli, string_t path) { } static void storage_cli_copy(Cli* cli, string_t old_path, string_t args) { + UNUSED(cli); Storage* api = furi_record_open("storage"); string_t new_path; string_init(new_path); @@ -354,6 +359,7 @@ static void storage_cli_copy(Cli* cli, string_t old_path, string_t args) { } static void storage_cli_remove(Cli* cli, string_t path) { + UNUSED(cli); Storage* api = furi_record_open("storage"); FS_Error error = storage_common_remove(api, string_get_cstr(path)); @@ -365,6 +371,7 @@ static void storage_cli_remove(Cli* cli, string_t path) { } static void storage_cli_rename(Cli* cli, string_t old_path, string_t args) { + UNUSED(cli); Storage* api = furi_record_open("storage"); string_t new_path; string_init(new_path); @@ -385,6 +392,7 @@ static void storage_cli_rename(Cli* cli, string_t old_path, string_t args) { } static void storage_cli_mkdir(Cli* cli, string_t path) { + UNUSED(cli); Storage* api = furi_record_open("storage"); FS_Error error = storage_common_mkdir(api, string_get_cstr(path)); @@ -396,6 +404,7 @@ static void storage_cli_mkdir(Cli* cli, string_t path) { } static void storage_cli_md5(Cli* cli, string_t path) { + UNUSED(cli); Storage* api = furi_record_open("storage"); File* file = storage_file_alloc(api); @@ -433,6 +442,7 @@ static void storage_cli_md5(Cli* cli, string_t path) { } void storage_cli(Cli* cli, string_t args, void* context) { + UNUSED(context); string_t cmd; string_t path; string_init(cmd); @@ -522,6 +532,8 @@ void storage_cli(Cli* cli, string_t args, void* context) { } static void storage_cli_factory_reset(Cli* cli, string_t args, void* context) { + UNUSED(args); + UNUSED(context); printf("All data will be lost. Are you sure (y/n)?\r\n"); char c = cli_getc(cli); if(c == 'y' || c == 'Y') { diff --git a/applications/storage/storage_glue.h b/applications/storage/storage_glue.h index 21147dce95c..0d50e39b0c9 100644 --- a/applications/storage/storage_glue.h +++ b/applications/storage/storage_glue.h @@ -72,4 +72,4 @@ bool storage_pop_storage_file(File* file, StorageData* storage); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/storage/storage_internal_api.c b/applications/storage/storage_internal_api.c index 754ae0dd09b..ee49d672301 100644 --- a/applications/storage/storage_internal_api.c +++ b/applications/storage/storage_internal_api.c @@ -19,4 +19,4 @@ FS_Error storage_int_restore(Storage* api, const char* srcname) { tar_archive_unpack_to(archive, INT_PATH); tar_archive_free(archive); return success ? FSE_OK : FSE_INTERNAL; -} \ No newline at end of file +} diff --git a/applications/storage/storage_message.h b/applications/storage/storage_message.h index 0e58fff2f2d..f3aeaf321e7 100644 --- a/applications/storage/storage_message.h +++ b/applications/storage/storage_message.h @@ -131,4 +131,4 @@ typedef struct { #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/storage/storage_processing.c b/applications/storage/storage_processing.c index 6120a345bbf..30e6b5e7576 100644 --- a/applications/storage/storage_processing.c +++ b/applications/storage/storage_processing.c @@ -40,7 +40,7 @@ static StorageData* get_storage_by_file(File* file, StorageData* storages) { } static const char* remove_vfs(const char* path) { - return path + MIN(4, strlen(path)); + return path + MIN(4u, strlen(path)); } static const char* ext_path = "/ext"; diff --git a/applications/storage/storage_processing.h b/applications/storage/storage_processing.h index fe2cd1a6a32..bb779c7a80e 100644 --- a/applications/storage/storage_processing.h +++ b/applications/storage/storage_processing.h @@ -13,4 +13,4 @@ void storage_process_message(Storage* app, StorageMessage* message); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/storage/storage_sd_api.c b/applications/storage/storage_sd_api.c index 780646243e7..9e9ca45ceeb 100644 --- a/applications/storage/storage_sd_api.c +++ b/applications/storage/storage_sd_api.c @@ -18,4 +18,4 @@ const char* sd_api_get_fs_type_text(SDFsType fs_type) { return "UNKNOWN"; break; } -} \ No newline at end of file +} diff --git a/applications/storage/storage_sd_api.h b/applications/storage/storage_sd_api.h index 2db358666e5..f83360955e9 100644 --- a/applications/storage/storage_sd_api.h +++ b/applications/storage/storage_sd_api.h @@ -30,4 +30,4 @@ const char* sd_api_get_fs_type_text(SDFsType fs_type); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/storage/storage_test_app.c b/applications/storage/storage_test_app.c index 096276ad23b..f11d2d72ae9 100644 --- a/applications/storage/storage_test_app.c +++ b/applications/storage/storage_test_app.c @@ -316,6 +316,7 @@ static void do_test_end(Storage* api, const char* path) { } int32_t storage_test_app(void* p) { + UNUSED(p); Storage* api = furi_record_open("storage"); do_test_start(api, "/int"); do_test_start(api, "/any"); diff --git a/applications/storage/storages/sd_notify.c b/applications/storage/storages/sd_notify.c index 8c38ac8e465..25ec67c1df5 100644 --- a/applications/storage/storages/sd_notify.c +++ b/applications/storage/storages/sd_notify.c @@ -79,4 +79,4 @@ void sd_notify_eject(NotificationApp* notifications) { void sd_notify_error(NotificationApp* notifications) { notification_message(notifications, &sd_sequence_error); -} \ No newline at end of file +} diff --git a/applications/storage/storages/sd_notify.h b/applications/storage/storages/sd_notify.h index 49e82edf78f..f5aefc74d4e 100644 --- a/applications/storage/storages/sd_notify.h +++ b/applications/storage/storages/sd_notify.h @@ -14,4 +14,4 @@ void sd_notify_error(NotificationApp* notifications); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/storage/storages/storage_ext.c b/applications/storage/storages/storage_ext.c index bf201d5657c..49c52f77140 100644 --- a/applications/storage/storages/storage_ext.c +++ b/applications/storage/storages/storage_ext.c @@ -113,6 +113,7 @@ FS_Error sd_unmount_card(StorageData* storage) { FS_Error sd_format_card(StorageData* storage) { #ifdef FURI_RAM_EXEC + UNUSED(storage); return FSE_NOT_READY; #else uint8_t* work_area; @@ -349,6 +350,10 @@ static uint16_t static uint16_t storage_ext_file_write(void* ctx, File* file, const void* buff, uint16_t const bytes_to_write) { #ifdef FURI_RAM_EXEC + UNUSED(ctx); + UNUSED(file); + UNUSED(buff); + UNUSED(bytes_to_write); return FSE_NOT_READY; #else StorageData* storage = ctx; @@ -389,6 +394,8 @@ static uint64_t storage_ext_file_tell(void* ctx, File* file) { static bool storage_ext_file_truncate(void* ctx, File* file) { #ifdef FURI_RAM_EXEC + UNUSED(ctx); + UNUSED(file); return FSE_NOT_READY; #else StorageData* storage = ctx; @@ -402,6 +409,8 @@ static bool storage_ext_file_truncate(void* ctx, File* file) { static bool storage_ext_file_sync(void* ctx, File* file) { #ifdef FURI_RAM_EXEC + UNUSED(ctx); + UNUSED(file); return FSE_NOT_READY; #else StorageData* storage = ctx; @@ -497,6 +506,7 @@ static bool storage_ext_dir_rewind(void* ctx, File* file) { /******************* Common FS Functions *******************/ static FS_Error storage_ext_common_stat(void* ctx, const char* path, FileInfo* fileinfo) { + UNUSED(ctx); SDFileInfo _fileinfo; SDError result = f_stat(path, &_fileinfo); @@ -511,7 +521,9 @@ static FS_Error storage_ext_common_stat(void* ctx, const char* path, FileInfo* f } static FS_Error storage_ext_common_remove(void* ctx, const char* path) { + UNUSED(ctx); #ifdef FURI_RAM_EXEC + UNUSED(path); return FSE_NOT_READY; #else SDError result = f_unlink(path); @@ -520,7 +532,9 @@ static FS_Error storage_ext_common_remove(void* ctx, const char* path) { } static FS_Error storage_ext_common_mkdir(void* ctx, const char* path) { + UNUSED(ctx); #ifdef FURI_RAM_EXEC + UNUSED(path); return FSE_NOT_READY; #else SDError result = f_mkdir(path); @@ -533,7 +547,11 @@ static FS_Error storage_ext_common_fs_info( const char* fs_path, uint64_t* total_space, uint64_t* free_space) { + UNUSED(fs_path); #ifdef FURI_RAM_EXEC + UNUSED(ctx); + UNUSED(total_space); + UNUSED(free_space); return FSE_NOT_READY; #else StorageData* storage = ctx; @@ -610,4 +628,4 @@ void storage_ext_init(StorageData* storage) { // do not notify on first launch, notifications app is waiting for our thread to read settings storage_ext_tick_internal(storage, false); -} \ No newline at end of file +} diff --git a/applications/storage/storages/storage_ext.h b/applications/storage/storages/storage_ext.h index fa5a5ab168e..07ddbcf2f4e 100644 --- a/applications/storage/storages/storage_ext.h +++ b/applications/storage/storages/storage_ext.h @@ -13,4 +13,4 @@ FS_Error sd_format_card(StorageData* storage); FS_Error sd_card_info(StorageData* storage, SDInfo* sd_info); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/storage/storages/storage_int.c b/applications/storage/storages/storage_int.c index 7f7dd7705d1..291fb426bb5 100644 --- a/applications/storage/storages/storage_int.c +++ b/applications/storage/storages/storage_int.c @@ -129,6 +129,7 @@ static int storage_int_device_erase(const struct lfs_config* c, lfs_block_t bloc } static int storage_int_device_sync(const struct lfs_config* c) { + UNUSED(c); FURI_LOG_D(TAG, "Device sync: skipping, cause "); return 0; } @@ -648,6 +649,7 @@ static FS_Error storage_int_common_fs_info( const char* fs_path, uint64_t* total_space, uint64_t* free_space) { + UNUSED(fs_path); StorageData* storage = ctx; lfs_t* lfs = lfs_get_from_storage(storage); diff --git a/applications/storage/storages/storage_int.h b/applications/storage/storages/storage_int.h index 40588f68c33..456d72408fb 100644 --- a/applications/storage/storages/storage_int.h +++ b/applications/storage/storages/storage_int.h @@ -10,4 +10,4 @@ void storage_int_init(StorageData* storage); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/storage_settings/scenes/storage_settings_scene_config.h b/applications/storage_settings/scenes/storage_settings_scene_config.h index 7628d143288..18e7ba5aa31 100644 --- a/applications/storage_settings/scenes/storage_settings_scene_config.h +++ b/applications/storage_settings/scenes/storage_settings_scene_config.h @@ -6,4 +6,4 @@ ADD_SCENE(storage_settings, formatting, Formatting) ADD_SCENE(storage_settings, sd_info, SDInfo) ADD_SCENE(storage_settings, internal_info, InternalInfo) ADD_SCENE(storage_settings, benchmark, Benchmark) -ADD_SCENE(storage_settings, factory_reset, FactoryReset) \ No newline at end of file +ADD_SCENE(storage_settings, factory_reset, FactoryReset) diff --git a/applications/storage_settings/storage_settings.c b/applications/storage_settings/storage_settings.c index bc982b16045..b89fdf0605c 100644 --- a/applications/storage_settings/storage_settings.c +++ b/applications/storage_settings/storage_settings.c @@ -66,6 +66,7 @@ static void storage_settings_free(StorageSettings* app) { } int32_t storage_settings_app(void* p) { + UNUSED(p); StorageSettings* app = storage_settings_alloc(); view_dispatcher_run(app->view_dispatcher); diff --git a/applications/storage_settings/storage_settings.h b/applications/storage_settings/storage_settings.h index be77a52de9c..f2d071c47c5 100644 --- a/applications/storage_settings/storage_settings.h +++ b/applications/storage_settings/storage_settings.h @@ -44,4 +44,4 @@ typedef enum { #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/subghz/helpers/subghz_frequency_analyzer_worker.c b/applications/subghz/helpers/subghz_frequency_analyzer_worker.c index 8d8ad0b653d..c0e1fdbaaab 100644 --- a/applications/subghz/helpers/subghz_frequency_analyzer_worker.c +++ b/applications/subghz/helpers/subghz_frequency_analyzer_worker.c @@ -44,7 +44,7 @@ static uint32_t subghz_frequency_analyzer_worker_expRunningAverageAdaptive( float k; float newValFloat = newVal; // the sharpness of the filter depends on the absolute value of the difference - if(abs(newValFloat - instance->filVal) > 500000) + if(fabs(newValFloat - instance->filVal) > 500000) k = 0.9; else k = 0.03; diff --git a/applications/subghz/helpers/subghz_testing.h b/applications/subghz/helpers/subghz_testing.h index 3a1549662ef..29ce578a010 100644 --- a/applications/subghz/helpers/subghz_testing.h +++ b/applications/subghz/helpers/subghz_testing.h @@ -3,4 +3,4 @@ extern const uint32_t subghz_frequencies_testing[]; extern const uint32_t subghz_frequencies_count_testing; -extern const uint32_t subghz_frequencies_433_92_testing; \ No newline at end of file +extern const uint32_t subghz_frequencies_433_92_testing; diff --git a/applications/subghz/scenes/subghz_scene_config.h b/applications/subghz/scenes/subghz_scene_config.h index 71cd2668980..1cb217adc11 100644 --- a/applications/subghz/scenes/subghz_scene_config.h +++ b/applications/subghz/scenes/subghz_scene_config.h @@ -21,4 +21,4 @@ ADD_SCENE(subghz, frequency_analyzer, FrequencyAnalyzer) ADD_SCENE(subghz, read_raw, ReadRAW) ADD_SCENE(subghz, more_raw, MoreRAW) ADD_SCENE(subghz, delete_raw, DeleteRAW) -ADD_SCENE(subghz, need_saving, NeedSaving) \ No newline at end of file +ADD_SCENE(subghz, need_saving, NeedSaving) diff --git a/applications/subghz/scenes/subghz_scene_receiver.c b/applications/subghz/scenes/subghz_scene_receiver.c index 19242defbd0..bfc39e91842 100644 --- a/applications/subghz/scenes/subghz_scene_receiver.c +++ b/applications/subghz/scenes/subghz_scene_receiver.c @@ -191,5 +191,5 @@ bool subghz_scene_receiver_on_event(void* context, SceneManagerEvent event) { } void subghz_scene_receiver_on_exit(void* context) { - // SubGhz* subghz = context; + UNUSED(context); } diff --git a/applications/subghz/scenes/subghz_scene_receiver_config.c b/applications/subghz/scenes/subghz_scene_receiver_config.c index d98f45af072..7c2d031f0c6 100644 --- a/applications/subghz/scenes/subghz_scene_receiver_config.c +++ b/applications/subghz/scenes/subghz_scene_receiver_config.c @@ -61,6 +61,7 @@ uint8_t subghz_scene_receiver_config_hopper_value_index( uint8_t values_count, void* context) { furi_assert(context); + UNUSED(values_count); SubGhz* subghz = context; if(value == values[0]) { @@ -188,7 +189,8 @@ void subghz_scene_receiver_config_on_enter(void* context) { } bool subghz_scene_receiver_config_on_event(void* context, SceneManagerEvent event) { - //SubGhz* subghz = context; + UNUSED(context); + UNUSED(event); return false; } diff --git a/applications/subghz/scenes/subghz_scene_saved.c b/applications/subghz/scenes/subghz_scene_saved.c index ae64b7973dd..62ade3508e7 100644 --- a/applications/subghz/scenes/subghz_scene_saved.c +++ b/applications/subghz/scenes/subghz_scene_saved.c @@ -16,10 +16,11 @@ void subghz_scene_saved_on_enter(void* context) { } bool subghz_scene_saved_on_event(void* context, SceneManagerEvent event) { - // SubGhz* subghz = context; + UNUSED(context); + UNUSED(event); return false; } void subghz_scene_saved_on_exit(void* context) { - // SubGhz* subghz = context; + UNUSED(context); } diff --git a/applications/subghz/scenes/subghz_scene_show_only_rx.c b/applications/subghz/scenes/subghz_scene_show_only_rx.c index d5069940e40..48fa751e020 100644 --- a/applications/subghz/scenes/subghz_scene_show_only_rx.c +++ b/applications/subghz/scenes/subghz_scene_show_only_rx.c @@ -26,7 +26,7 @@ void subghz_scene_show_only_rx_on_enter(void* context) { view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewIdPopup); } -const bool subghz_scene_show_only_rx_on_event(void* context, SceneManagerEvent event) { +bool subghz_scene_show_only_rx_on_event(void* context, SceneManagerEvent event) { SubGhz* subghz = context; if(event.type == SceneManagerEventTypeCustom) { if(event.event == SubGhzCustomEventSceneShowOnlyRX) { diff --git a/applications/subghz/scenes/subghz_scene_test_carrier.c b/applications/subghz/scenes/subghz_scene_test_carrier.c index c6d336ea2a9..9677792ba31 100644 --- a/applications/subghz/scenes/subghz_scene_test_carrier.c +++ b/applications/subghz/scenes/subghz_scene_test_carrier.c @@ -26,5 +26,5 @@ bool subghz_scene_test_carrier_on_event(void* context, SceneManagerEvent event) } void subghz_scene_test_carrier_on_exit(void* context) { - // SubGhz* subghz = context; + UNUSED(context); } diff --git a/applications/subghz/scenes/subghz_scene_test_packet.c b/applications/subghz/scenes/subghz_scene_test_packet.c index 243dfd558b5..99f0ab1791f 100644 --- a/applications/subghz/scenes/subghz_scene_test_packet.c +++ b/applications/subghz/scenes/subghz_scene_test_packet.c @@ -26,5 +26,5 @@ bool subghz_scene_test_packet_on_event(void* context, SceneManagerEvent event) { } void subghz_scene_test_packet_on_exit(void* context) { - // SubGhz* subghz = context; + UNUSED(context); } diff --git a/applications/subghz/scenes/subghz_scene_test_static.c b/applications/subghz/scenes/subghz_scene_test_static.c index 2ca47a08270..10e6d02a1da 100644 --- a/applications/subghz/scenes/subghz_scene_test_static.c +++ b/applications/subghz/scenes/subghz_scene_test_static.c @@ -26,5 +26,5 @@ bool subghz_scene_test_static_on_event(void* context, SceneManagerEvent event) { } void subghz_scene_test_static_on_exit(void* context) { - // SubGhz* subghz = context; + UNUSED(context); } diff --git a/applications/subghz/subghz.h b/applications/subghz/subghz.h index 16e1e8575a0..54d3017ed4d 100644 --- a/applications/subghz/subghz.h +++ b/applications/subghz/subghz.h @@ -1,3 +1,3 @@ #pragma once -typedef struct SubGhz SubGhz; \ No newline at end of file +typedef struct SubGhz SubGhz; diff --git a/applications/subghz/subghz_cli.c b/applications/subghz/subghz_cli.c index 65ea0cf2894..d22b86f201e 100644 --- a/applications/subghz/subghz_cli.c +++ b/applications/subghz/subghz_cli.c @@ -20,6 +20,7 @@ "299999755...348000000 or 386999938...464000000 or 778999847...928000000" void subghz_cli_command_tx_carrier(Cli* cli, string_t args, void* context) { + UNUSED(context); uint32_t frequency = 433920000; if(string_size(args)) { @@ -63,6 +64,7 @@ void subghz_cli_command_tx_carrier(Cli* cli, string_t args, void* context) { } void subghz_cli_command_rx_carrier(Cli* cli, string_t args, void* context) { + UNUSED(context); uint32_t frequency = 433920000; if(string_size(args)) { @@ -103,6 +105,7 @@ void subghz_cli_command_rx_carrier(Cli* cli, string_t args, void* context) { } void subghz_cli_command_tx(Cli* cli, string_t args, void* context) { + UNUSED(context); uint32_t frequency = 433920000; uint32_t key = 0x0074BADE; uint32_t repeat = 10; @@ -218,6 +221,7 @@ static void subghz_cli_command_rx_callback( } void subghz_cli_command_rx(Cli* cli, string_t args, void* context) { + UNUSED(context); uint32_t frequency = 433920000; if(string_size(args)) { @@ -296,6 +300,7 @@ void subghz_cli_command_rx(Cli* cli, string_t args, void* context) { } void subghz_cli_command_decode_raw(Cli* cli, string_t args, void* context) { + UNUSED(context); string_t file_name; string_init(file_name); string_set(file_name, "/any/subghz/test.sub"); @@ -423,6 +428,7 @@ static void subghz_cli_command_print_usage() { } static void subghz_cli_command_encrypt_keeloq(Cli* cli, string_t args) { + UNUSED(cli); uint8_t iv[16]; string_t source; @@ -465,6 +471,7 @@ static void subghz_cli_command_encrypt_keeloq(Cli* cli, string_t args) { } static void subghz_cli_command_encrypt_raw(Cli* cli, string_t args) { + UNUSED(cli); uint8_t iv[16]; string_t source; diff --git a/applications/subghz/views/receiver.c b/applications/subghz/views/receiver.c index 03ba5bd28dc..fc66e4fdd89 100644 --- a/applications/subghz/views/receiver.c +++ b/applications/subghz/views/receiver.c @@ -10,7 +10,7 @@ #define FRAME_HEIGHT 12 #define MAX_LEN_PX 100 -#define MENU_ITEMS 4 +#define MENU_ITEMS 4u typedef struct { string_t item_str; @@ -71,9 +71,11 @@ static void subghz_view_receiver_update_offset(SubGhzViewReceiver* subghz_receiv if(history_item > 3 && model->idx >= history_item - 1) { model->list_offset = model->idx - 3; } else if(model->list_offset < model->idx - bounds) { - model->list_offset = CLAMP(model->list_offset + 1, history_item - bounds, 0); + model->list_offset = CLAMP( + (uint16_t)(model->list_offset + 1), (uint16_t)(history_item - bounds), 0); } else if(model->list_offset > model->idx - bounds) { - model->list_offset = CLAMP(model->idx - 1, history_item - bounds, 0); + model->list_offset = + CLAMP((uint16_t)(model->idx - 1), (uint16_t)(history_item - bounds), 0); } return true; }); @@ -157,7 +159,7 @@ void subghz_view_receiver_draw(Canvas* canvas, SubGhzViewReceiverModel* model) { SubGhzReceiverMenuItem* item_menu; for(size_t i = 0; i < MIN(model->history_item, MENU_ITEMS); ++i) { - size_t idx = CLAMP(i + model->list_offset, model->history_item, 0); + size_t idx = CLAMP((uint16_t)(i + model->list_offset), model->history_item, 0); item_menu = SubGhzReceiverMenuItemArray_get(model->history->data, idx); string_set(str_buff, item_menu->item_str); elements_string_fit_width(canvas, str_buff, scrollbar ? MAX_LEN_PX - 6 : MAX_LEN_PX); @@ -218,7 +220,6 @@ bool subghz_view_receiver_input(InputEvent* event, void* context) { void subghz_view_receiver_enter(void* context) { furi_assert(context); - //SubGhzViewReceiver* subghz_receiver = context; } void subghz_view_receiver_exit(void* context) { diff --git a/applications/subghz/views/subghz_test_packet.c b/applications/subghz/views/subghz_test_packet.c index fea3bd89638..57f8508504f 100644 --- a/applications/subghz/views/subghz_test_packet.c +++ b/applications/subghz/views/subghz_test_packet.c @@ -57,6 +57,7 @@ static void subghz_test_packet_rx_callback(bool level, uint32_t duration, void* //todo static void subghz_test_packet_rx_pt_callback(SubGhzDecoderPrinceton* parser, void* context) { + UNUSED(parser); furi_assert(context); SubGhzTestPacket* instance = context; instance->packet_rx++; diff --git a/applications/system/system_settings.c b/applications/system/system_settings.c index f06292ec309..97017c8dfa8 100644 --- a/applications/system/system_settings.c +++ b/applications/system/system_settings.c @@ -46,6 +46,7 @@ static void debug_changed(VariableItem* item) { } static uint32_t system_settings_exit(void* context) { + UNUSED(context); return VIEW_NONE; } @@ -103,6 +104,7 @@ void system_settings_free(SystemSettings* app) { } int32_t system_settings_app(void* p) { + UNUSED(p); SystemSettings* app = system_settings_alloc(); view_dispatcher_run(app->view_dispatcher); system_settings_free(app); diff --git a/applications/u2f/scenes/u2f_scene_main.c b/applications/u2f/scenes/u2f_scene_main.c index d0957b5915c..f6264338bbd 100644 --- a/applications/u2f/scenes/u2f_scene_main.c +++ b/applications/u2f/scenes/u2f_scene_main.c @@ -8,6 +8,7 @@ #define U2F_SUCCESS_TIMEOUT 3000 static void u2f_scene_main_ok_callback(InputType type, void* context) { + UNUSED(type); furi_assert(context); U2fApp* app = context; view_dispatcher_send_custom_event(app->view_dispatcher, U2fCustomEventConfirm); diff --git a/applications/u2f/u2f_app.c b/applications/u2f/u2f_app.c index 8a673dbcb02..2c3ff562ad8 100644 --- a/applications/u2f/u2f_app.c +++ b/applications/u2f/u2f_app.c @@ -86,6 +86,7 @@ void u2f_app_free(U2fApp* app) { } int32_t u2f_app(void* p) { + UNUSED(p); U2fApp* u2f_app = u2f_app_alloc(); view_dispatcher_run(u2f_app->view_dispatcher); diff --git a/applications/u2f/views/u2f_view.c b/applications/u2f/views/u2f_view.c index d04c656d1f3..11e2c9b0462 100644 --- a/applications/u2f/views/u2f_view.c +++ b/applications/u2f/views/u2f_view.c @@ -86,6 +86,7 @@ void u2f_view_set_ok_callback(U2fView* u2f, U2fOkCallback callback, void* contex furi_assert(callback); with_view_model( u2f->view, (U2fModel * model) { + UNUSED(model); u2f->callback = callback; u2f->context = context; return false; diff --git a/applications/unit_tests/flipper_format/flipper_format_string_test.c b/applications/unit_tests/flipper_format/flipper_format_string_test.c index ebc3008ff47..7158ffd824b 100644 --- a/applications/unit_tests/flipper_format/flipper_format_string_test.c +++ b/applications/unit_tests/flipper_format/flipper_format_string_test.c @@ -334,4 +334,4 @@ MU_TEST_SUITE(flipper_format_string_suite) { int run_minunit_test_flipper_format_string() { MU_RUN_SUITE(flipper_format_string_suite); return MU_EXIT_CODE; -} \ No newline at end of file +} diff --git a/applications/unit_tests/furi_pubsub_test.c b/applications/unit_tests/furi_pubsub_test.c index 010a00ab004..57c970b85db 100644 --- a/applications/unit_tests/furi_pubsub_test.c +++ b/applications/unit_tests/furi_pubsub_test.c @@ -42,4 +42,4 @@ void test_furi_pubsub() { // delete pubsub case furi_pubsub_free(test_pubsub); -} \ No newline at end of file +} diff --git a/applications/unit_tests/infrared_decoder_encoder/infrared_decoder_encoder_test.c b/applications/unit_tests/infrared_decoder_encoder/infrared_decoder_encoder_test.c index ca9120edbe4..0c3e685da2f 100644 --- a/applications/unit_tests/infrared_decoder_encoder/infrared_decoder_encoder_test.c +++ b/applications/unit_tests/infrared_decoder_encoder/infrared_decoder_encoder_test.c @@ -55,7 +55,7 @@ static void run_encoder_fill_array( bool level = false; bool level_read; InfraredStatus status = InfraredStatusError; - int i = 0; + size_t i = 0; bool first = true; while(1) { @@ -100,7 +100,7 @@ static void run_encoder( run_encoder_fill_array(encoder_handler, timings, &timings_len, NULL); furi_check(timings_len <= 200); - for(int i = 0; i < timings_len; ++i, ++j) { + for(size_t i = 0; i < timings_len; ++i, ++j) { mu_check(MATCH_TIMING(timings[i], expected_timings[j], 120)); mu_assert(j < expected_timings_len, "encoded more timings than expected"); } @@ -127,7 +127,7 @@ static void furi_check(timings_len <= 200); const InfraredMessage* message_decoded = 0; - for(int i = 0; i < timings_len; ++i) { + for(size_t i = 0; i < timings_len; ++i) { message_decoded = infrared_decode(decoder_handler, level, timings[i]); if((i == timings_len - 2) && level && message_decoded) { /* In case we end with space timing - message can be decoded at last mark */ diff --git a/applications/unit_tests/minunit_vars.h b/applications/unit_tests/minunit_vars.h index 7ef5f825aee..8289fbe2645 100644 --- a/applications/unit_tests/minunit_vars.h +++ b/applications/unit_tests/minunit_vars.h @@ -12,4 +12,4 @@ double minunit_real_timer = 0; double minunit_proc_timer = 0; /* Last message */ -char minunit_last_message[MINUNIT_MESSAGE_LEN]; \ No newline at end of file +char minunit_last_message[MINUNIT_MESSAGE_LEN]; diff --git a/applications/unit_tests/minunit_vars_ex.h b/applications/unit_tests/minunit_vars_ex.h index e2743d1c046..7d6a486ca47 100644 --- a/applications/unit_tests/minunit_vars_ex.h +++ b/applications/unit_tests/minunit_vars_ex.h @@ -12,4 +12,4 @@ extern double minunit_real_timer; extern double minunit_proc_timer; /* Last message */ -extern char minunit_last_message[MINUNIT_MESSAGE_LEN]; \ No newline at end of file +extern char minunit_last_message[MINUNIT_MESSAGE_LEN]; diff --git a/applications/unit_tests/rpc/rpc_test.c b/applications/unit_tests/rpc/rpc_test.c index 2a52ebb0da9..2f97343e939 100644 --- a/applications/unit_tests/rpc/rpc_test.c +++ b/applications/unit_tests/rpc/rpc_test.c @@ -45,7 +45,7 @@ static RpcSessionContext rpc_session[TEST_RPC_SESSIONS]; #define TAG "UnitTestsRpc" #define MAX_RECEIVE_OUTPUT_TIMEOUT 3000 #define MAX_NAME_LENGTH 255 -#define MAX_DATA_SIZE 512 // have to be exact as in rpc_storage.c +#define MAX_DATA_SIZE 512u // have to be exact as in rpc_storage.c #define TEST_DIR TEST_DIR_NAME "/" #define TEST_DIR_NAME "/ext/unit_tests_tmp" #define MD5SUM_SIZE 16 @@ -217,6 +217,8 @@ static void test_rpc_print_message_list(MsgList_t msg_list) { rpc_print_message(msg); } MsgList_reverse(msg_list); +#else + UNUSED(msg_list); #endif } @@ -494,7 +496,7 @@ static void test_rpc_compare_messages(PB_Main* result, PB_Main* expected) { size_t expected_msg_files = expected->content.storage_list_response.file_count; size_t result_msg_files = result->content.storage_list_response.file_count; mu_check(result_msg_files == expected_msg_files); - for(int i = 0; i < expected_msg_files; ++i) { + for(size_t i = 0; i < expected_msg_files; ++i) { PB_Storage_File* result_msg_file = &result->content.storage_list_response.file[i]; PB_Storage_File* expected_msg_file = &expected->content.storage_list_response.file[i]; test_rpc_compare_file(result_msg_file, expected_msg_file); @@ -794,7 +796,7 @@ static void test_create_file(const char* path, size_t size) { if(storage_file_open(file, path, FSAM_WRITE, FSOM_CREATE_ALWAYS)) { uint8_t buf[128] = {0}; - for(int i = 0; i < sizeof(buf); ++i) { + for(size_t i = 0; i < sizeof(buf); ++i) { buf[i] = '0' + (i % 10); } while(size) { @@ -928,7 +930,7 @@ static void test_storage_write_run( MsgList_init(expected_msg_list); uint8_t* buf = malloc(write_size); - for(int i = 0; i < write_size; ++i) { + for(size_t i = 0; i < write_size; ++i) { buf[i] = '0' + (i % 10); } @@ -1551,8 +1553,9 @@ MU_TEST_SUITE(test_rpc_app) { static void test_send_rubbish(RpcSession* session, const char* pattern, size_t pattern_size, size_t size) { + UNUSED(session); uint8_t* buf = malloc(size); - for(int i = 0; i < size; ++i) { + for(size_t i = 0; i < size; ++i) { buf[i] = pattern[i % pattern_size]; } diff --git a/applications/unit_tests/storage/storage_test.c b/applications/unit_tests/storage/storage_test.c index 3fccc68f276..adc5f330d30 100644 --- a/applications/unit_tests/storage/storage_test.c +++ b/applications/unit_tests/storage/storage_test.c @@ -168,4 +168,4 @@ int run_minunit_test_storage() { MU_RUN_SUITE(storage_file); MU_RUN_SUITE(storage_dir); return MU_EXIT_CODE; -} \ No newline at end of file +} diff --git a/applications/unit_tests/stream/stream_test.c b/applications/unit_tests/stream/stream_test.c index eed8a7bccfa..b5e8a18b3c3 100644 --- a/applications/unit_tests/stream/stream_test.c +++ b/applications/unit_tests/stream/stream_test.c @@ -378,4 +378,4 @@ MU_TEST_SUITE(stream_suite) { int run_minunit_test_stream() { MU_RUN_SUITE(stream_suite); return MU_EXIT_CODE; -} \ No newline at end of file +} diff --git a/applications/unit_tests/subghz/subghz_test.c b/applications/unit_tests/subghz/subghz_test.c index 6dc0f964ea8..e0fb8b6b8fb 100644 --- a/applications/unit_tests/subghz/subghz_test.c +++ b/applications/unit_tests/subghz/subghz_test.c @@ -26,6 +26,8 @@ static void subghz_test_rx_callback( SubGhzReceiver* receiver, SubGhzProtocolDecoderBase* decoder_base, void* context) { + UNUSED(receiver); + UNUSED(context); string_t text; string_init(text); subghz_protocol_decoder_base_get_string(decoder_base, text); diff --git a/applications/unit_tests/test_index.c b/applications/unit_tests/test_index.c index ef12224c013..eda0fe4a05a 100644 --- a/applications/unit_tests/test_index.c +++ b/applications/unit_tests/test_index.c @@ -35,6 +35,9 @@ void minunit_print_fail(const char* str) { } void unit_tests_cli(Cli* cli, string_t args, void* context) { + UNUSED(cli); + UNUSED(args); + UNUSED(context); uint32_t test_result = 0; minunit_run = 0; minunit_assert = 0; diff --git a/applications/updater/cli/updater_cli.c b/applications/updater/cli/updater_cli.c index aa08bc61391..000ff56cdfb 100644 --- a/applications/updater/cli/updater_cli.c +++ b/applications/updater/cli/updater_cli.c @@ -65,6 +65,8 @@ static const CliSubcommand update_cli_subcommands[] = { }; static void updater_cli_ep(Cli* cli, string_t args, void* context) { + UNUSED(cli); + UNUSED(context); string_t subcommand; string_init(subcommand); if(!args_read_string_and_trim(args, subcommand) || string_empty_p(args)) { @@ -85,6 +87,7 @@ static void updater_cli_ep(Cli* cli, string_t args, void* context) { } static int32_t updater_spawner_thread_worker(void* arg) { + UNUSED(arg); Loader* loader = furi_record_open("loader"); loader_start(loader, "UpdaterApp", NULL); furi_record_close("loader"); diff --git a/applications/updater/scenes/updater_scene_config.h b/applications/updater/scenes/updater_scene_config.h index d2441c597f9..59601965219 100644 --- a/applications/updater/scenes/updater_scene_config.h +++ b/applications/updater/scenes/updater_scene_config.h @@ -2,4 +2,4 @@ ADD_SCENE(updater, main, Main) #ifndef FURI_RAM_EXEC ADD_SCENE(updater, loadcfg, LoadCfg) ADD_SCENE(updater, error, Error) -#endif \ No newline at end of file +#endif diff --git a/applications/updater/scenes/updater_scene_loadcfg.c b/applications/updater/scenes/updater_scene_loadcfg.c index 78423b071a5..8e477b14a6b 100644 --- a/applications/updater/scenes/updater_scene_loadcfg.c +++ b/applications/updater/scenes/updater_scene_loadcfg.c @@ -102,4 +102,4 @@ void updater_scene_loadcfg_on_exit(void* context) { widget_reset(updater->widget); free(updater->pending_update); -} \ No newline at end of file +} diff --git a/applications/updater/updater.c b/applications/updater/updater.c index c1115ce1830..b58c8daa043 100644 --- a/applications/updater/updater.c +++ b/applications/updater/updater.c @@ -133,4 +133,4 @@ int32_t updater_srv(void* p) { updater_free(updater); return 0; -} \ No newline at end of file +} diff --git a/applications/updater/updater_i.h b/applications/updater/updater_i.h index 89201e1e0aa..8a021a08df9 100644 --- a/applications/updater/updater_i.h +++ b/applications/updater/updater_i.h @@ -64,4 +64,4 @@ void updater_free(Updater* updater); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/updater/util/update_task.c b/applications/updater/util/update_task.c index 9fde086a332..6ff61700ae4 100644 --- a/applications/updater/util/update_task.c +++ b/applications/updater/util/update_task.c @@ -227,4 +227,4 @@ UpdateTaskState const* update_task_get_state(UpdateTask* update_task) { UpdateManifest const* update_task_get_manifest(UpdateTask* update_task) { furi_assert(update_task); return update_task->manifest; -} \ No newline at end of file +} diff --git a/applications/updater/util/update_task.h b/applications/updater/util/update_task.h index 8afc3121667..3197c8c19e0 100644 --- a/applications/updater/util/update_task.h +++ b/applications/updater/util/update_task.h @@ -67,4 +67,4 @@ UpdateManifest const* update_task_get_manifest(UpdateTask* update_task); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/applications/updater/util/update_task_worker_flasher.c b/applications/updater/util/update_task_worker_flasher.c index 22e94fd01b1..6b03439dd6e 100644 --- a/applications/updater/util/update_task_worker_flasher.c +++ b/applications/updater/util/update_task_worker_flasher.c @@ -360,4 +360,4 @@ int32_t update_task_worker_flash_writer(void* context) { } while(false); return success ? UPDATE_TASK_NOERR : UPDATE_TASK_FAILED; -} \ No newline at end of file +} diff --git a/applications/updater/views/updater_main.h b/applications/updater/views/updater_main.h index 3c55a8c24bb..d787295696f 100644 --- a/applications/updater/views/updater_main.h +++ b/applications/updater/views/updater_main.h @@ -25,4 +25,4 @@ void updater_main_set_storage_pubsub(UpdaterMainView* main_view, FuriPubSubSubsc FuriPubSubSubscription* updater_main_get_storage_pubsub(UpdaterMainView* main_view); -void updater_main_set_view_dispatcher(UpdaterMainView* main_view, ViewDispatcher* view_dispatcher); \ No newline at end of file +void updater_main_set_view_dispatcher(UpdaterMainView* main_view, ViewDispatcher* view_dispatcher); diff --git a/core/furi/check.c b/core/furi/check.c index 5ea76614321..b59e490c5a3 100644 --- a/core/furi/check.c +++ b/core/furi/check.c @@ -71,4 +71,4 @@ FURI_NORETURN void furi_halt(const char* message) { furi_hal_console_puts("\r\nSystem halted. Bye-bye!\r\n"); furi_hal_console_puts("\033[0m\r\n"); __furi_halt(); -} \ No newline at end of file +} diff --git a/core/furi/check.h b/core/furi/check.h index adea40399b7..4165c3c25dd 100644 --- a/core/furi/check.h +++ b/core/furi/check.h @@ -14,7 +14,10 @@ extern "C" { #ifdef FURI_DEBUG #define furi_assert(__e) ((__e) ? (void)0 : furi_crash("furi_assert failed\r\n")) #else -#define furi_assert(__e) ((void)0) +#define furi_assert(__e) \ + do { \ + ((void)(__e)); \ + } while(0) #endif /** Crash system */ diff --git a/core/furi/common_defines.h b/core/furi/common_defines.h index 9c4f7b18ef0..5b0e6971377 100644 --- a/core/furi/common_defines.h +++ b/core/furi/common_defines.h @@ -40,11 +40,6 @@ extern "C" { #define CLAMP(x, upper, lower) (MIN(upper, MAX(x, lower))) #endif -// need some common semantics for those two -#ifndef SIZEOF_ARRAY -#define SIZEOF_ARRAY(arr) (sizeof(arr) / sizeof(arr[0])) -#endif - #ifndef COUNT_OF #define COUNT_OF(x) (sizeof(x) / sizeof(x[0])) #endif diff --git a/core/furi/memmgr.c b/core/furi/memmgr.c index 457520d92c8..01cf573eb62 100644 --- a/core/furi/memmgr.c +++ b/core/furi/memmgr.c @@ -1,4 +1,5 @@ #include "memmgr.h" +#include "common_defines.h" #include extern void* pvPortMalloc(size_t xSize); @@ -60,17 +61,21 @@ size_t memmgr_get_minimum_free_heap(void) { } void* __wrap__malloc_r(struct _reent* r, size_t size) { + UNUSED(r); return pvPortMalloc(size); } void __wrap__free_r(struct _reent* r, void* ptr) { + UNUSED(r); vPortFree(ptr); } void* __wrap__calloc_r(struct _reent* r, size_t count, size_t size) { + UNUSED(r); return calloc(count, size); } void* __wrap__realloc_r(struct _reent* r, void* ptr, size_t size) { + UNUSED(r); return realloc(ptr, size); } diff --git a/core/furi/memmgr_heap.c b/core/furi/memmgr_heap.c index 8544092eb52..665fe2e1b38 100644 --- a/core/furi/memmgr_heap.c +++ b/core/furi/memmgr_heap.c @@ -205,6 +205,7 @@ static inline void traceMALLOC(void* pointer, size_t size) { #undef traceFREE static inline void traceFREE(void* pointer, size_t size) { + UNUSED(size); osThreadId_t thread_id = osThreadGetId(); if(thread_id && memmgr_heap_thread_trace_depth == 0) { memmgr_heap_thread_trace_depth++; diff --git a/core/furi/stdglue.c b/core/furi/stdglue.c index 4e727202344..1eccafc9a4b 100644 --- a/core/furi/stdglue.c +++ b/core/furi/stdglue.c @@ -93,9 +93,11 @@ bool furi_stdglue_set_thread_stdout_callback(FuriStdglueWriteCallback callback) } void __malloc_lock(struct _reent* REENT) { + UNUSED(REENT); vTaskSuspendAll(); } void __malloc_unlock(struct _reent* REENT) { + UNUSED(REENT); xTaskResumeAll(); } diff --git a/core/furi/thread.h b/core/furi/thread.h index ea1da27afce..83e6bb93843 100644 --- a/core/furi/thread.h +++ b/core/furi/thread.h @@ -160,4 +160,4 @@ int32_t furi_thread_get_return_code(FuriThread* thread); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/core/furi/valuemutex.c b/core/furi/valuemutex.c index 77a999371d3..6010c963edf 100644 --- a/core/furi/valuemutex.c +++ b/core/furi/valuemutex.c @@ -55,4 +55,4 @@ bool write_mutex(ValueMutex* valuemutex, void* data, size_t len, uint32_t timeou if(!release_mutex(valuemutex, value)) return false; return true; -} \ No newline at end of file +} diff --git a/core/furi/valuemutex.h b/core/furi/valuemutex.h index 84a0809361c..63dfac6111d 100644 --- a/core/furi/valuemutex.h +++ b/core/furi/valuemutex.h @@ -146,4 +146,4 @@ void consumer_app(void* _p) { } } ``` -*/ \ No newline at end of file +*/ diff --git a/docker-compose.yml b/docker-compose.yml index 68aa14c174f..39aca411a19 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,4 +9,4 @@ services: volumes: - .:/project - /dev/bus/usb:/dev/bus/usb - working_dir: '/project' \ No newline at end of file + working_dir: '/project' diff --git a/firmware/targets/f7/Inc/FreeRTOSConfig.h b/firmware/targets/f7/Inc/FreeRTOSConfig.h index c3b2117c5a8..0204826ae0e 100644 --- a/firmware/targets/f7/Inc/FreeRTOSConfig.h +++ b/firmware/targets/f7/Inc/FreeRTOSConfig.h @@ -2,6 +2,7 @@ #if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) #include +#pragma GCC diagnostic ignored "-Wredundant-decls" extern uint32_t SystemCoreClock; #endif diff --git a/firmware/targets/f7/Inc/stm32_assert.h b/firmware/targets/f7/Inc/stm32_assert.h new file mode 100644 index 00000000000..3b0a543dd48 --- /dev/null +++ b/firmware/targets/f7/Inc/stm32_assert.h @@ -0,0 +1,52 @@ +/** + ****************************************************************************** + * @file stm32_assert.h + * @author MCD Application Team + * @brief STM32 assert template file. + * This file should be copied to the application folder and renamed + * to stm32_assert.h. + ****************************************************************************** + * @attention + * + * Copyright (c) 2019 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32_ASSERT_H +#define STM32_ASSERT_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ +/* Includes ------------------------------------------------------------------*/ +/* Exported macro ------------------------------------------------------------*/ + +/* We're confident in the parameters we pass to LL functions, so we can skip asserts + * since they introduce significant bloat to debug builds */ + +#ifdef FURI_LL_DEBUG +#define assert_param furi_assert +#else +#define assert_param(__e) \ + do { \ + ((void)(__e)); \ + } while(0) +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* STM32_ASSERT_H */ \ No newline at end of file diff --git a/firmware/targets/f7/Src/main.c b/firmware/targets/f7/Src/main.c index 1865f8d128a..629c154ed6f 100644 --- a/firmware/targets/f7/Src/main.c +++ b/firmware/targets/f7/Src/main.c @@ -68,16 +68,3 @@ void Error_Handler(void) { void abort() { furi_crash("AbortHandler"); } - -#ifdef USE_FULL_ASSERT -/** - * @brief Reports the name of the source file and the source line number - * where the assert_param error has occurred. - * @param file: pointer to the source file name - * @param line: assert_param error line source number - * @retval None - */ -void assert_failed(uint8_t* file, uint32_t line) { - furi_crash("HAL assert failed"); -} -#endif /* USE_FULL_ASSERT */ diff --git a/firmware/targets/f7/ble_glue/app_debug.h b/firmware/targets/f7/ble_glue/app_debug.h index e1bd65fc7b3..92a54d75b03 100644 --- a/firmware/targets/f7/ble_glue/app_debug.h +++ b/firmware/targets/f7/ble_glue/app_debug.h @@ -35,4 +35,4 @@ void APPD_EnableCPU2(void); #endif /*__APP_DEBUG_H */ -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ \ No newline at end of file +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/ble_glue/ble_app.c b/firmware/targets/f7/ble_glue/ble_app.c index d76b4e7bf2f..618e2b94826 100644 --- a/firmware/targets/f7/ble_glue/ble_app.c +++ b/firmware/targets/f7/ble_glue/ble_app.c @@ -121,6 +121,7 @@ void ble_app_thread_stop() { } static int32_t ble_app_hci_thread(void* arg) { + UNUSED(arg); uint32_t flags = 0; while(1) { @@ -138,6 +139,7 @@ static int32_t ble_app_hci_thread(void* arg) { // Called by WPAN lib void hci_notify_asynch_evt(void* pdata) { + UNUSED(pdata); if(ble_app) { osThreadId_t thread_id = furi_thread_get_thread_id(ble_app->thread); furi_assert(thread_id); @@ -146,12 +148,14 @@ void hci_notify_asynch_evt(void* pdata) { } void hci_cmd_resp_release(uint32_t flag) { + UNUSED(flag); if(ble_app) { osSemaphoreRelease(ble_app->hci_sem); } } void hci_cmd_resp_wait(uint32_t timeout) { + UNUSED(timeout); if(ble_app) { osSemaphoreAcquire(ble_app->hci_sem, osWaitForever); } diff --git a/firmware/targets/f7/ble_glue/ble_glue.c b/firmware/targets/f7/ble_glue/ble_glue.c index ec4a617b8a3..6a100bea2dd 100644 --- a/firmware/targets/f7/ble_glue/ble_glue.c +++ b/firmware/targets/f7/ble_glue/ble_glue.c @@ -349,6 +349,7 @@ void ble_glue_thread_stop() { // Wrap functions static int32_t ble_glue_shci_thread(void* context) { + UNUSED(context); uint32_t flags = 0; while(true) { diff --git a/firmware/targets/f7/ble_glue/ble_glue.h b/firmware/targets/f7/ble_glue/ble_glue.h index e5c2738d935..fe43ae09d78 100644 --- a/firmware/targets/f7/ble_glue/ble_glue.h +++ b/firmware/targets/f7/ble_glue/ble_glue.h @@ -121,4 +121,4 @@ BleGlueCommandResult ble_glue_fus_wait_operation(); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/firmware/targets/f7/ble_glue/gap.c b/firmware/targets/f7/ble_glue/gap.c index 45191a5a5b2..f2a1a96f1f5 100644 --- a/firmware/targets/f7/ble_glue/gap.c +++ b/firmware/targets/f7/ble_glue/gap.c @@ -489,6 +489,7 @@ void gap_stop_advertising() { } static void gap_advetise_timer_callback(void* context) { + UNUSED(context); GapCommand command = GapCommandAdvLowPower; furi_check(osMessageQueuePut(gap->command_queue, &command, 0, 0) == osOK); } @@ -587,6 +588,7 @@ void gap_thread_stop() { } static int32_t gap_app(void* context) { + UNUSED(context); GapCommand command; while(1) { osStatus_t status = osMessageQueueGet(gap->command_queue, &command, NULL, osWaitForever); diff --git a/firmware/targets/f7/fatfs/stm32_adafruit_sd.c b/firmware/targets/f7/fatfs/stm32_adafruit_sd.c index 246eabf0c52..fc2924d43e8 100644 --- a/firmware/targets/f7/fatfs/stm32_adafruit_sd.c +++ b/firmware/targets/f7/fatfs/stm32_adafruit_sd.c @@ -419,6 +419,7 @@ uint8_t BSP_SD_GetCardInfo(SD_CardInfo* pCardInfo) { */ uint8_t BSP_SD_ReadBlocks(uint32_t* pData, uint32_t ReadAddr, uint32_t NumOfBlocks, uint32_t Timeout) { + UNUSED(Timeout); // FIXME! uint32_t offset = 0; uint32_t addr; uint8_t retr = BSP_SD_ERROR; @@ -500,6 +501,7 @@ uint8_t BSP_SD_WriteBlocks( uint32_t WriteAddr, uint32_t NumOfBlocks, uint32_t Timeout) { + UNUSED(Timeout); // FIXME! uint32_t offset = 0; uint32_t addr; uint8_t retr = BSP_SD_ERROR; diff --git a/firmware/targets/f7/fatfs/user_diskio.c b/firmware/targets/f7/fatfs/user_diskio.c index 94a7d4d3515..b504fcd516b 100644 --- a/firmware/targets/f7/fatfs/user_diskio.c +++ b/firmware/targets/f7/fatfs/user_diskio.c @@ -44,6 +44,7 @@ static volatile DSTATUS Stat = STA_NOINIT; static DSTATUS User_CheckStatus(BYTE lun) { + UNUSED(lun); Stat = STA_NOINIT; if(BSP_SD_GetCardState() == MSD_OK) { Stat &= ~STA_NOINIT; @@ -106,6 +107,7 @@ DSTATUS USER_initialize(BYTE pdrv) { */ DSTATUS USER_status(BYTE pdrv) { /* USER CODE BEGIN STATUS */ + UNUSED(pdrv); return Stat; /* USER CODE END STATUS */ } @@ -120,6 +122,7 @@ DSTATUS USER_status(BYTE pdrv) { */ DRESULT USER_read(BYTE pdrv, BYTE* buff, DWORD sector, UINT count) { /* USER CODE BEGIN READ */ + UNUSED(pdrv); DRESULT res = RES_ERROR; furi_hal_spi_acquire(&furi_hal_spi_bus_handle_sd_fast); @@ -151,6 +154,7 @@ DRESULT USER_read(BYTE pdrv, BYTE* buff, DWORD sector, UINT count) { DRESULT USER_write(BYTE pdrv, const BYTE* buff, DWORD sector, UINT count) { /* USER CODE BEGIN WRITE */ /* USER CODE HERE */ + UNUSED(pdrv); DRESULT res = RES_ERROR; furi_hal_spi_acquire(&furi_hal_spi_bus_handle_sd_fast); @@ -181,6 +185,7 @@ DRESULT USER_write(BYTE pdrv, const BYTE* buff, DWORD sector, UINT count) { #if _USE_IOCTL == 1 DRESULT USER_ioctl(BYTE pdrv, BYTE cmd, void* buff) { /* USER CODE BEGIN IOCTL */ + UNUSED(pdrv); DRESULT res = RES_ERROR; BSP_SD_CardInfo CardInfo; @@ -228,4 +233,4 @@ DRESULT USER_ioctl(BYTE pdrv, BYTE cmd, void* buff) { } #endif /* _USE_IOCTL == 1 */ -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ \ No newline at end of file +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/furi_hal/furi_hal_crc.h b/firmware/targets/f7/furi_hal/furi_hal_crc.h index 110e6c05fa3..8abaaad1d6f 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_crc.h +++ b/firmware/targets/f7/furi_hal/furi_hal_crc.h @@ -32,4 +32,4 @@ uint32_t furi_hal_crc_feed(void* data, uint16_t length); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/firmware/targets/f7/furi_hal/furi_hal_i2c_config.h b/firmware/targets/f7/furi_hal/furi_hal_i2c_config.h index 03c0f1ca1c2..a8fb91835fd 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_i2c_config.h +++ b/firmware/targets/f7/furi_hal/furi_hal_i2c_config.h @@ -28,4 +28,4 @@ extern FuriHalI2cBusHandle furi_hal_i2c_handle_external; #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/firmware/targets/f7/furi_hal/furi_hal_i2c_types.h b/firmware/targets/f7/furi_hal/furi_hal_i2c_types.h index 0f2b735e4db..13f361054bb 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_i2c_types.h +++ b/firmware/targets/f7/furi_hal/furi_hal_i2c_types.h @@ -48,4 +48,4 @@ struct FuriHalI2cBusHandle { #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/firmware/targets/f7/furi_hal/furi_hal_info.c b/firmware/targets/f7/furi_hal/furi_hal_info.c index bbb3907dbfd..cf7140eb4e3 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_info.c +++ b/firmware/targets/f7/furi_hal/furi_hal_info.c @@ -132,4 +132,4 @@ void furi_hal_info_get(FuriHalInfoValueCallback out, void* context) { out("protobuf_version_minor", string_get_cstr(value), true, context); string_clear(value); -} \ No newline at end of file +} diff --git a/firmware/targets/f7/furi_hal/furi_hal_nfc.c b/firmware/targets/f7/furi_hal/furi_hal_nfc.c index bf9ea18c482..768a4bac79e 100755 --- a/firmware/targets/f7/furi_hal/furi_hal_nfc.c +++ b/firmware/targets/f7/furi_hal/furi_hal_nfc.c @@ -240,6 +240,7 @@ void rfal_interrupt_callback_handler() { } void rfal_state_changed_callback(void* context) { + UNUSED(context); osEventFlagsSet(event, EVENT_FLAG_STATE_CHANGED); } @@ -289,7 +290,7 @@ bool furi_hal_nfc_emulate_nfca( buff_rx_len = 0; buff_tx_len = 0; uint32_t flag = osEventFlagsWait(event, EVENT_FLAG_ALL, osFlagsWaitAny, timeout); - if(flag == osErrorTimeout || flag == EVENT_FLAG_STOP) { + if(flag == osFlagsErrorTimeout || flag == EVENT_FLAG_STOP) { break; } bool data_received = false; diff --git a/firmware/targets/f7/furi_hal/furi_hal_os.c b/firmware/targets/f7/furi_hal/furi_hal_os.c index 8beb0d084cb..9dd7191fb9c 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_os.c +++ b/firmware/targets/f7/furi_hal/furi_hal_os.c @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -178,5 +179,9 @@ void vPortSuppressTicksAndSleep(TickType_t expected_idle_ticks) { } void vApplicationStackOverflowHook(TaskHandle_t xTask, char* pcTaskName) { + UNUSED(xTask); + furi_hal_console_puts("\r\n\r\n stack overflow in "); + furi_hal_console_puts(pcTaskName); + furi_hal_console_puts("\r\n\r\n"); furi_crash("StackOverflow"); } diff --git a/firmware/targets/f7/furi_hal/furi_hal_random.c b/firmware/targets/f7/furi_hal/furi_hal_random.c index 5dfda2b259b..0f282fac818 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_random.c +++ b/firmware/targets/f7/furi_hal/furi_hal_random.c @@ -51,6 +51,7 @@ void furi_hal_random_fill_buf(uint8_t* buf, uint32_t len) { } void srand(unsigned seed) { + UNUSED(seed); // FIXME! } int rand() { diff --git a/firmware/targets/f7/furi_hal/furi_hal_rfid.c b/firmware/targets/f7/furi_hal/furi_hal_rfid.c index 964bd12b28c..86fecc99490 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_rfid.c +++ b/firmware/targets/f7/furi_hal/furi_hal_rfid.c @@ -152,6 +152,7 @@ void furi_hal_rfid_tim_read_stop() { } void furi_hal_rfid_tim_emulate(float freq) { + UNUSED(freq); // FIXME // basic PWM setup with needed freq and internal clock FURI_CRITICAL_ENTER(); LL_TIM_DeInit(FURI_HAL_RFID_EMULATE_TIMER); diff --git a/firmware/targets/f7/furi_hal/furi_hal_spi.c b/firmware/targets/f7/furi_hal/furi_hal_spi.c index 01cb3ae68d1..f8c5a2c7820 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_spi.c +++ b/firmware/targets/f7/furi_hal/furi_hal_spi.c @@ -83,6 +83,7 @@ void furi_hal_spi_release(FuriHalSpiBusHandle* handle) { } static void furi_hal_spi_bus_end_txrx(FuriHalSpiBusHandle* handle, uint32_t timeout) { + UNUSED(timeout); // FIXME while(LL_SPI_GetTxFIFOLevel(handle->bus->spi) != LL_SPI_TX_FIFO_EMPTY) ; while(LL_SPI_IsActiveFlag_BSY(handle->bus->spi)) diff --git a/firmware/targets/f7/furi_hal/furi_hal_spi_config.h b/firmware/targets/f7/furi_hal/furi_hal_spi_config.h index 3e4296a0584..eab633a1938 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_spi_config.h +++ b/firmware/targets/f7/furi_hal/furi_hal_spi_config.h @@ -58,4 +58,4 @@ extern FuriHalSpiBusHandle furi_hal_spi_bus_handle_sd_slow; #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/firmware/targets/f7/furi_hal/furi_hal_spi_types.h b/firmware/targets/f7/furi_hal/furi_hal_spi_types.h index 1fb1c02b6bd..d2273f38ba5 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_spi_types.h +++ b/firmware/targets/f7/furi_hal/furi_hal_spi_types.h @@ -61,4 +61,4 @@ struct FuriHalSpiBusHandle { #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/firmware/targets/f7/furi_hal/furi_hal_usb.c b/firmware/targets/f7/furi_hal/furi_hal_usb.c index d41414f8730..6a5e534ef3c 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_usb.c +++ b/firmware/targets/f7/furi_hal/furi_hal_usb.c @@ -189,6 +189,9 @@ void furi_hal_usb_set_state_callback(FuriHalUsbStateCallback cb, void* ctx) { } static void reset_evt(usbd_device* dev, uint8_t event, uint8_t ep) { + UNUSED(dev); + UNUSED(event); + UNUSED(ep); osThreadFlagsSet(furi_thread_get_thread_id(usb.thread), EventReset); if(usb.callback != NULL) { usb.callback(FuriHalUsbStateEventReset, usb.cb_ctx); @@ -196,6 +199,9 @@ static void reset_evt(usbd_device* dev, uint8_t event, uint8_t ep) { } static void susp_evt(usbd_device* dev, uint8_t event, uint8_t ep) { + UNUSED(dev); + UNUSED(event); + UNUSED(ep); if((usb.if_cur != NULL) && (usb.connected == true)) { usb.connected = false; usb.if_cur->suspend(&udev); @@ -208,6 +214,9 @@ static void susp_evt(usbd_device* dev, uint8_t event, uint8_t ep) { } static void wkup_evt(usbd_device* dev, uint8_t event, uint8_t ep) { + UNUSED(dev); + UNUSED(event); + UNUSED(ep); if((usb.if_cur != NULL) && (usb.connected == false)) { usb.connected = true; usb.if_cur->wakeup(&udev); @@ -220,6 +229,7 @@ static void wkup_evt(usbd_device* dev, uint8_t event, uint8_t ep) { } static int32_t furi_hal_usb_thread(void* context) { + UNUSED(context); bool usb_request_pending = false; uint8_t usb_wait_time = 0; FuriHalUsbInterface* if_new = NULL; diff --git a/firmware/targets/f7/furi_hal/furi_hal_usb_cdc.c b/firmware/targets/f7/furi_hal/furi_hal_usb_cdc.c index 807f163489d..69a7fb3ce61 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_usb_cdc.c +++ b/firmware/targets/f7/furi_hal/furi_hal_usb_cdc.c @@ -429,6 +429,7 @@ FuriHalUsbInterface usb_cdc_dual = { }; static void cdc_init(usbd_device* dev, FuriHalUsbInterface* intf, void* ctx) { + UNUSED(ctx); usb_dev = dev; cdc_if_cur = intf; @@ -515,6 +516,7 @@ int32_t furi_hal_cdc_receive(uint8_t if_num, uint8_t* buf, uint16_t max_len) { } static void cdc_on_wakeup(usbd_device* dev) { + UNUSED(dev); connected = true; for(uint8_t i = 0; i < IF_NUM_MAX; i++) { if(callbacks[i] != NULL) { @@ -524,6 +526,7 @@ static void cdc_on_wakeup(usbd_device* dev) { } static void cdc_on_suspend(usbd_device* dev) { + UNUSED(dev); connected = false; for(uint8_t i = 0; i < IF_NUM_MAX; i++) { cdc_ctrl_line_state[i] = 0; @@ -534,6 +537,8 @@ static void cdc_on_suspend(usbd_device* dev) { } static void cdc_rx_ep_callback(usbd_device* dev, uint8_t event, uint8_t ep) { + UNUSED(dev); + UNUSED(event); uint8_t if_num = 0; if(ep == CDC0_RXD_EP) if_num = 0; @@ -547,6 +552,8 @@ static void cdc_rx_ep_callback(usbd_device* dev, uint8_t event, uint8_t ep) { } static void cdc_tx_ep_callback(usbd_device* dev, uint8_t event, uint8_t ep) { + UNUSED(dev); + UNUSED(event); uint8_t if_num = 0; if(ep == CDC0_TXD_EP) if_num = 0; @@ -629,6 +636,7 @@ static usbd_respond cdc_ep_config(usbd_device* dev, uint8_t cfg) { /* Control requests handler */ static usbd_respond cdc_control(usbd_device* dev, usbd_ctlreq* req, usbd_rqc_callback* callback) { + UNUSED(callback); /* CDC control requests */ uint8_t if_num = 0; if(((USB_REQ_RECIPIENT | USB_REQ_TYPE) & req->bmRequestType) == diff --git a/firmware/targets/f7/furi_hal/furi_hal_usb_hid.c b/firmware/targets/f7/furi_hal/furi_hal_usb_hid.c index 55825dd9d3c..aae4dd4fb6b 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_usb_hid.c +++ b/firmware/targets/f7/furi_hal/furi_hal_usb_hid.c @@ -375,6 +375,7 @@ static void* hid_set_string_descr(char* str) { } static void hid_init(usbd_device* dev, FuriHalUsbInterface* intf, void* ctx) { + UNUSED(intf); FuriHalUsbHidConfig* cfg = (FuriHalUsbHidConfig*)ctx; if(hid_semaphore == NULL) hid_semaphore = osSemaphoreNew(1, 1, NULL); usb_dev = dev; @@ -419,17 +420,23 @@ static void hid_deinit(usbd_device* dev) { } static void hid_on_wakeup(usbd_device* dev) { - if(hid_connected == false) { + UNUSED(dev); + if(!hid_connected) { hid_connected = true; - if(callback != NULL) callback(true, cb_ctx); + if(callback != NULL) { + callback(true, cb_ctx); + } } } static void hid_on_suspend(usbd_device* dev) { - if(hid_connected == true) { + UNUSED(dev); + if(hid_connected) { hid_connected = false; osSemaphoreRelease(hid_semaphore); - if(callback != NULL) callback(false, cb_ctx); + if(callback != NULL) { + callback(false, cb_ctx); + } } } @@ -450,6 +457,7 @@ static bool hid_send_report(uint8_t report_id) { } static void hid_txrx_ep_callback(usbd_device* dev, uint8_t event, uint8_t ep) { + UNUSED(dev); if(event == usbd_evt_eptx) { osSemaphoreRelease(hid_semaphore); } else { @@ -484,6 +492,7 @@ static usbd_respond hid_ep_config(usbd_device* dev, uint8_t cfg) { /* Control requests handler */ static usbd_respond hid_control(usbd_device* dev, usbd_ctlreq* req, usbd_rqc_callback* callback) { + UNUSED(callback); /* HID control requests */ if(((USB_REQ_RECIPIENT | USB_REQ_TYPE) & req->bmRequestType) == (USB_REQ_INTERFACE | USB_REQ_CLASS) && diff --git a/firmware/targets/f7/furi_hal/furi_hal_usb_u2f.c b/firmware/targets/f7/furi_hal/furi_hal_usb_u2f.c index 37d879ed556..a80410869db 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_usb_u2f.c +++ b/firmware/targets/f7/furi_hal/furi_hal_usb_u2f.c @@ -159,14 +159,18 @@ bool furi_hal_hid_u2f_is_connected() { void furi_hal_hid_u2f_set_callback(HidU2fCallback cb, void* ctx) { if(callback != NULL) { - if(hid_u2f_connected == true) callback(HidU2fDisconnected, cb_ctx); + if(hid_u2f_connected == true) { + callback(HidU2fDisconnected, cb_ctx); + } } callback = cb; cb_ctx = ctx; if(callback != NULL) { - if(hid_u2f_connected == true) callback(HidU2fConnected, cb_ctx); + if(hid_u2f_connected == true) { + callback(HidU2fConnected, cb_ctx); + } } } @@ -186,7 +190,11 @@ FuriHalUsbInterface usb_hid_u2f = { }; static void hid_u2f_init(usbd_device* dev, FuriHalUsbInterface* intf, void* ctx) { - if(hid_u2f_semaphore == NULL) hid_u2f_semaphore = osSemaphoreNew(1, 1, NULL); + UNUSED(intf); + UNUSED(ctx); + if(hid_u2f_semaphore == NULL) { + hid_u2f_semaphore = osSemaphoreNew(1, 1, NULL); + } usb_dev = dev; usbd_reg_config(dev, hid_u2f_ep_config); @@ -201,15 +209,21 @@ static void hid_u2f_deinit(usbd_device* dev) { } static void hid_u2f_on_wakeup(usbd_device* dev) { + UNUSED(dev); hid_u2f_connected = true; - if(callback != NULL) callback(HidU2fConnected, cb_ctx); + if(callback != NULL) { + callback(HidU2fConnected, cb_ctx); + } } static void hid_u2f_on_suspend(usbd_device* dev) { - if(hid_u2f_connected == true) { + UNUSED(dev); + if(hid_u2f_connected) { hid_u2f_connected = false; osSemaphoreRelease(hid_u2f_semaphore); - if(callback != NULL) callback(HidU2fDisconnected, cb_ctx); + if(callback != NULL) { + callback(HidU2fDisconnected, cb_ctx); + } } } @@ -227,10 +241,18 @@ uint32_t furi_hal_hid_u2f_get_request(uint8_t* data) { } static void hid_u2f_rx_ep_callback(usbd_device* dev, uint8_t event, uint8_t ep) { - if(callback != NULL) callback(HidU2fRequest, cb_ctx); + UNUSED(dev); + UNUSED(event); + UNUSED(ep); + if(callback != NULL) { + callback(HidU2fRequest, cb_ctx); + } } static void hid_u2f_tx_ep_callback(usbd_device* dev, uint8_t event, uint8_t ep) { + UNUSED(dev); + UNUSED(event); + UNUSED(ep); osSemaphoreRelease(hid_u2f_semaphore); } @@ -268,6 +290,7 @@ static usbd_respond hid_u2f_ep_config(usbd_device* dev, uint8_t cfg) { /* Control requests handler */ static usbd_respond hid_u2f_control(usbd_device* dev, usbd_ctlreq* req, usbd_rqc_callback* callback) { + UNUSED(callback); /* HID control requests */ if(((USB_REQ_RECIPIENT | USB_REQ_TYPE) & req->bmRequestType) == (USB_REQ_INTERFACE | USB_REQ_CLASS) && diff --git a/firmware/targets/f7/furi_hal/furi_hal_version.c b/firmware/targets/f7/furi_hal/furi_hal_version.c index e580c978c57..7abee281f34 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_version.c +++ b/firmware/targets/f7/furi_hal/furi_hal_version.c @@ -205,7 +205,7 @@ const char* furi_hal_version_get_model_name() { return "Flipper Zero"; } -const FuriHalVersionOtpVersion furi_hal_version_get_otp_version() { +FuriHalVersionOtpVersion furi_hal_version_get_otp_version() { if(*(uint64_t*)FURI_HAL_VERSION_OTP_ADDRESS == 0xFFFFFFFF) { return FuriHalVersionOtpVersionEmpty; } else { @@ -228,27 +228,27 @@ const FuriHalVersionOtpVersion furi_hal_version_get_otp_version() { } } -const uint8_t furi_hal_version_get_hw_version() { +uint8_t furi_hal_version_get_hw_version() { return furi_hal_version.board_version; } -const uint8_t furi_hal_version_get_hw_target() { +uint8_t furi_hal_version_get_hw_target() { return furi_hal_version.board_target; } -const uint8_t furi_hal_version_get_hw_body() { +uint8_t furi_hal_version_get_hw_body() { return furi_hal_version.board_body; } -const FuriHalVersionColor furi_hal_version_get_hw_color() { +FuriHalVersionColor furi_hal_version_get_hw_color() { return furi_hal_version.board_color; } -const uint8_t furi_hal_version_get_hw_connect() { +uint8_t furi_hal_version_get_hw_connect() { return furi_hal_version.board_connect; } -const FuriHalVersionRegion furi_hal_version_get_hw_region() { +FuriHalVersionRegion furi_hal_version_get_hw_region() { return furi_hal_version.board_region; } @@ -266,11 +266,11 @@ const char* furi_hal_version_get_hw_region_name() { return "R??"; } -const FuriHalVersionDisplay furi_hal_version_get_hw_display() { +FuriHalVersionDisplay furi_hal_version_get_hw_display() { return furi_hal_version.board_display; } -const uint32_t furi_hal_version_get_hw_timestamp() { +uint32_t furi_hal_version_get_hw_timestamp() { return furi_hal_version.timestamp; } diff --git a/firmware/targets/f7/target.mk b/firmware/targets/f7/target.mk index 6410ba13099..d96dd5e665d 100644 --- a/firmware/targets/f7/target.mk +++ b/firmware/targets/f7/target.mk @@ -18,7 +18,10 @@ endif MCU_FLAGS = -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -CFLAGS += $(MCU_FLAGS) -DSTM32WB55xx -Wall -fdata-sections -ffunction-sections +# Warnings configuration +CFLAGS += -Wall -Wextra -Wredundant-decls + +CFLAGS += $(MCU_FLAGS) -DSTM32WB55xx -fdata-sections -ffunction-sections LDFLAGS += $(MCU_FLAGS) -specs=nosys.specs -specs=nano.specs CPPFLAGS += -fno-rtti -fno-use-cxa-atexit -fno-exceptions @@ -35,6 +38,7 @@ ASM_SOURCES += $(MXPROJECT_DIR)/startup_stm32wb55xx_cm4.s CUBE_DIR = ../lib/STM32CubeWB CFLAGS += \ -DUSE_FULL_LL_DRIVER \ + -DUSE_FULL_ASSERT \ -DHAVE_FREERTOS CFLAGS += \ -I$(CUBE_DIR)/Drivers/STM32WBxx_HAL_Driver/Inc \ diff --git a/firmware/targets/furi_hal_include/furi_hal_random.h b/firmware/targets/furi_hal_include/furi_hal_random.h index fa549d23d5b..ee69326f416 100644 --- a/firmware/targets/furi_hal_include/furi_hal_random.h +++ b/firmware/targets/furi_hal_include/furi_hal_random.h @@ -21,4 +21,4 @@ void furi_hal_random_fill_buf(uint8_t* buf, uint32_t len); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/firmware/targets/furi_hal_include/furi_hal_sd.h b/firmware/targets/furi_hal_include/furi_hal_sd.h index 307a872126c..e1c08a35ca1 100644 --- a/firmware/targets/furi_hal_include/furi_hal_sd.h +++ b/firmware/targets/furi_hal_include/furi_hal_sd.h @@ -1,3 +1,4 @@ +#pragma once /** * @file furi_hal_sd.h * SD Card HAL API diff --git a/firmware/targets/furi_hal_include/furi_hal_usb_hid.h b/firmware/targets/furi_hal_include/furi_hal_usb_hid.h index 4819e82e9c0..20c76223e99 100644 --- a/firmware/targets/furi_hal_include/furi_hal_usb_hid.h +++ b/firmware/targets/furi_hal_include/furi_hal_usb_hid.h @@ -347,4 +347,4 @@ bool furi_hal_hid_consumer_key_press(uint16_t button); * * @param button key code */ -bool furi_hal_hid_consumer_key_release(uint16_t button); \ No newline at end of file +bool furi_hal_hid_consumer_key_release(uint16_t button); diff --git a/lib/ST25RFAL002/platform.c b/lib/ST25RFAL002/platform.c index 2c624f6e95e..52ac843e3f0 100644 --- a/lib/ST25RFAL002/platform.c +++ b/lib/ST25RFAL002/platform.c @@ -14,6 +14,7 @@ static volatile PlatformIrqCallback platform_irq_callback = NULL; static const GpioPin pin = {ST25R_INT_PORT, ST25R_INT_PIN}; void nfc_isr(void* _ctx) { + UNUSED(_ctx); if(platform_irq_callback && platformGpioIsHigh(ST25R_INT_PORT, ST25R_INT_PIN)) { osThreadFlagsSet(platform_irq_thread_id, 0x1); } diff --git a/lib/ST25RFAL002/source/rfal_t4t.c b/lib/ST25RFAL002/source/rfal_t4t.c index bcc5b8debbf..8592daf8fbb 100644 --- a/lib/ST25RFAL002/source/rfal_t4t.c +++ b/lib/ST25RFAL002/source/rfal_t4t.c @@ -118,6 +118,7 @@ ReturnCode rfalT4TPollerComposeCAPDU(const rfalT4tCApduParam* apduParam) { } /* Check whether requested Lc fits */ +#pragma GCC diagnostic ignored "-Wtype-limits" if((uint16_t)apduParam->Lc > (uint16_t)(RFAL_FEATURE_ISO_DEP_APDU_MAX_LEN - RFAL_T4T_LE_LEN)) { return ERR_PARAM; /* PRQA S 2880 # MISRA 2.1 - Unreachable code due to configuration option being set/unset */ diff --git a/lib/ST25RFAL002/source/st25r3916/st25r3916_com.c b/lib/ST25RFAL002/source/st25r3916/st25r3916_com.c index 71ded38f179..40d65807d17 100644 --- a/lib/ST25RFAL002/source/st25r3916/st25r3916_com.c +++ b/lib/ST25RFAL002/source/st25r3916/st25r3916_com.c @@ -609,7 +609,8 @@ bool st25r3916CheckReg(uint8_t reg, uint8_t mask, uint8_t val) { /*******************************************************************************/ bool st25r3916IsRegValid(uint8_t reg) { - if(!(((int16_t)reg >= (int16_t)ST25R3916_REG_IO_CONF1) && +#pragma GCC diagnostic ignored "-Wtype-limits" + if(!(((int16_t)reg >= (int32_t)ST25R3916_REG_IO_CONF1) && (reg <= (ST25R3916_SPACE_B | ST25R3916_REG_IC_IDENTITY)))) { return false; } diff --git a/lib/ST25RFAL002/timer.h b/lib/ST25RFAL002/timer.h index c6719410eae..b5f5eb329d5 100644 --- a/lib/ST25RFAL002/timer.h +++ b/lib/ST25RFAL002/timer.h @@ -1,3 +1,4 @@ +#pragma once /****************************************************************************** * @attention * @@ -38,7 +39,8 @@ * INCLUDES ****************************************************************************** */ -#include "platform.h" +#include +#include /* ****************************************************************************** diff --git a/lib/app-scened-template/file_worker.c b/lib/app-scened-template/file_worker.c index f32d10d7c2e..3a742ff9693 100644 --- a/lib/app-scened-template/file_worker.c +++ b/lib/app-scened-template/file_worker.c @@ -232,6 +232,7 @@ bool file_worker_write_hex(FileWorker* file_worker, const uint8_t* buffer, uint1 } void file_worker_show_error(FileWorker* file_worker, const char* error_text) { + UNUSED(file_worker); DialogsApp* dialogs = furi_record_open("dialogs"); DialogMessage* message = dialog_message_alloc(); @@ -251,6 +252,7 @@ bool file_worker_file_select( char* result, uint8_t result_size, const char* selected_filename) { + UNUSED(file_worker); DialogsApp* dialogs = furi_record_open("dialogs"); bool ret = dialog_file_select_show(dialogs, path, extension, result, result_size, selected_filename); @@ -259,6 +261,7 @@ bool file_worker_file_select( } bool file_worker_check_common_errors(FileWorker* file_worker) { + UNUSED(file_worker); //TODO remove /* TODO: [FL-1431] Add return value to file_parser.get_sd_api().check_error() and replace get_fs_info(). */ return true; diff --git a/lib/app-scened-template/generic_scene.hpp b/lib/app-scened-template/generic_scene.hpp index c9e823b2b48..979e974787b 100644 --- a/lib/app-scened-template/generic_scene.hpp +++ b/lib/app-scened-template/generic_scene.hpp @@ -6,4 +6,4 @@ template class GenericScene { virtual ~GenericScene(){}; private: -}; \ No newline at end of file +}; diff --git a/lib/app-scened-template/record_controller.hpp b/lib/app-scened-template/record_controller.hpp index af8db58c383..9dfa96573d5 100644 --- a/lib/app-scened-template/record_controller.hpp +++ b/lib/app-scened-template/record_controller.hpp @@ -43,4 +43,4 @@ template class RecordController { private: const char* name; TRecordClass* value; -}; \ No newline at end of file +}; diff --git a/lib/app-scened-template/scene_controller.hpp b/lib/app-scened-template/scene_controller.hpp index 7e4c5ec0f83..678f6c0df7b 100644 --- a/lib/app-scened-template/scene_controller.hpp +++ b/lib/app-scened-template/scene_controller.hpp @@ -141,7 +141,7 @@ template class SceneController { * @param tick_length_ms tick event length in milliseconds */ void process( - uint32_t tick_length_ms = 100, + uint32_t /* tick_length_ms */ = 100, typename TApp::SceneType start_scene_index = TApp::SceneType::Start) { typename TApp::Event event; bool consumed; @@ -240,4 +240,4 @@ template class SceneController { return scene_index; } -}; \ No newline at end of file +}; diff --git a/lib/app-scened-template/text_store.h b/lib/app-scened-template/text_store.h index 95329f6d95e..a01784fdee8 100644 --- a/lib/app-scened-template/text_store.h +++ b/lib/app-scened-template/text_store.h @@ -9,4 +9,4 @@ class TextStore { void set(const char* text...); const uint8_t text_size; char* text; -}; \ No newline at end of file +}; diff --git a/lib/app-scened-template/typeindex_no_rtti.hpp b/lib/app-scened-template/typeindex_no_rtti.hpp index be350cc9d67..4ac52725f18 100644 --- a/lib/app-scened-template/typeindex_no_rtti.hpp +++ b/lib/app-scened-template/typeindex_no_rtti.hpp @@ -118,4 +118,4 @@ template <> struct std::hash { result_type operator()(argument_type const& t) const noexcept { return t.hash_code(); } -}; \ No newline at end of file +}; diff --git a/lib/app-scened-template/view_modules/byte_input_vm.h b/lib/app-scened-template/view_modules/byte_input_vm.h index 8217b2131a7..9a16101277c 100644 --- a/lib/app-scened-template/view_modules/byte_input_vm.h +++ b/lib/app-scened-template/view_modules/byte_input_vm.h @@ -34,4 +34,4 @@ class ByteInputVM : public GenericViewModule { private: ByteInput* byte_input; -}; \ No newline at end of file +}; diff --git a/lib/app-scened-template/view_modules/dialog_ex_vm.h b/lib/app-scened-template/view_modules/dialog_ex_vm.h index 5c3cf124504..66c2b760a01 100644 --- a/lib/app-scened-template/view_modules/dialog_ex_vm.h +++ b/lib/app-scened-template/view_modules/dialog_ex_vm.h @@ -70,4 +70,4 @@ class DialogExVM : public GenericViewModule { private: DialogEx* dialog_ex; -}; \ No newline at end of file +}; diff --git a/lib/app-scened-template/view_modules/generic_view_module.h b/lib/app-scened-template/view_modules/generic_view_module.h index 10f04dc3d0e..8b74ea3add2 100644 --- a/lib/app-scened-template/view_modules/generic_view_module.h +++ b/lib/app-scened-template/view_modules/generic_view_module.h @@ -7,4 +7,4 @@ class GenericViewModule { virtual ~GenericViewModule(){}; virtual View* get_view() = 0; virtual void clean() = 0; -}; \ No newline at end of file +}; diff --git a/lib/app-scened-template/view_modules/popup_vm.h b/lib/app-scened-template/view_modules/popup_vm.h index 483f33a294b..2665056393a 100644 --- a/lib/app-scened-template/view_modules/popup_vm.h +++ b/lib/app-scened-template/view_modules/popup_vm.h @@ -65,4 +65,4 @@ class PopupVM : public GenericViewModule { private: Popup* popup; -}; \ No newline at end of file +}; diff --git a/lib/app-scened-template/view_modules/submenu_vm.h b/lib/app-scened-template/view_modules/submenu_vm.h index 6dba936ff9a..06541527a06 100644 --- a/lib/app-scened-template/view_modules/submenu_vm.h +++ b/lib/app-scened-template/view_modules/submenu_vm.h @@ -39,4 +39,4 @@ class SubmenuVM : public GenericViewModule { private: Submenu* submenu; -}; \ No newline at end of file +}; diff --git a/lib/app-scened-template/view_modules/text_input_vm.h b/lib/app-scened-template/view_modules/text_input_vm.h index 8fafe861c74..81799e48cee 100644 --- a/lib/app-scened-template/view_modules/text_input_vm.h +++ b/lib/app-scened-template/view_modules/text_input_vm.h @@ -38,4 +38,4 @@ class TextInputVM : public GenericViewModule { private: TextInput* text_input; -}; \ No newline at end of file +}; diff --git a/lib/app-template/app_template.h b/lib/app-template/app_template.h index 3af491efe12..7adcf2bf3a0 100644 --- a/lib/app-template/app_template.h +++ b/lib/app-template/app_template.h @@ -110,4 +110,4 @@ template uint8_t AppTemplate::exit( template void AppTemplate::update_gui(void) { view_port_update(view_port); -} \ No newline at end of file +} diff --git a/lib/callback-connector/callback-connector.h b/lib/callback-connector/callback-connector.h index e98ee91428d..10fec3e2d0e 100644 --- a/lib/callback-connector/callback-connector.h +++ b/lib/callback-connector/callback-connector.h @@ -96,4 +96,4 @@ template auto obtain_connector(Functor functor) { } } //end of cbc scope -#endif // CALLBACKCONNECTOR_H \ No newline at end of file +#endif // CALLBACKCONNECTOR_H diff --git a/lib/drivers/bq27220.c b/lib/drivers/bq27220.c index bf654b5d527..18f3f028d00 100644 --- a/lib/drivers/bq27220.c +++ b/lib/drivers/bq27220.c @@ -47,7 +47,7 @@ bool bq27220_set_parameter_u16(FuriHalI2cBusHandle* handle, uint16_t address, ui uint8_t checksum = bq27220_get_checksum(buffer, 4); buffer[0] = checksum; buffer[1] = 6; - ret = furi_hal_i2c_write_mem( + ret &= furi_hal_i2c_write_mem( handle, BQ27220_ADDRESS, CommandMACDataSum, buffer, 2, BQ27220_I2C_TIMEOUT); furi_hal_delay_us(10000); @@ -62,13 +62,13 @@ bool bq27220_init(FuriHalI2cBusHandle* handle, const ParamCEDV* cedv) { return true; } FURI_LOG_I(TAG, "Start updating battery profile"); - OperationStatus status = {}; + OperationStatus status = {0}; if(!bq27220_control(handle, Control_ENTER_CFG_UPDATE)) { FURI_LOG_E(TAG, "Can't configure update"); return false; }; - while((status.CFGUPDATE != 1) && (timeout-- > 0)) { + while((status.CFGUPDATE != true) && (timeout-- > 0)) { bq27220_get_operation_status(handle, &status); } bq27220_set_parameter_u16(handle, AddressGaugingConfig, cedv->cedv_conf.gauge_conf_raw); diff --git a/lib/drivers/cc1101.h b/lib/drivers/cc1101.h index c35c823c62b..af1f15569d1 100644 --- a/lib/drivers/cc1101.h +++ b/lib/drivers/cc1101.h @@ -148,13 +148,6 @@ uint32_t cc1101_set_intermediate_frequency(FuriHalSpiBusHandle* handle, uint32_t */ void cc1101_set_pa_table(FuriHalSpiBusHandle* handle, const uint8_t value[8]); -/** Set Power Amplifier level table, ramp - * - * @param handle - pointer to FuriHalSpiHandle - * @param value - array of power level values - */ -void cc1101_set_pa_table(FuriHalSpiBusHandle* handle, const uint8_t value[8]); - /** Write FIFO * * @param handle - pointer to FuriHalSpiHandle @@ -177,4 +170,4 @@ uint8_t cc1101_read_fifo(FuriHalSpiBusHandle* handle, uint8_t* data, uint8_t* si #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/drivers/cc1101_regs.h b/lib/drivers/cc1101_regs.h index 30a680bebef..a326dc92ce8 100644 --- a/lib/drivers/cc1101_regs.h +++ b/lib/drivers/cc1101_regs.h @@ -209,4 +209,4 @@ typedef struct { #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/fatfs/ff.c b/lib/fatfs/ff.c index b0bd4366298..85ab9736eb5 100644 --- a/lib/fatfs/ff.c +++ b/lib/fatfs/ff.c @@ -1059,7 +1059,7 @@ DWORD get_fat ( /* 0xFFFFFFFF:Disk error, 1:Internal error, 2..0x7FFFFFFF:Cluste break; } } - /* go to default */ + __attribute__ ((fallthrough)); #endif default: val = 1; /* Internal error */ @@ -5430,7 +5430,7 @@ FRESULT f_mkfs ( ch = 0xFFFF; st = 2; break; /* Compress the no-case block if run is >= 128 */ } st = 1; /* Do not compress short run */ - /* go to next case */ + __attribute__ ((fallthrough)); case 1: ch = si++; /* Fill the short run */ if (--j == 0) st = 0; diff --git a/lib/fatfs/ff_gen_drv.c b/lib/fatfs/ff_gen_drv.c index ccd595bba26..9fb51efa8ef 100644 --- a/lib/fatfs/ff_gen_drv.c +++ b/lib/fatfs/ff_gen_drv.c @@ -79,6 +79,7 @@ uint8_t FATFS_LinkDriver(const Diskio_drvTypeDef *drv, char *path) */ uint8_t FATFS_UnLinkDriverEx(char *path, uint8_t lun) { + (void)lun; uint8_t DiskNum = 0; uint8_t ret = 1; diff --git a/lib/flipper_format/flipper_format.c b/lib/flipper_format/flipper_format.c index 01f54632a1c..cee76701749 100644 --- a/lib/flipper_format/flipper_format.c +++ b/lib/flipper_format/flipper_format.c @@ -584,4 +584,4 @@ bool flipper_format_insert_or_update_hex( } return result; -} \ No newline at end of file +} diff --git a/lib/flipper_format/flipper_format.h b/lib/flipper_format/flipper_format.h index 0f3c299dbe5..49e3f936599 100644 --- a/lib/flipper_format/flipper_format.h +++ b/lib/flipper_format/flipper_format.h @@ -622,4 +622,4 @@ bool flipper_format_insert_or_update_hex( #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/flipper_format/flipper_format_i.h b/lib/flipper_format/flipper_format_i.h index a47d413146d..55b06f9ff3c 100644 --- a/lib/flipper_format/flipper_format_i.h +++ b/lib/flipper_format/flipper_format_i.h @@ -16,4 +16,4 @@ Stream* flipper_format_get_raw_stream(FlipperFormat* flipper_format); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/flipper_format/flipper_format_stream.c b/lib/flipper_format/flipper_format_stream.c index b3a085904b1..93b788a38e1 100644 --- a/lib/flipper_format/flipper_format_stream.c +++ b/lib/flipper_format/flipper_format_stream.c @@ -295,7 +295,7 @@ bool flipper_format_stream_write_value_line(Stream* stream, FlipperStreamWriteDa furi_crash("Unknown FF type"); } - if((i + 1) < write_data->data_size) { + if((size_t)(i + 1) < write_data->data_size) { string_cat(value, " "); } @@ -340,7 +340,7 @@ bool flipper_format_stream_read_value_line( string_t value; string_init(value); - for(uint16_t i = 0; i < data_size; i++) { + for(size_t i = 0; i < data_size; i++) { bool last = false; result = flipper_format_stream_read_value(stream, value, &last); if(result) { @@ -507,4 +507,4 @@ bool flipper_format_stream_write_comment_cstr(Stream* stream, const char* data) } while(false); return result; -} \ No newline at end of file +} diff --git a/lib/flipper_format/flipper_format_stream.h b/lib/flipper_format/flipper_format_stream.h index dc9fb5b3af2..6ac17322f16 100644 --- a/lib/flipper_format/flipper_format_stream.h +++ b/lib/flipper_format/flipper_format_stream.h @@ -92,4 +92,4 @@ bool flipper_format_stream_write_comment_cstr(Stream* stream, const char* data); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/flipper_format/flipper_format_stream_i.h b/lib/flipper_format/flipper_format_stream_i.h index 74cf8f1a551..f3614900755 100644 --- a/lib/flipper_format/flipper_format_stream_i.h +++ b/lib/flipper_format/flipper_format_stream_i.h @@ -31,4 +31,4 @@ bool flipper_format_stream_seek_to_key(Stream* stream, const char* key, bool str #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/fnv1a-hash/fnv1a-hash.c b/lib/fnv1a-hash/fnv1a-hash.c index a5bfa206c96..69c675f310a 100644 --- a/lib/fnv1a-hash/fnv1a-hash.c +++ b/lib/fnv1a-hash/fnv1a-hash.c @@ -7,4 +7,4 @@ uint32_t fnv1a_buffer_hash(const uint8_t* buffer, uint32_t length, uint32_t hash hash = (hash ^ buffer[i]) * 16777619ULL; } return hash; -} \ No newline at end of file +} diff --git a/lib/fnv1a-hash/fnv1a-hash.h b/lib/fnv1a-hash/fnv1a-hash.h index fbbdb5b87c6..3218cc27c75 100644 --- a/lib/fnv1a-hash/fnv1a-hash.h +++ b/lib/fnv1a-hash/fnv1a-hash.h @@ -36,4 +36,4 @@ inline uint32_t fnv1a_string_hash(const char* str) { } return hash; } -#endif \ No newline at end of file +#endif diff --git a/lib/heatshrink/heatshrink_encoder.c b/lib/heatshrink/heatshrink_encoder.c index 9cd2594cdcf..98f27dff872 100644 --- a/lib/heatshrink/heatshrink_encoder.c +++ b/lib/heatshrink/heatshrink_encoder.c @@ -232,6 +232,7 @@ HSE_poll_res heatshrink_encoder_poll(heatshrink_encoder *hse, break; case HSES_FLUSH_BITS: hse->state = st_flush_bit_buffer(hse, &oi); + /* fall through */ case HSES_DONE: return HSER_POLL_EMPTY; default: diff --git a/lib/infrared/encoder_decoder/common/infrared_common_decoder.c b/lib/infrared/encoder_decoder/common/infrared_common_decoder.c index c39de09ee76..1d94428568f 100644 --- a/lib/infrared/encoder_decoder/common/infrared_common_decoder.c +++ b/lib/infrared/encoder_decoder/common/infrared_common_decoder.c @@ -12,7 +12,9 @@ static void infrared_common_decoder_reset_state(InfraredCommonDecoder* decoder); static inline size_t consume_samples(uint32_t* array, size_t len, size_t shift) { furi_assert(len >= shift); len -= shift; - for(int i = 0; i < len; ++i) array[i] = array[i + shift]; + for(size_t i = 0; i < len; ++i) { + array[i] = array[i + shift]; + } return len; } @@ -83,8 +85,8 @@ static InfraredStatus infrared_common_decode_bits(InfraredCommonDecoder* decoder if(timings->min_split_time && !level) { if(timing > timings->min_split_time) { /* long low timing - check if we're ready for any of protocol modification */ - for(int i = 0; decoder->protocol->databit_len[i] && - (i < COUNT_OF(decoder->protocol->databit_len)); + for(size_t i = 0; decoder->protocol->databit_len[i] && + (i < COUNT_OF(decoder->protocol->databit_len)); ++i) { if(decoder->protocol->databit_len[i] == decoder->databit_cnt) { return InfraredStatusReady; @@ -153,8 +155,8 @@ InfraredStatus InfraredStatus infrared_common_decode_manchester(InfraredCommonDecoder* decoder, bool level, uint32_t timing) { furi_assert(decoder); - uint16_t bit = decoder->protocol->timings.bit1_mark; - uint16_t tolerance = decoder->protocol->timings.bit_tolerance; + uint32_t bit = decoder->protocol->timings.bit1_mark; + uint32_t tolerance = decoder->protocol->timings.bit_tolerance; bool* switch_detect = &decoder->switch_detect; furi_assert((*switch_detect == true) || (*switch_detect == false)); @@ -196,7 +198,7 @@ InfraredMessage* infrared_common_decoder_check_ready(InfraredCommonDecoder* deco InfraredMessage* message = NULL; bool found_length = false; - for(int i = 0; + for(size_t i = 0; decoder->protocol->databit_len[i] && (i < COUNT_OF(decoder->protocol->databit_len)); ++i) { if(decoder->protocol->databit_len[i] == decoder->databit_cnt) { @@ -280,7 +282,7 @@ void* infrared_common_decoder_alloc(const InfraredCommonProtocolSpec* protocol) furi_assert(protocol); /* protocol->databit_len[0] has to contain biggest value of bits that can be decoded */ - for(int i = 1; i < COUNT_OF(protocol->databit_len); ++i) { + for(size_t i = 1; i < COUNT_OF(protocol->databit_len); ++i) { furi_assert(protocol->databit_len[i] <= protocol->databit_len[0]); } diff --git a/lib/infrared/encoder_decoder/common/infrared_common_encoder.c b/lib/infrared/encoder_decoder/common/infrared_common_encoder.c index 563c1e640a2..f755222d1c4 100644 --- a/lib/infrared/encoder_decoder/common/infrared_common_encoder.c +++ b/lib/infrared/encoder_decoder/common/infrared_common_encoder.c @@ -146,7 +146,7 @@ void* infrared_common_encoder_alloc(const InfraredCommonProtocolSpec* protocol) } /* protocol->databit_len[0] has to contain biggest value of bits that can be decoded */ - for(int i = 1; i < COUNT_OF(protocol->databit_len); ++i) { + for(size_t i = 1; i < COUNT_OF(protocol->databit_len); ++i) { furi_assert(protocol->databit_len[i] <= protocol->databit_len[0]); } @@ -174,7 +174,7 @@ void infrared_common_encoder_reset(InfraredCommonEncoder* encoder) { uint8_t max_databit_len = 0; - for(int i = 0; i < COUNT_OF(encoder->protocol->databit_len); ++i) { + for(size_t i = 0; i < COUNT_OF(encoder->protocol->databit_len); ++i) { max_databit_len = MAX(max_databit_len, encoder->protocol->databit_len[i]); } diff --git a/lib/infrared/encoder_decoder/infrared.c b/lib/infrared/encoder_decoder/infrared.c index 5dfa928134b..59b11d5cedb 100644 --- a/lib/infrared/encoder_decoder/infrared.c +++ b/lib/infrared/encoder_decoder/infrared.c @@ -123,7 +123,7 @@ const InfraredMessage* InfraredMessage* message = NULL; InfraredMessage* result = NULL; - for(int i = 0; i < COUNT_OF(infrared_encoder_decoder); ++i) { + for(size_t i = 0; i < COUNT_OF(infrared_encoder_decoder); ++i) { if(infrared_encoder_decoder[i].decoder.decode) { message = infrared_encoder_decoder[i].decoder.decode(handler->ctx[i], level, duration); if(!result && message) { @@ -139,7 +139,7 @@ InfraredDecoderHandler* infrared_alloc_decoder(void) { InfraredDecoderHandler* handler = malloc(sizeof(InfraredDecoderHandler)); handler->ctx = malloc(sizeof(void*) * COUNT_OF(infrared_encoder_decoder)); - for(int i = 0; i < COUNT_OF(infrared_encoder_decoder); ++i) { + for(size_t i = 0; i < COUNT_OF(infrared_encoder_decoder); ++i) { handler->ctx[i] = 0; if(infrared_encoder_decoder[i].decoder.alloc) handler->ctx[i] = infrared_encoder_decoder[i].decoder.alloc(); @@ -153,7 +153,7 @@ void infrared_free_decoder(InfraredDecoderHandler* handler) { furi_assert(handler); furi_assert(handler->ctx); - for(int i = 0; i < COUNT_OF(infrared_encoder_decoder); ++i) { + for(size_t i = 0; i < COUNT_OF(infrared_encoder_decoder); ++i) { if(infrared_encoder_decoder[i].decoder.free) infrared_encoder_decoder[i].decoder.free(handler->ctx[i]); } @@ -163,7 +163,7 @@ void infrared_free_decoder(InfraredDecoderHandler* handler) { } void infrared_reset_decoder(InfraredDecoderHandler* handler) { - for(int i = 0; i < COUNT_OF(infrared_encoder_decoder); ++i) { + for(size_t i = 0; i < COUNT_OF(infrared_encoder_decoder); ++i) { if(infrared_encoder_decoder[i].decoder.reset) infrared_encoder_decoder[i].decoder.reset(handler->ctx[i]); } @@ -175,7 +175,7 @@ const InfraredMessage* infrared_check_decoder_ready(InfraredDecoderHandler* hand InfraredMessage* message = NULL; InfraredMessage* result = NULL; - for(int i = 0; i < COUNT_OF(infrared_encoder_decoder); ++i) { + for(size_t i = 0; i < COUNT_OF(infrared_encoder_decoder); ++i) { if(infrared_encoder_decoder[i].decoder.check_ready) { message = infrared_encoder_decoder[i].decoder.check_ready(handler->ctx[i]); if(!result && message) { @@ -209,7 +209,7 @@ void infrared_free_encoder(InfraredEncoderHandler* handler) { } static int infrared_find_index_by_protocol(InfraredProtocol protocol) { - for(int i = 0; i < COUNT_OF(infrared_encoder_decoder); ++i) { + for(size_t i = 0; i < COUNT_OF(infrared_encoder_decoder); ++i) { if(infrared_encoder_decoder[i].get_protocol_spec(protocol)) { return i; } diff --git a/lib/infrared/encoder_decoder/nec/infrared_decoder_nec.c b/lib/infrared/encoder_decoder/nec/infrared_decoder_nec.c index 10ff56da726..3ad14a7ab1a 100644 --- a/lib/infrared/encoder_decoder/nec/infrared_decoder_nec.c +++ b/lib/infrared/encoder_decoder/nec/infrared_decoder_nec.c @@ -20,7 +20,9 @@ bool infrared_decoder_nec_interpret(InfraredCommonDecoder* decoder) { uint8_t address_inverse = decoder->data[1]; uint8_t command = decoder->data[2]; uint8_t command_inverse = decoder->data[3]; - if((command == (uint8_t)~command_inverse) && (address == (uint8_t)~address_inverse)) { + uint8_t inverse_command_inverse = (uint8_t)~command_inverse; + uint8_t inverse_address_inverse = (uint8_t)~address_inverse; + if((command == inverse_command_inverse) && (address == inverse_address_inverse)) { decoder->message.protocol = InfraredProtocolNEC; decoder->message.address = address; decoder->message.command = command; diff --git a/lib/infrared/encoder_decoder/rc6/infrared_decoder_rc6.c b/lib/infrared/encoder_decoder/rc6/infrared_decoder_rc6.c index 9101cac1242..13d3e5364dc 100644 --- a/lib/infrared/encoder_decoder/rc6/infrared_decoder_rc6.c +++ b/lib/infrared/encoder_decoder/rc6/infrared_decoder_rc6.c @@ -60,8 +60,8 @@ InfraredStatus infrared_decoder_rc6_decode_manchester( uint32_t timing) { // 4th bit lasts 2x times more InfraredStatus status = InfraredStatusError; - uint16_t bit = decoder->protocol->timings.bit1_mark; - uint16_t tolerance = decoder->protocol->timings.bit_tolerance; + uint32_t bit = decoder->protocol->timings.bit1_mark; + uint32_t tolerance = decoder->protocol->timings.bit_tolerance; bool single_timing = MATCH_TIMING(timing, bit, tolerance); bool double_timing = MATCH_TIMING(timing, 2 * bit, tolerance); diff --git a/lib/infrared/encoder_decoder/samsung/infrared_decoder_samsung.c b/lib/infrared/encoder_decoder/samsung/infrared_decoder_samsung.c index 4450ffd1602..e8cd3b05cb5 100644 --- a/lib/infrared/encoder_decoder/samsung/infrared_decoder_samsung.c +++ b/lib/infrared/encoder_decoder/samsung/infrared_decoder_samsung.c @@ -17,8 +17,9 @@ bool infrared_decoder_samsung32_interpret(InfraredCommonDecoder* decoder) { uint8_t address2 = decoder->data[1]; uint8_t command = decoder->data[2]; uint8_t command_inverse = decoder->data[3]; + uint8_t inverse_command_inverse = (uint8_t)~command_inverse; - if((address1 == address2) && (command == (uint8_t)~command_inverse)) { + if((address1 == address2) && (command == inverse_command_inverse)) { decoder->message.command = command; decoder->message.address = address1; decoder->message.protocol = InfraredProtocolSamsung32; diff --git a/lib/infrared/encoder_decoder/sirc/infrared_encoder_sirc.c b/lib/infrared/encoder_decoder/sirc/infrared_encoder_sirc.c index a6918ceec3c..8ae9e371739 100644 --- a/lib/infrared/encoder_decoder/sirc/infrared_encoder_sirc.c +++ b/lib/infrared/encoder_decoder/sirc/infrared_encoder_sirc.c @@ -38,7 +38,7 @@ InfraredStatus infrared_encoder_sirc_encode_repeat( bool* level) { furi_assert(encoder); - furi_assert(encoder->timings_encoded == (1 + 2 + encoder->bits_to_encode * 2 - 1)); + furi_assert(encoder->timings_encoded == (1u + 2 + encoder->bits_to_encode * 2 - 1)); furi_assert(encoder->timings_sum < INFRARED_SIRC_REPEAT_PERIOD); *duration = INFRARED_SIRC_REPEAT_PERIOD - encoder->timings_sum; diff --git a/lib/infrared/worker/infrared_worker.c b/lib/infrared/worker/infrared_worker.c index 5711d2c0023..71126c86834 100644 --- a/lib/infrared/worker/infrared_worker.c +++ b/lib/infrared/worker/infrared_worker.c @@ -597,6 +597,7 @@ void infrared_worker_set_raw_signal( InfraredWorkerGetSignalResponse infrared_worker_tx_get_signal_steady_callback(void* context, InfraredWorker* instance) { + UNUSED(context); InfraredWorkerGetSignalResponse response = instance->tx.steady_signal_sent ? InfraredWorkerGetSignalResponseSame : InfraredWorkerGetSignalResponseNew; diff --git a/lib/lfs_config.h b/lib/lfs_config.h index a545551c552..59b3c486e33 100644 --- a/lib/lfs_config.h +++ b/lib/lfs_config.h @@ -4,6 +4,9 @@ #ifdef FURI_NDEBUG #define LFS_NO_ASSERT +#define LFS_ASSERT(x) +#else +#define LFS_ASSERT furi_assert #endif #define LFS_TAG "Lfs" @@ -16,7 +19,6 @@ #define LFS_ERROR(...) FURI_LOG_E(LFS_TAG, __VA_ARGS__); -#define LFS_ASSERT furi_assert // Because crc #undef LFS_CONFIG diff --git a/lib/libusb_stm32 b/lib/libusb_stm32 index fd58c2b0471..6e64179d64e 160000 --- a/lib/libusb_stm32 +++ b/lib/libusb_stm32 @@ -1 +1 @@ -Subproject commit fd58c2b04710554626ac69d9fb5fa1211d1bcaf0 +Subproject commit 6e64179d64e5582014a637a108d0870191f7818d diff --git a/lib/micro-ecc/asm_arm.inc b/lib/micro-ecc/asm_arm.inc index 688fdc75a8f..43844da6a56 100644 --- a/lib/micro-ecc/asm_arm.inc +++ b/lib/micro-ecc/asm_arm.inc @@ -97,6 +97,7 @@ uECC_VLI_API uECC_word_t uECC_vli_add(uECC_word_t *result, } #define asm_add 1 +#pragma GCC diagnostic ignored "-Wredundant-decls" uECC_VLI_API uECC_word_t uECC_vli_sub(uECC_word_t *result, const uECC_word_t *left, const uECC_word_t *right, diff --git a/lib/micro-ecc/curve-specific.inc b/lib/micro-ecc/curve-specific.inc index 0453b212cf0..f5d3da842c8 100644 --- a/lib/micro-ecc/curve-specific.inc +++ b/lib/micro-ecc/curve-specific.inc @@ -542,6 +542,7 @@ static void mod_sqrt_secp224r1_rp(uECC_word_t *d1, /* Compute a = sqrt(a) (mod curve_p). */ /* Routine 3.2.8 mp_mod_sqrt_224; from http://www.nsa.gov/ia/_files/nist-routines.pdf */ static void mod_sqrt_secp224r1(uECC_word_t *a, uECC_Curve curve) { + (void)curve; bitcount_t i; uECC_word_t e1[num_words_secp224r1]; uECC_word_t f1[num_words_secp224r1]; diff --git a/lib/nfc_protocols/mifare_classic.c b/lib/nfc_protocols/mifare_classic.c index c738accc972..ace37bff3c6 100644 --- a/lib/nfc_protocols/mifare_classic.c +++ b/lib/nfc_protocols/mifare_classic.c @@ -36,6 +36,7 @@ uint8_t mf_classic_get_total_sectors_num(MfClassicReader* reader) { } bool mf_classic_check_card_type(uint8_t ATQA0, uint8_t ATQA1, uint8_t SAK) { + UNUSED(ATQA1); if((ATQA0 == 0x44 || ATQA0 == 0x04) && (SAK == 0x08)) { return true; } else if((ATQA0 == 0x42 || ATQA0 == 0x02) && (SAK == 0x18)) { @@ -52,6 +53,7 @@ bool mf_classic_get_type( uint8_t ATQA1, uint8_t SAK, MfClassicReader* reader) { + UNUSED(ATQA1); furi_assert(uid); furi_assert(reader); memset(reader, 0, sizeof(MfClassicReader)); @@ -204,7 +206,6 @@ bool mf_classic_read_block( MfClassicBlock* block) { furi_assert(tx_rx); furi_assert(crypto); - furi_assert(block_num < MF_CLASSIC_TOTAL_BLOCKS_MAX); furi_assert(block); bool read_block_success = false; diff --git a/lib/nfc_protocols/mifare_desfire.c b/lib/nfc_protocols/mifare_desfire.c index 6a9c13b668d..4f02e839673 100644 --- a/lib/nfc_protocols/mifare_desfire.c +++ b/lib/nfc_protocols/mifare_desfire.c @@ -444,4 +444,4 @@ bool mf_df_parse_read_data_response(uint8_t* buf, uint16_t len, MifareDesfireFil out->contents = malloc(len); memcpy(out->contents, buf, len); return true; -} \ No newline at end of file +} diff --git a/lib/nfc_protocols/mifare_ultralight.h b/lib/nfc_protocols/mifare_ultralight.h index 1947f10a07c..858fc3ecaa9 100644 --- a/lib/nfc_protocols/mifare_ultralight.h +++ b/lib/nfc_protocols/mifare_ultralight.h @@ -123,4 +123,4 @@ bool mf_ul_prepare_emulation_response( uint8_t* buff_tx, uint16_t* buff_tx_len, uint32_t* data_type, - void* context); \ No newline at end of file + void* context); diff --git a/lib/nfc_protocols/nfc_util.c b/lib/nfc_protocols/nfc_util.c index 69c13ed4594..9de6f982b63 100644 --- a/lib/nfc_protocols/nfc_util.c +++ b/lib/nfc_protocols/nfc_util.c @@ -45,19 +45,3 @@ uint8_t nfc_util_even_parity32(uint32_t data) { uint8_t nfc_util_odd_parity8(uint8_t data) { return nfc_util_odd_byte_parity[data]; } - -void nfc_util_merge_data_and_parity( - uint8_t* data, - uint16_t data_len, - uint8_t* parity, - uint16_t parity_len, - uint8_t* res, - uint16_t* res_len); - -void nfc_util_split_data_and_parity( - uint8_t* data, - uint16_t data_len, - uint8_t* parity, - uint16_t parity_len, - uint8_t* res, - uint16_t* res_len); \ No newline at end of file diff --git a/lib/nfc_protocols/nfc_util.h b/lib/nfc_protocols/nfc_util.h index caeb20c904e..d530badc3d7 100644 --- a/lib/nfc_protocols/nfc_util.h +++ b/lib/nfc_protocols/nfc_util.h @@ -9,19 +9,3 @@ uint64_t nfc_util_bytes2num(uint8_t* src, uint8_t len); uint8_t nfc_util_even_parity32(uint32_t data); uint8_t nfc_util_odd_parity8(uint8_t data); - -void nfc_util_merge_data_and_parity( - uint8_t* data, - uint16_t data_len, - uint8_t* parity, - uint16_t parity_len, - uint8_t* res, - uint16_t* res_len); - -void nfc_util_split_data_and_parity( - uint8_t* data, - uint16_t data_len, - uint8_t* parity, - uint16_t parity_len, - uint8_t* res, - uint16_t* res_len); diff --git a/lib/nfc_protocols/nfca.c b/lib/nfc_protocols/nfca.c index fe001f88f87..81a6ddfccbe 100755 --- a/lib/nfc_protocols/nfca.c +++ b/lib/nfc_protocols/nfca.c @@ -52,4 +52,4 @@ bool nfca_emulation_handler( } return sleep; -} \ No newline at end of file +} diff --git a/lib/one_wire/ibutton/encoder/encoder_cyfral.h b/lib/one_wire/ibutton/encoder/encoder_cyfral.h index 1b0c3e12f72..4fc7be5ed8d 100644 --- a/lib/one_wire/ibutton/encoder/encoder_cyfral.h +++ b/lib/one_wire/ibutton/encoder/encoder_cyfral.h @@ -51,4 +51,4 @@ void encoder_cyfral_get_pulse(EncoderCyfral* cyfral, bool* polarity, uint32_t* l #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/one_wire/ibutton/encoder/encoder_metakom.h b/lib/one_wire/ibutton/encoder/encoder_metakom.h index 2812dc1298f..50ff11a243c 100644 --- a/lib/one_wire/ibutton/encoder/encoder_metakom.h +++ b/lib/one_wire/ibutton/encoder/encoder_metakom.h @@ -51,4 +51,4 @@ void encoder_metakom_get_pulse(EncoderMetakom* metakom, bool* polarity, uint32_t #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/one_wire/ibutton/ibutton_key.c b/lib/one_wire/ibutton/ibutton_key.c index c90d5f4a9eb..c6d4466f0a5 100644 --- a/lib/one_wire/ibutton/ibutton_key.c +++ b/lib/one_wire/ibutton/ibutton_key.c @@ -118,4 +118,4 @@ bool ibutton_key_dallas_crc_is_valid(iButtonKey* key) { bool ibutton_key_dallas_is_1990_key(iButtonKey* key) { return (key->data[0] == 0x01); -} \ No newline at end of file +} diff --git a/lib/one_wire/ibutton/ibutton_key.h b/lib/one_wire/ibutton/ibutton_key.h index f82861036ad..8d6732bcb7b 100644 --- a/lib/one_wire/ibutton/ibutton_key.h +++ b/lib/one_wire/ibutton/ibutton_key.h @@ -142,4 +142,4 @@ bool ibutton_key_dallas_is_1990_key(iButtonKey* key); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/one_wire/ibutton/ibutton_key_command.h b/lib/one_wire/ibutton/ibutton_key_command.h index 3978ea51ae2..88049d0643d 100644 --- a/lib/one_wire/ibutton/ibutton_key_command.h +++ b/lib/one_wire/ibutton/ibutton_key_command.h @@ -25,4 +25,4 @@ #define TM01_CMD_SWITCH_TO_CYFRAL 0xCA #define TM01_CMD_SWITCH_TO_METAKOM 0xCB -#define DS1990_CMD_READ_ROM 0x33 \ No newline at end of file +#define DS1990_CMD_READ_ROM 0x33 diff --git a/lib/one_wire/ibutton/ibutton_worker.h b/lib/one_wire/ibutton/ibutton_worker.h index 3350e05f723..5c8b1fc399b 100644 --- a/lib/one_wire/ibutton/ibutton_worker.h +++ b/lib/one_wire/ibutton/ibutton_worker.h @@ -110,4 +110,4 @@ void ibutton_worker_stop(iButtonWorker* worker); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/one_wire/ibutton/ibutton_worker_i.h b/lib/one_wire/ibutton/ibutton_worker_i.h index 14e5d39d7d2..ae2d4dc38fc 100644 --- a/lib/one_wire/ibutton/ibutton_worker_i.h +++ b/lib/one_wire/ibutton/ibutton_worker_i.h @@ -27,9 +27,9 @@ typedef enum { typedef struct { const uint32_t quant; - const void (*start)(iButtonWorker* worker); - const void (*tick)(iButtonWorker* worker); - const void (*stop)(iButtonWorker* worker); + void (*const start) (iButtonWorker* worker); + void (*const tick) (iButtonWorker* worker); + void (*const stop) (iButtonWorker* worker); } iButtonWorkerModeType; typedef enum { @@ -76,4 +76,4 @@ void ibutton_worker_switch_mode(iButtonWorker* worker, iButtonWorkerMode mode); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/one_wire/ibutton/ibutton_worker_modes.c b/lib/one_wire/ibutton/ibutton_worker_modes.c index 7ee3a005c16..ff5ba35129d 100644 --- a/lib/one_wire/ibutton/ibutton_worker_modes.c +++ b/lib/one_wire/ibutton/ibutton_worker_modes.c @@ -49,12 +49,15 @@ const iButtonWorkerModeType ibutton_worker_modes[] = { /*********************** IDLE ***********************/ void ibutton_worker_mode_idle_start(iButtonWorker* worker) { + UNUSED(worker); } void ibutton_worker_mode_idle_tick(iButtonWorker* worker) { + UNUSED(worker); } void ibutton_worker_mode_idle_stop(iButtonWorker* worker) { + UNUSED(worker); } /*********************** READ ***********************/ @@ -151,6 +154,7 @@ bool ibutton_worker_read_dallas(iButtonWorker* worker) { } void ibutton_worker_mode_read_start(iButtonWorker* worker) { + UNUSED(worker); furi_hal_power_enable_otg(); } @@ -172,6 +176,7 @@ void ibutton_worker_mode_read_tick(iButtonWorker* worker) { } void ibutton_worker_mode_read_stop(iButtonWorker* worker) { + UNUSED(worker); furi_hal_power_disable_otg(); } @@ -251,6 +256,7 @@ void ibutton_worker_emulate_timer_start(iButtonWorker* worker) { } void ibutton_worker_emulate_timer_stop(iButtonWorker* worker) { + UNUSED(worker); furi_hal_ibutton_emulate_stop(); } @@ -272,6 +278,7 @@ void ibutton_worker_mode_emulate_start(iButtonWorker* worker) { } void ibutton_worker_mode_emulate_tick(iButtonWorker* worker) { + UNUSED(worker); } void ibutton_worker_mode_emulate_stop(iButtonWorker* worker) { @@ -327,4 +334,4 @@ void ibutton_worker_mode_write_tick(iButtonWorker* worker) { void ibutton_worker_mode_write_stop(iButtonWorker* worker) { furi_hal_power_disable_otg(); onewire_host_stop(worker->host); -} \ No newline at end of file +} diff --git a/lib/one_wire/ibutton/ibutton_writer.h b/lib/one_wire/ibutton/ibutton_writer.h index 8e81cfd1f9e..6dbdbb27a10 100644 --- a/lib/one_wire/ibutton/ibutton_writer.h +++ b/lib/one_wire/ibutton/ibutton_writer.h @@ -57,4 +57,4 @@ void ibutton_writer_stop(iButtonWriter* writer); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/one_wire/ibutton/pulse_protocols/protocol_cyfral.h b/lib/one_wire/ibutton/pulse_protocols/protocol_cyfral.h index 4a7c00e4291..10305da12f5 100644 --- a/lib/one_wire/ibutton/pulse_protocols/protocol_cyfral.h +++ b/lib/one_wire/ibutton/pulse_protocols/protocol_cyfral.h @@ -35,4 +35,4 @@ PulseProtocol* protocol_cyfral_get_protocol(ProtocolCyfral* cyfral); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/one_wire/ibutton/pulse_protocols/protocol_metakom.h b/lib/one_wire/ibutton/pulse_protocols/protocol_metakom.h index fbafc235296..fdc45769538 100644 --- a/lib/one_wire/ibutton/pulse_protocols/protocol_metakom.h +++ b/lib/one_wire/ibutton/pulse_protocols/protocol_metakom.h @@ -35,4 +35,4 @@ PulseProtocol* protocol_metakom_get_protocol(ProtocolMetakom* metakom); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/one_wire/maxim_crc.c b/lib/one_wire/maxim_crc.c index bd89d3ad334..a5d099b10fe 100644 --- a/lib/one_wire/maxim_crc.c +++ b/lib/one_wire/maxim_crc.c @@ -13,4 +13,4 @@ uint8_t maxim_crc8(const uint8_t* data, const uint8_t data_size, const uint8_t c } } return crc; -} \ No newline at end of file +} diff --git a/lib/one_wire/maxim_crc.h b/lib/one_wire/maxim_crc.h index 1b7e8498769..4bab5714c83 100644 --- a/lib/one_wire/maxim_crc.h +++ b/lib/one_wire/maxim_crc.h @@ -11,4 +11,4 @@ uint8_t maxim_crc8(const uint8_t* data, const uint8_t data_size, const uint8_t c #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/one_wire/one_wire_device.h b/lib/one_wire/one_wire_device.h index 4ff16790abf..fc687c7badd 100644 --- a/lib/one_wire/one_wire_device.h +++ b/lib/one_wire/one_wire_device.h @@ -71,4 +71,4 @@ uint8_t* onewire_device_get_id_p(OneWireDevice* device); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/one_wire/one_wire_host.c b/lib/one_wire/one_wire_host.c index fd8deaf8e2a..1bb0a1ccbbf 100644 --- a/lib/one_wire/one_wire_host.c +++ b/lib/one_wire/one_wire_host.c @@ -23,6 +23,7 @@ void onewire_host_free(OneWireHost* host) { } bool onewire_host_reset(OneWireHost* host) { + UNUSED(host); uint8_t r; uint8_t retries = 125; @@ -52,6 +53,7 @@ bool onewire_host_reset(OneWireHost* host) { } bool onewire_host_read_bit(OneWireHost* host) { + UNUSED(host); bool result; // drive low @@ -88,6 +90,7 @@ void onewire_host_read_bytes(OneWireHost* host, uint8_t* buffer, uint16_t count) } void onewire_host_write_bit(OneWireHost* host, bool value) { + UNUSED(host); if(value) { // drive low furi_hal_ibutton_pin_low(); @@ -120,10 +123,12 @@ void onewire_host_skip(OneWireHost* host) { } void onewire_host_start(OneWireHost* host) { + UNUSED(host); furi_hal_ibutton_start_drive(); } void onewire_host_stop(OneWireHost* host) { + UNUSED(host); furi_hal_ibutton_stop(); } diff --git a/lib/one_wire/one_wire_host.h b/lib/one_wire/one_wire_host.h index 21530640569..5b55ee8dd80 100644 --- a/lib/one_wire/one_wire_host.h +++ b/lib/one_wire/one_wire_host.h @@ -118,4 +118,4 @@ uint8_t onewire_host_search(OneWireHost* host, uint8_t* newAddr, OneWireHostSear #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/one_wire/one_wire_slave.c b/lib/one_wire/one_wire_slave.c index e8cc5ac12aa..3c9a796d4a3 100644 --- a/lib/one_wire/one_wire_slave.c +++ b/lib/one_wire/one_wire_slave.c @@ -37,6 +37,7 @@ struct OneWireSlave { /*********************** PRIVATE ***********************/ uint32_t onewire_slave_wait_while_gpio_is(OneWireSlave* bus, uint32_t time, const bool pin_value) { + UNUSED(bus); uint32_t start = DWT->CYCCNT; uint32_t time_ticks = time * furi_hal_delay_instructions_per_microsecond(); uint32_t time_captured; @@ -253,6 +254,7 @@ void onewire_slave_start(OneWireSlave* bus) { } void onewire_slave_stop(OneWireSlave* bus) { + UNUSED(bus); furi_hal_ibutton_stop(); furi_hal_ibutton_remove_interrupt(); } diff --git a/lib/one_wire/pulse_protocols/pulse_decoder.h b/lib/one_wire/pulse_protocols/pulse_decoder.h index 4e9f9d228b9..dbaef52b5e4 100644 --- a/lib/one_wire/pulse_protocols/pulse_decoder.h +++ b/lib/one_wire/pulse_protocols/pulse_decoder.h @@ -67,4 +67,4 @@ void pulse_decoder_get_data(PulseDecoder* decoder, int32_t index, uint8_t* data, #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/one_wire/pulse_protocols/pulse_glue.h b/lib/one_wire/pulse_protocols/pulse_glue.h index aa58f239460..4954e2719b2 100644 --- a/lib/one_wire/pulse_protocols/pulse_glue.h +++ b/lib/one_wire/pulse_protocols/pulse_glue.h @@ -23,4 +23,4 @@ void pulse_glue_pop(PulseGlue* pulse_glue, uint32_t* length, uint32_t* period); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/one_wire/pulse_protocols/pulse_protocol.c b/lib/one_wire/pulse_protocols/pulse_protocol.c index ac01ea928de..76feba11358 100644 --- a/lib/one_wire/pulse_protocols/pulse_protocol.c +++ b/lib/one_wire/pulse_protocols/pulse_protocol.c @@ -64,4 +64,4 @@ void pulse_protocol_get_data(PulseProtocol* protocol, uint8_t* data, size_t leng if(protocol->get_data_cb != NULL) { protocol->get_data_cb(protocol->context, data, length); } -} \ No newline at end of file +} diff --git a/lib/one_wire/pulse_protocols/pulse_protocol.h b/lib/one_wire/pulse_protocols/pulse_protocol.h index 01bc14a1c55..bfce0e76d8b 100644 --- a/lib/one_wire/pulse_protocols/pulse_protocol.h +++ b/lib/one_wire/pulse_protocols/pulse_protocol.h @@ -119,4 +119,4 @@ void pulse_protocol_reset(PulseProtocol* protocol); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/qrcode/qrcode.c b/lib/qrcode/qrcode.c index cbbf4a4747b..fb5bd8a6e78 100644 --- a/lib/qrcode/qrcode.c +++ b/lib/qrcode/qrcode.c @@ -972,4 +972,4 @@ bool qrcode_getModule(QRCode* qrcode, uint8_t x, uint8_t y) { uint32_t offset = y * qrcode->size + x; return (qrcode->modules[offset >> 3] & (1 << (7 - (offset & 0x07)))) != 0; -} \ No newline at end of file +} diff --git a/lib/qrcode/qrcode.h b/lib/qrcode/qrcode.h index bc3ccb598e7..6d637ba04d6 100644 --- a/lib/qrcode/qrcode.h +++ b/lib/qrcode/qrcode.h @@ -96,4 +96,4 @@ bool qrcode_getModule(QRCode* qrcode, uint8_t x, uint8_t y); } #endif /* __cplusplus */ -#endif /* __QRCODE_H_ */ \ No newline at end of file +#endif /* __QRCODE_H_ */ diff --git a/lib/subghz/protocols/came.c b/lib/subghz/protocols/came.c index 467e315495f..8817b380392 100644 --- a/lib/subghz/protocols/came.c +++ b/lib/subghz/protocols/came.c @@ -76,6 +76,7 @@ const SubGhzProtocol subghz_protocol_came = { }; void* subghz_protocol_encoder_came_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolEncoderCame* instance = malloc(sizeof(SubGhzProtocolEncoderCame)); instance->base.protocol = &subghz_protocol_came; @@ -182,6 +183,7 @@ LevelDuration subghz_protocol_encoder_came_yield(void* context) { } void* subghz_protocol_decoder_came_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderCame* instance = malloc(sizeof(SubGhzProtocolDecoderCame)); instance->base.protocol = &subghz_protocol_came; instance->generic.protocol_name = instance->base.protocol->name; diff --git a/lib/subghz/protocols/came_atomo.c b/lib/subghz/protocols/came_atomo.c index 67d5398fa04..51e7fe0b34e 100644 --- a/lib/subghz/protocols/came_atomo.c +++ b/lib/subghz/protocols/came_atomo.c @@ -136,7 +136,7 @@ void subghz_protocol_decoder_came_atomo_feed(void* context, bool level, uint32_t subghz_protocol_came_atomo_const.te_delta) { event = ManchesterEventLongLow; } else if( - duration >= (subghz_protocol_came_atomo_const.te_long * 2 + + duration >= ((uint32_t)subghz_protocol_came_atomo_const.te_long * 2 + subghz_protocol_came_atomo_const.te_delta)) { if(instance->decoder.decode_count_bit == subghz_protocol_came_atomo_const.min_count_bit_for_found) { diff --git a/lib/subghz/protocols/came_twee.c b/lib/subghz/protocols/came_twee.c index fe5f7877110..4ca1162322b 100644 --- a/lib/subghz/protocols/came_twee.c +++ b/lib/subghz/protocols/came_twee.c @@ -103,6 +103,7 @@ const SubGhzProtocol subghz_protocol_came_twee = { }; void* subghz_protocol_encoder_came_twee_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolEncoderCameTwee* instance = malloc(sizeof(SubGhzProtocolEncoderCameTwee)); instance->base.protocol = &subghz_protocol_came_twee; @@ -289,6 +290,7 @@ LevelDuration subghz_protocol_encoder_came_twee_yield(void* context) { } void* subghz_protocol_decoder_came_twee_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderCameTwee* instance = malloc(sizeof(SubGhzProtocolDecoderCameTwee)); instance->base.protocol = &subghz_protocol_came_twee; instance->generic.protocol_name = instance->base.protocol->name; @@ -351,7 +353,7 @@ void subghz_protocol_decoder_came_twee_feed(void* context, bool level, uint32_t subghz_protocol_came_twee_const.te_delta) { event = ManchesterEventLongLow; } else if( - duration >= (subghz_protocol_came_twee_const.te_long * 2 + + duration >= ((uint32_t)subghz_protocol_came_twee_const.te_long * 2 + subghz_protocol_came_twee_const.te_delta)) { if(instance->decoder.decode_count_bit >= subghz_protocol_came_twee_const.min_count_bit_for_found) { diff --git a/lib/subghz/protocols/faac_slh.c b/lib/subghz/protocols/faac_slh.c index d5006ae6675..d5761831c7b 100644 --- a/lib/subghz/protocols/faac_slh.c +++ b/lib/subghz/protocols/faac_slh.c @@ -69,6 +69,7 @@ const SubGhzProtocol subghz_protocol_faac_slh = { }; void* subghz_protocol_decoder_faac_slh_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderFaacSLH* instance = malloc(sizeof(SubGhzProtocolDecoderFaacSLH)); instance->base.protocol = &subghz_protocol_faac_slh; instance->generic.protocol_name = instance->base.protocol->name; @@ -111,7 +112,7 @@ void subghz_protocol_decoder_faac_slh_feed(void* context, bool level, uint32_t d break; case FaacSLHDecoderStepSaveDuration: if(level) { - if(duration >= (subghz_protocol_faac_slh_const.te_short * 3 + + if(duration >= ((uint32_t)subghz_protocol_faac_slh_const.te_short * 3 + subghz_protocol_faac_slh_const.te_delta)) { instance->decoder.parser_step = FaacSLHDecoderStepFoundPreambula; if(instance->decoder.decode_count_bit >= diff --git a/lib/subghz/protocols/firefly.c b/lib/subghz/protocols/firefly.c index 3a339e0a9a7..21047a30402 100644 --- a/lib/subghz/protocols/firefly.c +++ b/lib/subghz/protocols/firefly.c @@ -75,6 +75,7 @@ const SubGhzProtocol subghz_protocol_firefly = { }; void* subghz_protocol_encoder_firefly_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolEncoderFirefly* instance = malloc(sizeof(SubGhzProtocolEncoderFirefly)); instance->base.protocol = &subghz_protocol_firefly; @@ -193,6 +194,7 @@ LevelDuration subghz_protocol_encoder_firefly_yield(void* context) { } void* subghz_protocol_decoder_firefly_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderFirefly* instance = malloc(sizeof(SubGhzProtocolDecoderFirefly)); instance->base.protocol = &subghz_protocol_firefly; instance->generic.protocol_name = instance->base.protocol->name; diff --git a/lib/subghz/protocols/gate_tx.c b/lib/subghz/protocols/gate_tx.c index dd6548a2e54..5f124c376c0 100644 --- a/lib/subghz/protocols/gate_tx.c +++ b/lib/subghz/protocols/gate_tx.c @@ -69,6 +69,7 @@ const SubGhzProtocol subghz_protocol_gate_tx = { }; void* subghz_protocol_encoder_gate_tx_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolEncoderGateTx* instance = malloc(sizeof(SubGhzProtocolEncoderGateTx)); instance->base.protocol = &subghz_protocol_gate_tx; @@ -175,6 +176,7 @@ LevelDuration subghz_protocol_encoder_gate_tx_yield(void* context) { } void* subghz_protocol_decoder_gate_tx_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderGateTx* instance = malloc(sizeof(SubGhzProtocolDecoderGateTx)); instance->base.protocol = &subghz_protocol_gate_tx; instance->generic.protocol_name = instance->base.protocol->name; @@ -218,7 +220,7 @@ void subghz_protocol_decoder_gate_tx_feed(void* context, bool level, uint32_t du break; case GateTXDecoderStepSaveDuration: if(!level) { - if(duration >= (subghz_protocol_gate_tx_const.te_short * 10 + + if(duration >= ((uint32_t)subghz_protocol_gate_tx_const.te_short * 10 + subghz_protocol_gate_tx_const.te_delta)) { instance->decoder.parser_step = GateTXDecoderStepFoundStartBit; if(instance->decoder.decode_count_bit >= diff --git a/lib/subghz/protocols/hormann.c b/lib/subghz/protocols/hormann.c index 7a3fd23392e..20ff50fc0cd 100644 --- a/lib/subghz/protocols/hormann.c +++ b/lib/subghz/protocols/hormann.c @@ -72,6 +72,7 @@ const SubGhzProtocol subghz_protocol_hormann = { }; void* subghz_protocol_encoder_hormann_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolEncoderHormann* instance = malloc(sizeof(SubGhzProtocolEncoderHormann)); instance->base.protocol = &subghz_protocol_hormann; @@ -191,6 +192,7 @@ LevelDuration subghz_protocol_encoder_hormann_yield(void* context) { } void* subghz_protocol_decoder_hormann_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderHormann* instance = malloc(sizeof(SubGhzProtocolDecoderHormann)); instance->base.protocol = &subghz_protocol_hormann; instance->generic.protocol_name = instance->base.protocol->name; diff --git a/lib/subghz/protocols/ido.c b/lib/subghz/protocols/ido.c index d2962435ade..93693b68f71 100644 --- a/lib/subghz/protocols/ido.c +++ b/lib/subghz/protocols/ido.c @@ -68,6 +68,7 @@ const SubGhzProtocol subghz_protocol_ido = { }; void* subghz_protocol_decoder_ido_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderIDo* instance = malloc(sizeof(SubGhzProtocolDecoderIDo)); instance->base.protocol = &subghz_protocol_ido; instance->generic.protocol_name = instance->base.protocol->name; @@ -111,8 +112,8 @@ void subghz_protocol_decoder_ido_feed(void* context, bool level, uint32_t durati break; case IDoDecoderStepSaveDuration: if(level) { - if(duration >= - (subghz_protocol_ido_const.te_short * 5 + subghz_protocol_ido_const.te_delta)) { + if(duration >= ((uint32_t)subghz_protocol_ido_const.te_short * 5 + + subghz_protocol_ido_const.te_delta)) { instance->decoder.parser_step = IDoDecoderStepFoundPreambula; if(instance->decoder.decode_count_bit >= subghz_protocol_ido_const.min_count_bit_for_found) { diff --git a/lib/subghz/protocols/ido.h b/lib/subghz/protocols/ido.h index c53a1593794..266529e1fba 100644 --- a/lib/subghz/protocols/ido.h +++ b/lib/subghz/protocols/ido.h @@ -72,4 +72,4 @@ bool subghz_protocol_decoder_ido_deserialize(void* context, FlipperFormat* flipp * @param context Pointer to a SubGhzProtocolDecoderIDo instance * @param output Resulting text */ -void subghz_protocol_decoder_ido_get_string(void* context, string_t output); \ No newline at end of file +void subghz_protocol_decoder_ido_get_string(void* context, string_t output); diff --git a/lib/subghz/protocols/keeloq.c b/lib/subghz/protocols/keeloq.c index 9c6673e82a3..566ae576489 100644 --- a/lib/subghz/protocols/keeloq.c +++ b/lib/subghz/protocols/keeloq.c @@ -384,7 +384,7 @@ void subghz_protocol_decoder_keeloq_feed(void* context, bool level, uint32_t dur break; case KeeloqDecoderStepCheckDuration: if(!level) { - if(duration >= (subghz_protocol_keeloq_const.te_short * 2 + + if(duration >= ((uint32_t)subghz_protocol_keeloq_const.te_short * 2 + subghz_protocol_keeloq_const.te_delta)) { // Found end TX instance->decoder.parser_step = KeeloqDecoderStepReset; diff --git a/lib/subghz/protocols/keeloq_common.c b/lib/subghz/protocols/keeloq_common.c index 9dfc0934845..7e864a325bd 100644 --- a/lib/subghz/protocols/keeloq_common.c +++ b/lib/subghz/protocols/keeloq_common.c @@ -81,4 +81,4 @@ inline uint64_t subghz_protocol_keeloq_common_magic_xor_type1_learning(uint32_t data, uint64_t xor) { data &= 0x0FFFFFFF; return (((uint64_t)data << 32) | data) ^ xor; -} \ No newline at end of file +} diff --git a/lib/subghz/protocols/kia.c b/lib/subghz/protocols/kia.c index f623a61d3e8..5a89934bd6d 100644 --- a/lib/subghz/protocols/kia.c +++ b/lib/subghz/protocols/kia.c @@ -70,6 +70,7 @@ const SubGhzProtocol subghz_protocol_kia = { }; void* subghz_protocol_decoder_kia_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderKIA* instance = malloc(sizeof(SubGhzProtocolDecoderKIA)); instance->base.protocol = &subghz_protocol_kia; instance->generic.protocol_name = instance->base.protocol->name; @@ -141,7 +142,7 @@ void subghz_protocol_decoder_kia_feed(void* context, bool level, uint32_t durati case KIADecoderStepSaveDuration: if(level) { if(duration >= - (subghz_protocol_kia_const.te_long + subghz_protocol_kia_const.te_delta * 2)) { + (uint32_t)(subghz_protocol_kia_const.te_long + subghz_protocol_kia_const.te_delta * 2)) { //Found stop bit instance->decoder.parser_step = KIADecoderStepReset; if(instance->decoder.decode_count_bit >= diff --git a/lib/subghz/protocols/nero_radio.c b/lib/subghz/protocols/nero_radio.c index d25c377a51e..6797843fd69 100644 --- a/lib/subghz/protocols/nero_radio.c +++ b/lib/subghz/protocols/nero_radio.c @@ -71,6 +71,7 @@ const SubGhzProtocol subghz_protocol_nero_radio = { }; void* subghz_protocol_encoder_nero_radio_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolEncoderNeroRadio* instance = malloc(sizeof(SubGhzProtocolEncoderNeroRadio)); instance->base.protocol = &subghz_protocol_nero_radio; @@ -200,6 +201,7 @@ LevelDuration subghz_protocol_encoder_nero_radio_yield(void* context) { } void* subghz_protocol_decoder_nero_radio_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderNeroRadio* instance = malloc(sizeof(SubGhzProtocolDecoderNeroRadio)); instance->base.protocol = &subghz_protocol_nero_radio; instance->generic.protocol_name = instance->base.protocol->name; @@ -278,7 +280,7 @@ void subghz_protocol_decoder_nero_radio_feed(void* context, bool level, uint32_t break; case NeroRadioDecoderStepCheckDuration: if(!level) { - if(duration >= (subghz_protocol_nero_radio_const.te_short * 10 + + if(duration >= ((uint32_t)subghz_protocol_nero_radio_const.te_short * 10 + subghz_protocol_nero_radio_const.te_delta * 2)) { //Found stop bit if(DURATION_DIFF( diff --git a/lib/subghz/protocols/nero_sketch.c b/lib/subghz/protocols/nero_sketch.c index 474b742ad5a..1ba0cf86032 100644 --- a/lib/subghz/protocols/nero_sketch.c +++ b/lib/subghz/protocols/nero_sketch.c @@ -70,6 +70,7 @@ const SubGhzProtocol subghz_protocol_nero_sketch = { }; void* subghz_protocol_encoder_nero_sketch_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolEncoderNeroSketch* instance = malloc(sizeof(SubGhzProtocolEncoderNeroSketch)); instance->base.protocol = &subghz_protocol_nero_sketch; @@ -194,6 +195,7 @@ LevelDuration subghz_protocol_encoder_nero_sketch_yield(void* context) { } void* subghz_protocol_decoder_nero_sketch_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderNeroSketch* instance = malloc(sizeof(SubGhzProtocolDecoderNeroSketch)); instance->base.protocol = &subghz_protocol_nero_sketch; instance->generic.protocol_name = instance->base.protocol->name; diff --git a/lib/subghz/protocols/nice_flo.c b/lib/subghz/protocols/nice_flo.c index 6f94e8fdfc5..d2844dcd623 100644 --- a/lib/subghz/protocols/nice_flo.c +++ b/lib/subghz/protocols/nice_flo.c @@ -69,6 +69,7 @@ const SubGhzProtocol subghz_protocol_nice_flo = { }; void* subghz_protocol_encoder_nice_flo_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolEncoderNiceFlo* instance = malloc(sizeof(SubGhzProtocolEncoderNiceFlo)); instance->base.protocol = &subghz_protocol_nice_flo; @@ -175,6 +176,7 @@ LevelDuration subghz_protocol_encoder_nice_flo_yield(void* context) { } void* subghz_protocol_decoder_nice_flo_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderNiceFlo* instance = malloc(sizeof(SubGhzProtocolDecoderNiceFlo)); instance->base.protocol = &subghz_protocol_nice_flo; instance->generic.protocol_name = instance->base.protocol->name; diff --git a/lib/subghz/protocols/nice_flo.h b/lib/subghz/protocols/nice_flo.h index ca5cfe3f65f..430b111df19 100644 --- a/lib/subghz/protocols/nice_flo.h +++ b/lib/subghz/protocols/nice_flo.h @@ -106,4 +106,4 @@ bool subghz_protocol_decoder_nice_flo_deserialize(void* context, FlipperFormat* * @param context Pointer to a SubGhzProtocolDecoderNiceFlo instance * @param output Resulting text */ -void subghz_protocol_decoder_nice_flo_get_string(void* context, string_t output); \ No newline at end of file +void subghz_protocol_decoder_nice_flo_get_string(void* context, string_t output); diff --git a/lib/subghz/protocols/princeton.c b/lib/subghz/protocols/princeton.c index 42f035e6d93..7579a3cac09 100644 --- a/lib/subghz/protocols/princeton.c +++ b/lib/subghz/protocols/princeton.c @@ -80,6 +80,7 @@ const SubGhzProtocol subghz_protocol_princeton = { }; void* subghz_protocol_encoder_princeton_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolEncoderPrinceton* instance = malloc(sizeof(SubGhzProtocolEncoderPrinceton)); instance->base.protocol = &subghz_protocol_princeton; @@ -194,6 +195,7 @@ LevelDuration subghz_protocol_encoder_princeton_yield(void* context) { } void* subghz_protocol_decoder_princeton_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderPrinceton* instance = malloc(sizeof(SubGhzProtocolDecoderPrinceton)); instance->base.protocol = &subghz_protocol_princeton; instance->generic.protocol_name = instance->base.protocol->name; @@ -238,7 +240,7 @@ void subghz_protocol_decoder_princeton_feed(void* context, bool level, uint32_t break; case PrincetonDecoderStepCheckDuration: if(!level) { - if(duration >= (subghz_protocol_princeton_const.te_short * 10 + + if(duration >= ((uint32_t)subghz_protocol_princeton_const.te_short * 10 + subghz_protocol_princeton_const.te_delta)) { instance->decoder.parser_step = PrincetonDecoderStepSaveDuration; if(instance->decoder.decode_count_bit == diff --git a/lib/subghz/protocols/princeton_for_testing.c b/lib/subghz/protocols/princeton_for_testing.c index bdf5f4292d8..5c3f7151c5e 100644 --- a/lib/subghz/protocols/princeton_for_testing.c +++ b/lib/subghz/protocols/princeton_for_testing.c @@ -249,7 +249,7 @@ void subghz_decoder_princeton_for_testing_parse( break; case PrincetonDecoderStepCheckDuration: if(!level) { - if(duration >= (instance->te_short * 10 + instance->te_delta)) { + if(duration >= ((uint32_t)instance->te_short * 10 + instance->te_delta)) { instance->parser_step = PrincetonDecoderStepSaveDuration; if(instance->code_count_bit == instance->code_min_count_bit_for_found) { instance->te /= (instance->code_count_bit * 4 + 1); diff --git a/lib/subghz/protocols/raw.c b/lib/subghz/protocols/raw.c index 111f45366b8..516aa633842 100644 --- a/lib/subghz/protocols/raw.c +++ b/lib/subghz/protocols/raw.c @@ -192,6 +192,7 @@ size_t subghz_protocol_raw_get_sample_write(SubGhzProtocolDecoderRAW* instance) } void* subghz_protocol_decoder_raw_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderRAW* instance = malloc(sizeof(SubGhzProtocolDecoderRAW)); instance->base.protocol = &subghz_protocol_raw; instance->upload_raw = NULL; @@ -243,6 +244,7 @@ void subghz_protocol_decoder_raw_get_string(void* context, string_t output) { } void* subghz_protocol_encoder_raw_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolEncoderRAW* instance = malloc(sizeof(SubGhzProtocolEncoderRAW)); instance->base.protocol = &subghz_protocol_raw; diff --git a/lib/subghz/protocols/scher_khan.c b/lib/subghz/protocols/scher_khan.c index c352b4ae686..a9a7c040cd7 100644 --- a/lib/subghz/protocols/scher_khan.c +++ b/lib/subghz/protocols/scher_khan.c @@ -76,6 +76,7 @@ const SubGhzProtocol subghz_protocol_scher_khan = { }; void* subghz_protocol_decoder_scher_khan_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderScherKhan* instance = malloc(sizeof(SubGhzProtocolDecoderScherKhan)); instance->base.protocol = &subghz_protocol_scher_khan; instance->generic.protocol_name = instance->base.protocol->name; @@ -150,7 +151,7 @@ void subghz_protocol_decoder_scher_khan_feed(void* context, bool level, uint32_t break; case ScherKhanDecoderStepSaveDuration: if(level) { - if(duration >= (subghz_protocol_scher_khan_const.te_long + + if(duration >= (uint32_t)(subghz_protocol_scher_khan_const.te_long + subghz_protocol_scher_khan_const.te_delta * 2)) { //Found stop bit instance->decoder.parser_step = ScherKhanDecoderStepReset; diff --git a/lib/subghz/protocols/secplus_v1.c b/lib/subghz/protocols/secplus_v1.c index 1ad605b2f6f..ff43e2a4c16 100644 --- a/lib/subghz/protocols/secplus_v1.c +++ b/lib/subghz/protocols/secplus_v1.c @@ -89,6 +89,7 @@ const SubGhzProtocol subghz_protocol_secplus_v1 = { }; void* subghz_protocol_decoder_secplus_v1_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderSecPlus_v1* instance = malloc(sizeof(SubGhzProtocolDecoderSecPlus_v1)); instance->base.protocol = &subghz_protocol_secplus_v1; instance->generic.protocol_name = instance->base.protocol->name; @@ -321,7 +322,7 @@ void subghz_protocol_decoder_secplus_v1_get_string(void* context, string_t outpu // pin = (fixed // 3**10) % (3**9) 3^10=59049 3^9=19683 pin = (fixed / 59049) % 19683; - if(0 <= pin && pin <= 9999) { + if(pin <= 9999) { string_cat_printf(output, " pin:%d", pin); } else if(10000 <= pin && pin <= 11029) { string_cat_printf(output, " pin:enter"); diff --git a/lib/subghz/protocols/secplus_v2.c b/lib/subghz/protocols/secplus_v2.c index 4ad1ea9ef61..936eb0a60e6 100644 --- a/lib/subghz/protocols/secplus_v2.c +++ b/lib/subghz/protocols/secplus_v2.c @@ -81,6 +81,7 @@ const SubGhzProtocol subghz_protocol_secplus_v2 = { }; void* subghz_protocol_decoder_secplus_v2_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderSecPlus_v2* instance = malloc(sizeof(SubGhzProtocolDecoderSecPlus_v2)); instance->base.protocol = &subghz_protocol_secplus_v2; instance->generic.protocol_name = instance->base.protocol->name; @@ -154,7 +155,7 @@ void subghz_protocol_decoder_secplus_v2_feed(void* context, bool level, uint32_t subghz_protocol_secplus_v2_const.te_delta) { event = ManchesterEventLongLow; } else if( - duration >= (subghz_protocol_secplus_v2_const.te_long * 2 + + duration >= (uint32_t)(subghz_protocol_secplus_v2_const.te_long * 2 + subghz_protocol_secplus_v2_const.te_delta)) { if(instance->decoder.decode_count_bit >= subghz_protocol_secplus_v2_const.min_count_bit_for_found) { diff --git a/lib/subghz/protocols/somfy_keytis.c b/lib/subghz/protocols/somfy_keytis.c index 9f58d7340b0..764e81478a3 100644 --- a/lib/subghz/protocols/somfy_keytis.c +++ b/lib/subghz/protocols/somfy_keytis.c @@ -75,6 +75,7 @@ const SubGhzProtocol subghz_protocol_somfy_keytis = { }; void* subghz_protocol_decoder_somfy_keytis_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderSomfyKeytis* instance = malloc(sizeof(SubGhzProtocolDecoderSomfyKeytis)); instance->base.protocol = &subghz_protocol_somfy_keytis; instance->generic.protocol_name = instance->base.protocol->name; diff --git a/lib/subghz/protocols/somfy_telis.c b/lib/subghz/protocols/somfy_telis.c index 4f1212bc990..63407427388 100644 --- a/lib/subghz/protocols/somfy_telis.c +++ b/lib/subghz/protocols/somfy_telis.c @@ -74,6 +74,7 @@ const SubGhzProtocol subghz_protocol_somfy_telis = { }; void* subghz_protocol_decoder_somfy_telis_alloc(SubGhzEnvironment* environment) { + UNUSED(environment); SubGhzProtocolDecoderSomfyTelis* instance = malloc(sizeof(SubGhzProtocolDecoderSomfyTelis)); instance->base.protocol = &subghz_protocol_somfy_telis; instance->generic.protocol_name = instance->base.protocol->name; diff --git a/lib/subghz/subghz_keystore.c b/lib/subghz/subghz_keystore.c index 1acb6ba5416..d3903bc511d 100644 --- a/lib/subghz/subghz_keystore.c +++ b/lib/subghz/subghz_keystore.c @@ -303,7 +303,7 @@ bool subghz_keystore_save(SubGhzKeystore* instance, const char* file_name, uint8 } // HEX Encode encrypted line const char xx[] = "0123456789ABCDEF"; - for(size_t i = 0; i < len; i++) { + for(int i = 0; i < len; i++) { size_t cursor = len - i - 1; size_t hex_cursor = len * 2 - i * 2 - 1; encrypted_line[hex_cursor] = xx[encrypted_line[cursor] & 0xF]; @@ -601,4 +601,4 @@ bool subghz_keystore_raw_get_data(const char* file_name, size_t offset, uint8_t* string_clear(str_temp); return result; -} \ No newline at end of file +} diff --git a/lib/toolbox/args.c b/lib/toolbox/args.c index 8d6295ddf57..287ca7efc92 100644 --- a/lib/toolbox/args.c +++ b/lib/toolbox/args.c @@ -92,4 +92,4 @@ bool args_read_hex_bytes(string_t args, uint8_t* bytes, size_t bytes_count) { } return result; -} \ No newline at end of file +} diff --git a/lib/toolbox/args.h b/lib/toolbox/args.h index 4ae1e1db889..dc72bdafab8 100644 --- a/lib/toolbox/args.h +++ b/lib/toolbox/args.h @@ -78,4 +78,4 @@ bool args_char_to_hex(char hi_nibble, char low_nibble, uint8_t* byte); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/toolbox/hex.c b/lib/toolbox/hex.c index 8b443e124bf..739eb30b6b2 100644 --- a/lib/toolbox/hex.c +++ b/lib/toolbox/hex.c @@ -25,4 +25,4 @@ bool hex_chars_to_uint8(char hi, char low, uint8_t* value) { } else { return false; } -} \ No newline at end of file +} diff --git a/lib/toolbox/hex.h b/lib/toolbox/hex.h index ac67549afb1..ca10f2bec4d 100644 --- a/lib/toolbox/hex.h +++ b/lib/toolbox/hex.h @@ -25,4 +25,4 @@ bool hex_chars_to_uint8(char hi, char low, uint8_t* value); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/toolbox/level_duration.h b/lib/toolbox/level_duration.h index bef0b6eca24..9406cef3145 100644 --- a/lib/toolbox/level_duration.h +++ b/lib/toolbox/level_duration.h @@ -79,4 +79,4 @@ static inline uint32_t level_duration_get_duration(LevelDuration level_duration) return (level_duration >= 0) ? level_duration : -level_duration; } -#endif \ No newline at end of file +#endif diff --git a/lib/toolbox/manchester_decoder.h b/lib/toolbox/manchester_decoder.h index 580d88e26b0..4fb6dbc6402 100644 --- a/lib/toolbox/manchester_decoder.h +++ b/lib/toolbox/manchester_decoder.h @@ -28,4 +28,4 @@ bool manchester_advance( #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/toolbox/manchester_encoder.c b/lib/toolbox/manchester_encoder.c index c0fc4ca9429..c22e4a177cc 100644 --- a/lib/toolbox/manchester_encoder.c +++ b/lib/toolbox/manchester_encoder.c @@ -51,4 +51,4 @@ bool manchester_encoder_advance( ManchesterEncoderResult manchester_encoder_finish(ManchesterEncoderState* state) { state->step = 0; return (state->prev_bit << 1) + state->prev_bit; -} \ No newline at end of file +} diff --git a/lib/toolbox/manchester_encoder.h b/lib/toolbox/manchester_encoder.h index 639d9b818a7..57ea8fb455d 100644 --- a/lib/toolbox/manchester_encoder.h +++ b/lib/toolbox/manchester_encoder.h @@ -29,4 +29,4 @@ ManchesterEncoderResult manchester_encoder_finish(ManchesterEncoderState* state) #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/toolbox/md5.c b/lib/toolbox/md5.c index b873ee0fa32..3cf7cf05c07 100644 --- a/lib/toolbox/md5.c +++ b/lib/toolbox/md5.c @@ -296,4 +296,4 @@ void md5(const unsigned char* input, size_t ilen, unsigned char output[16]) { md5_finish(&ctx, output); memset(&ctx, 0, sizeof(md5_context)); -} \ No newline at end of file +} diff --git a/lib/toolbox/md5.h b/lib/toolbox/md5.h index 7878881eb1e..fe53db8d3e5 100644 --- a/lib/toolbox/md5.h +++ b/lib/toolbox/md5.h @@ -80,4 +80,4 @@ void md5(const unsigned char* input, size_t ilen, unsigned char output[16]); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/toolbox/random_name.c b/lib/toolbox/random_name.c index 34a53867f1a..b581bb9799f 100644 --- a/lib/toolbox/random_name.c +++ b/lib/toolbox/random_name.c @@ -33,8 +33,8 @@ void set_random_name(char* name, uint8_t max_name_size) { "opening", "crack", }; - uint8_t prefix_i = rand() % SIZEOF_ARRAY(prefix); - uint8_t suffix_i = rand() % SIZEOF_ARRAY(suffix); + uint8_t prefix_i = rand() % COUNT_OF(prefix); + uint8_t suffix_i = rand() % COUNT_OF(suffix); sniprintf(name, max_name_size, "%s_%s", prefix[prefix_i], suffix[suffix_i]); // Set first symbol to upper case diff --git a/lib/toolbox/stream/file_stream.c b/lib/toolbox/stream/file_stream.c index 340cb61a959..70db8af9d99 100644 --- a/lib/toolbox/stream/file_stream.c +++ b/lib/toolbox/stream/file_stream.c @@ -228,4 +228,4 @@ static bool file_stream_delete_and_insert( string_clear(scratch_name); return result; -} \ No newline at end of file +} diff --git a/lib/toolbox/stream/file_stream.h b/lib/toolbox/stream/file_stream.h index ec371a53c42..4531b3e7aeb 100644 --- a/lib/toolbox/stream/file_stream.h +++ b/lib/toolbox/stream/file_stream.h @@ -44,4 +44,4 @@ FS_Error file_stream_get_error(Stream* stream); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/toolbox/stream/stream.c b/lib/toolbox/stream/stream.c index 4aee8acd0b5..982c498368b 100644 --- a/lib/toolbox/stream/stream.c +++ b/lib/toolbox/stream/stream.c @@ -217,7 +217,7 @@ bool stream_delete_and_insert_vaformat( string_init_vprintf(data, format, args); StreamWriteData write_data = { .data = (uint8_t*)string_get_cstr(data), .size = string_size(data)}; - bool result = stream_delete_and_insert(stream, 0, stream_write_struct, &write_data); + bool result = stream_delete_and_insert(stream, delete_size, stream_write_struct, &write_data); string_clear(data); return result; @@ -333,4 +333,4 @@ void stream_dump_data(Stream* stream) { printf("\r\n"); printf("DATA END\r\n"); stream_seek(stream, tell, StreamOffsetFromStart); -} \ No newline at end of file +} diff --git a/lib/toolbox/stream/stream.h b/lib/toolbox/stream/stream.h index 97ded8bda2c..c10e9f5e5ff 100644 --- a/lib/toolbox/stream/stream.h +++ b/lib/toolbox/stream/stream.h @@ -333,4 +333,4 @@ void stream_dump_data(Stream* stream); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/toolbox/stream/stream_i.h b/lib/toolbox/stream/stream_i.h index a62e174c221..178d3feee39 100644 --- a/lib/toolbox/stream/stream_i.h +++ b/lib/toolbox/stream/stream_i.h @@ -7,7 +7,7 @@ extern "C" { #endif -#define STREAM_CACHE_SIZE 512 +#define STREAM_CACHE_SIZE 512u typedef struct StreamVTable StreamVTable; diff --git a/lib/toolbox/stream/string_stream.c b/lib/toolbox/stream/string_stream.c index 5fec06c3ee1..3244b7ba89e 100644 --- a/lib/toolbox/stream/string_stream.c +++ b/lib/toolbox/stream/string_stream.c @@ -176,4 +176,4 @@ static size_t string_stream_write_char(StringStream* stream, char c) { stream->index++; return 1; -} \ No newline at end of file +} diff --git a/lib/toolbox/stream/string_stream.h b/lib/toolbox/stream/string_stream.h index 1827258d9b5..6cccfa6ccf8 100644 --- a/lib/toolbox/stream/string_stream.h +++ b/lib/toolbox/stream/string_stream.h @@ -15,4 +15,4 @@ Stream* string_stream_alloc(); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/toolbox/tar/tar_archive.c b/lib/toolbox/tar/tar_archive.c index 315497e1e6f..91d2c8127f5 100644 --- a/lib/toolbox/tar/tar_archive.c +++ b/lib/toolbox/tar/tar_archive.c @@ -345,4 +345,4 @@ bool tar_archive_add_dir(TarArchive* archive, const char* fs_full_path, const ch free(name); storage_file_free(directory); return success; -} \ No newline at end of file +} diff --git a/lib/toolbox/tar/tar_archive.h b/lib/toolbox/tar/tar_archive.h index a8976181fb3..d9b0f32158b 100644 --- a/lib/toolbox/tar/tar_archive.h +++ b/lib/toolbox/tar/tar_archive.h @@ -63,4 +63,4 @@ bool tar_archive_finalize(TarArchive* archive); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/toolbox/version.c b/lib/toolbox/version.c index 902be876c22..40c48370b38 100644 --- a/lib/toolbox/version.c +++ b/lib/toolbox/version.c @@ -55,4 +55,4 @@ uint8_t version_get_target(const Version* v) { bool version_get_dirty_flag(const Version* v) { return v ? v->build_is_dirty : version.build_is_dirty; -} \ No newline at end of file +} diff --git a/lib/toolbox/version.h b/lib/toolbox/version.h index 7e82e45d4bd..652ff3feace 100644 --- a/lib/toolbox/version.h +++ b/lib/toolbox/version.h @@ -84,4 +84,4 @@ bool version_get_dirty_flag(const Version* v); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/u8g2/u8g2_glue.c b/lib/u8g2/u8g2_glue.c index cc186663f32..33d30f29283 100644 --- a/lib/u8g2/u8g2_glue.c +++ b/lib/u8g2/u8g2_glue.c @@ -3,6 +3,8 @@ #include uint8_t u8g2_gpio_and_delay_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr) { + UNUSED(u8x8); + UNUSED(arg_ptr); switch(msg) { case U8X8_MSG_GPIO_AND_DELAY_INIT: /* HAL initialization contains all what we need so we can skip this part. */ @@ -27,6 +29,7 @@ uint8_t u8g2_gpio_and_delay_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, vo } uint8_t u8x8_hw_spi_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr) { + UNUSED(u8x8); switch(msg) { case U8X8_MSG_BYTE_SEND: furi_hal_spi_bus_tx(&furi_hal_spi_bus_handle_display, (uint8_t*)arg_ptr, arg_int, 10000); diff --git a/lib/u8g2/u8x8_display.c b/lib/u8g2/u8x8_display.c index 76a099b135f..83b0ca41114 100644 --- a/lib/u8g2/u8x8_display.c +++ b/lib/u8g2/u8x8_display.c @@ -147,4 +147,4 @@ void u8x8_ClearLine(u8x8_t* u8x8, uint8_t line) { u8x8->display_cb( u8x8, U8X8_MSG_DISPLAY_DRAW_TILE, u8x8->display_info->tile_width, (void*)&tile); } -} \ No newline at end of file +} diff --git a/lib/u8g2/u8x8_gpio.c b/lib/u8g2/u8x8_gpio.c index bb1470d324e..1fcc0a393bc 100644 --- a/lib/u8g2/u8x8_gpio.c +++ b/lib/u8g2/u8x8_gpio.c @@ -44,4 +44,4 @@ void u8x8_gpio_Delay(u8x8_t *u8x8, uint8_t msg, uint8_t dly) { u8x8->gpio_and_delay_cb(u8x8, msg, dly, NULL); } -*/ \ No newline at end of file +*/ diff --git a/lib/update_util/update_manifest.c b/lib/update_util/update_manifest.c index 3d05d0bafa1..555d7cfb6c9 100644 --- a/lib/update_util/update_manifest.c +++ b/lib/update_util/update_manifest.c @@ -179,4 +179,4 @@ bool update_manifest_init_mem( flipper_format_free(flipper_file); return update_manifest->valid; -} \ No newline at end of file +} diff --git a/lib/update_util/update_manifest.h b/lib/update_util/update_manifest.h index d03c71d2928..75871e1d3ac 100644 --- a/lib/update_util/update_manifest.h +++ b/lib/update_util/update_manifest.h @@ -59,4 +59,4 @@ bool update_manifest_has_obdata(UpdateManifest* update_manifest); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/lib/update_util/update_operation.c b/lib/update_util/update_operation.c index beea98d2678..cf72dd0c82d 100644 --- a/lib/update_util/update_operation.c +++ b/lib/update_util/update_operation.c @@ -194,4 +194,4 @@ void update_operation_disarm() { void update_operation_persist_package_index(uint32_t index) { furi_hal_rtc_set_register(FuriHalRtcRegisterUpdateFolderFSIndex, index); -} \ No newline at end of file +} diff --git a/lib/update_util/update_operation.h b/lib/update_util/update_operation.h index 6b6ab7305e3..10f3c6b41c6 100644 --- a/lib/update_util/update_operation.h +++ b/lib/update_util/update_operation.h @@ -69,4 +69,4 @@ void update_operation_disarm(); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/make/base.mk b/make/base.mk index 696c4294c11..281419e9d18 100644 --- a/make/base.mk +++ b/make/base.mk @@ -8,4 +8,4 @@ OPENOCD_OPTS = CFLAGS = CPPFLAGS = LDFLAGS = -SVD_FILE = \ No newline at end of file +SVD_FILE = diff --git a/make/defaults.mk b/make/defaults.mk index 86e4f03d05a..ade34a6b0f7 100644 --- a/make/defaults.mk +++ b/make/defaults.mk @@ -1,2 +1,2 @@ TARGET ?= f7 -export TARGET \ No newline at end of file +export TARGET diff --git a/make/freertos-heap.mk b/make/freertos-heap.mk index e839e61c260..93992900830 100644 --- a/make/freertos-heap.mk +++ b/make/freertos-heap.mk @@ -1 +1 @@ -LDFLAGS += -Wl,--wrap,_malloc_r -Wl,--wrap,_free_r -Wl,--wrap,_calloc_r -Wl,--wrap,_realloc_r \ No newline at end of file +LDFLAGS += -Wl,--wrap,_malloc_r -Wl,--wrap,_free_r -Wl,--wrap,_calloc_r -Wl,--wrap,_realloc_r diff --git a/scripts/ReadMe.md b/scripts/ReadMe.md index b04ed0d1a0c..86b5b8afe1f 100644 --- a/scripts/ReadMe.md +++ b/scripts/ReadMe.md @@ -57,4 +57,4 @@ Run in the root folder of the repo: ```bash python scripts/storage.py -p send assets/resources /ext -``` \ No newline at end of file +```