diff --git a/SConstruct b/SConstruct index e75907c87..268472a7c 100644 --- a/SConstruct +++ b/SConstruct @@ -230,6 +230,7 @@ firmware_debug = distenv.PhonyTarget( source=firmware_env["FW_ELF"], GDBOPTS="${GDBOPTS_BASE}", GDBREMOTE="${OPENOCD_GDB_PIPE}", + FBT_FAP_DEBUG_ELF_ROOT=firmware_env["FBT_FAP_DEBUG_ELF_ROOT"], ) distenv.Depends(firmware_debug, firmware_flash) @@ -239,6 +240,7 @@ distenv.PhonyTarget( source=firmware_env["FW_ELF"], GDBOPTS="${GDBOPTS_BASE} ${GDBOPTS_BLACKMAGIC}", GDBREMOTE="${BLACKMAGIC_ADDR}", + FBT_FAP_DEBUG_ELF_ROOT=firmware_env["FBT_FAP_DEBUG_ELF_ROOT"], ) # Debug alien elf diff --git a/applications/debug/unit_tests/furi/furi_test.c b/applications/debug/unit_tests/furi/furi_test.c index 2f271c305..e287f9927 100644 --- a/applications/debug/unit_tests/furi/furi_test.c +++ b/applications/debug/unit_tests/furi/furi_test.c @@ -4,11 +4,11 @@ #include "../minunit.h" // v2 tests -void test_furi_create_open(); -void test_furi_concurrent_access(); -void test_furi_pubsub(); +void test_furi_create_open(void); +void test_furi_concurrent_access(void); +void test_furi_pubsub(void); -void test_furi_memmgr(); +void test_furi_memmgr(void); static int foo = 0; diff --git a/applications/debug/unit_tests/test_index.c b/applications/debug/unit_tests/test_index.c index eb475fada..5d0282bd7 100644 --- a/applications/debug/unit_tests/test_index.c +++ b/applications/debug/unit_tests/test_index.c @@ -8,31 +8,31 @@ #define TAG "UnitTests" -int run_minunit_test_furi(); -int run_minunit_test_furi_hal(); -int run_minunit_test_furi_hal_crypto(); -int run_minunit_test_furi_string(); -int run_minunit_test_infrared(); -int run_minunit_test_rpc(); -int run_minunit_test_manifest(); -int run_minunit_test_flipper_format(); -int run_minunit_test_flipper_format_string(); -int run_minunit_test_stream(); -int run_minunit_test_storage(); -int run_minunit_test_subghz(); -int run_minunit_test_dirwalk(); -int run_minunit_test_power(); -int run_minunit_test_protocol_dict(); -int run_minunit_test_lfrfid_protocols(); -int run_minunit_test_nfc(); -int run_minunit_test_bit_lib(); -int run_minunit_test_datetime(); -int run_minunit_test_float_tools(); -int run_minunit_test_bt(); -int run_minunit_test_dialogs_file_browser_options(); -int run_minunit_test_expansion(); +int run_minunit_test_furi(void); +int run_minunit_test_furi_hal(void); +int run_minunit_test_furi_hal_crypto(void); +int run_minunit_test_furi_string(void); +int run_minunit_test_infrared(void); +int run_minunit_test_rpc(void); +int run_minunit_test_manifest(void); +int run_minunit_test_flipper_format(void); +int run_minunit_test_flipper_format_string(void); +int run_minunit_test_stream(void); +int run_minunit_test_storage(void); +int run_minunit_test_subghz(void); +int run_minunit_test_dirwalk(void); +int run_minunit_test_power(void); +int run_minunit_test_protocol_dict(void); +int run_minunit_test_lfrfid_protocols(void); +int run_minunit_test_nfc(void); +int run_minunit_test_bit_lib(void); +int run_minunit_test_datetime(void); +int run_minunit_test_float_tools(void); +int run_minunit_test_bt(void); +int run_minunit_test_dialogs_file_browser_options(void); +int run_minunit_test_expansion(void); -typedef int (*UnitTestEntry)(); +typedef int (*UnitTestEntry)(void); typedef struct { const char* name; diff --git a/applications/main/bad_usb/scenes/bad_usb_scene_config_layout.c b/applications/main/bad_usb/scenes/bad_usb_scene_config_layout.c index 2dbacbe12..a5d0df94c 100644 --- a/applications/main/bad_usb/scenes/bad_usb_scene_config_layout.c +++ b/applications/main/bad_usb/scenes/bad_usb_scene_config_layout.c @@ -31,7 +31,6 @@ void bad_usb_scene_config_layout_on_enter(void* context) { BadUsbApp* bad_usb = context; if(bad_usb_layout_select(bad_usb)) { - bad_usb_script_set_keyboard_layout(bad_usb->bad_usb_script, bad_usb->keyboard_layout); scene_manager_search_and_switch_to_previous_scene(bad_usb->scene_manager, BadUsbSceneWork); } else { scene_manager_previous_scene(bad_usb->scene_manager); diff --git a/applications/main/infrared/infrared_app.c b/applications/main/infrared/infrared_app.c index 4d63f7df3..38332021f 100644 --- a/applications/main/infrared/infrared_app.c +++ b/applications/main/infrared/infrared_app.c @@ -13,11 +13,12 @@ #define INFRARED_TASK_STACK_SIZE (2048UL) #define INFRARED_SETTINGS_PATH EXT_PATH("infrared/.infrared.settings") -#define INFRARED_SETTINGS_VERSION (0) +#define INFRARED_SETTINGS_VERSION (1) #define INFRARED_SETTINGS_MAGIC (0x1F) typedef struct { - uint8_t tx_pin; + FuriHalInfraredTxPin tx_pin; + bool otg_enabled; } InfraredSettings; static const NotificationSequence* @@ -488,11 +489,15 @@ static void infrared_load_settings(InfraredApp* infrared) { } infrared_set_tx_pin(infrared, settings.tx_pin); + if(settings.tx_pin < FuriHalInfraredTxPinMax) { + infrared_enable_otg(infrared, settings.otg_enabled); + } } void infrared_save_settings(InfraredApp* infrared) { InfraredSettings settings = { .tx_pin = infrared->app_state.tx_pin, + .otg_enabled = infrared->app_state.is_otg_enabled, }; if(!saved_struct_save( diff --git a/applications/main/nfc/helpers/protocol_support/mf_ultralight/mf_ultralight.c b/applications/main/nfc/helpers/protocol_support/mf_ultralight/mf_ultralight.c index 0fe5a7664..bd2015889 100644 --- a/applications/main/nfc/helpers/protocol_support/mf_ultralight/mf_ultralight.c +++ b/applications/main/nfc/helpers/protocol_support/mf_ultralight/mf_ultralight.c @@ -247,6 +247,8 @@ static void nfc_scene_read_success_on_enter_mf_ultralight(NfcApp* instance) { furi_string_cat_printf( temp_str, "\e#%s\n", nfc_device_get_name(device, NfcDeviceNameTypeFull)); + furi_string_replace(temp_str, "Mifare", "MIFARE"); + nfc_render_mf_ultralight_info(data, NfcProtocolFormatTypeShort, temp_str); } diff --git a/applications/services/notification/notification_app.c b/applications/services/notification/notification_app.c index 514a37f00..8e183f74e 100644 --- a/applications/services/notification/notification_app.c +++ b/applications/services/notification/notification_app.c @@ -24,9 +24,9 @@ static const uint8_t reset_display_mask = 1 << 5; static const uint8_t reset_blink_mask = 1 << 6; static void notification_vibro_on(bool force); -static void notification_vibro_off(); +static void notification_vibro_off(void); static void notification_sound_on(float freq, float volume, bool force); -static void notification_sound_off(); +static void notification_sound_off(void); static uint8_t notification_settings_get_display_brightness(NotificationApp* app, uint8_t value); static uint8_t notification_settings_get_rgb_led_brightness(NotificationApp* app, uint8_t value); diff --git a/scripts/fbt_tools/fbt_apps.py b/scripts/fbt_tools/fbt_apps.py index 7e0aec5ea..3a17a79a3 100644 --- a/scripts/fbt_tools/fbt_apps.py +++ b/scripts/fbt_tools/fbt_apps.py @@ -44,7 +44,7 @@ class ApplicationsCGenerator: def get_app_ep_forward(self, app: FlipperApplication): if app.apptype == FlipperAppType.STARTUP: - return f"extern void {app.entry_point}();" + return f"extern void {app.entry_point}(void);" return f"extern int32_t {app.entry_point}(void* p);" def get_app_descr(self, app: FlipperApplication): diff --git a/scripts/fbt_tools/pvsstudio.py b/scripts/fbt_tools/pvsstudio.py index d74aae768..290531321 100644 --- a/scripts/fbt_tools/pvsstudio.py +++ b/scripts/fbt_tools/pvsstudio.py @@ -32,7 +32,7 @@ def atexist_handler(): for bf in GetBuildFailures(): for node in Flatten(bf.node): - if node.exists and "pvs" in node.name and node.name.endswith(".html"): + if node.exists and "pvs" in node.path and node.name.endswith(".html"): # macOS if sys.platform == "darwin": subprocess.run(["open", node.abspath]) diff --git a/site_scons/cc.scons b/site_scons/cc.scons index 507cd2d12..603ec621c 100644 --- a/site_scons/cc.scons +++ b/site_scons/cc.scons @@ -4,6 +4,7 @@ Import("ENV") ENV.AppendUnique( CFLAGS=[ "-std=gnu2x", + "-Wstrict-prototypes", ], CXXFLAGS=[ "-std=c++20", diff --git a/site_scons/extapps.scons b/site_scons/extapps.scons index 22d0be867..b67ce9621 100644 --- a/site_scons/extapps.scons +++ b/site_scons/extapps.scons @@ -48,6 +48,9 @@ appenv.AppendUnique( "stdc++", "supc++", ], + CFLAGS=[ + "-Wno-strict-prototypes", + ], ) diff --git a/targets/f7/ble_glue/ble_glue.c b/targets/f7/ble_glue/ble_glue.c index ecc2f83c5..c50360361 100644 --- a/targets/f7/ble_glue/ble_glue.c +++ b/targets/f7/ble_glue/ble_glue.c @@ -49,7 +49,7 @@ static BleGlue* ble_glue = NULL; // static int32_t ble_glue_shci_thread(void* argument); static void ble_sys_status_not_callback(SHCI_TL_CmdStatus_t status); static void ble_sys_user_event_callback(void* pPayload); -static void ble_glue_clear_shared_memory(); +static void ble_glue_clear_shared_memory(void); void ble_glue_set_key_storage_changed_callback( BleGlueKeyStorageChangedCallback callback, diff --git a/targets/f7/ble_glue/gap.c b/targets/f7/ble_glue/gap.c index 361da6749..252e213f2 100644 --- a/targets/f7/ble_glue/gap.c +++ b/targets/f7/ble_glue/gap.c @@ -410,7 +410,7 @@ static void gap_advertise_start(GapState new_state) { uint16_t min_interval; uint16_t max_interval; - FURI_LOG_I(TAG, "Start: %d", new_state); + FURI_LOG_D(TAG, "Start: %d", new_state); if(new_state == GapStateAdvFast) { min_interval = 0x80; // 80 ms @@ -455,7 +455,7 @@ static void gap_advertise_start(GapState new_state) { } static void gap_advertise_stop(void) { - FURI_LOG_I(TAG, "Stop"); + FURI_LOG_D(TAG, "Stop"); tBleStatus ret; if(gap->state > GapStateIdle) { if(gap->state == GapStateConnected) { diff --git a/targets/f7/ble_glue/hw_ipcc.c b/targets/f7/ble_glue/hw_ipcc.c index 6a3aace5a..4daaa7e49 100644 --- a/targets/f7/ble_glue/hw_ipcc.c +++ b/targets/f7/ble_glue/hw_ipcc.c @@ -15,14 +15,14 @@ (LL_C2_IPCC_IsActiveFlag_CHx(IPCC, channel) && \ LL_C1_IPCC_IsEnabledReceiveChannel(IPCC, channel)) -static void (*FreeBufCb)(); +static void (*FreeBufCb)(void); -static void HW_IPCC_BLE_EvtHandler(); -static void HW_IPCC_BLE_AclDataEvtHandler(); -static void HW_IPCC_MM_FreeBufHandler(); -static void HW_IPCC_SYS_CmdEvtHandler(); -static void HW_IPCC_SYS_EvtHandler(); -static void HW_IPCC_TRACES_EvtHandler(); +static void HW_IPCC_BLE_EvtHandler(void); +static void HW_IPCC_BLE_AclDataEvtHandler(void); +static void HW_IPCC_MM_FreeBufHandler(void); +static void HW_IPCC_SYS_CmdEvtHandler(void); +static void HW_IPCC_SYS_EvtHandler(void); +static void HW_IPCC_TRACES_EvtHandler(void); void HW_IPCC_Rx_Handler(void) { if(HW_IPCC_RX_PENDING(HW_IPCC_SYSTEM_EVENT_CHANNEL)) { @@ -134,7 +134,7 @@ static void HW_IPCC_SYS_EvtHandler(void) { LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_SYSTEM_EVENT_CHANNEL); } -void HW_IPCC_MM_SendFreeBuf(void (*cb)()) { +void HW_IPCC_MM_SendFreeBuf(void (*cb)(void)) { if(LL_C1_IPCC_IsActiveFlag_CHx(IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL)) { FreeBufCb = cb; LL_C1_IPCC_EnableTransmitChannel(IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL); diff --git a/targets/f7/furi_hal/furi_hal_infrared.c b/targets/f7/furi_hal/furi_hal_infrared.c index bbb00198e..6f2210cc1 100644 --- a/targets/f7/furi_hal/furi_hal_infrared.c +++ b/targets/f7/furi_hal/furi_hal_infrared.c @@ -92,8 +92,8 @@ static void furi_hal_infrared_tx_dma_set_polarity(uint8_t buf_num, uint8_t polar static void furi_hal_infrared_tx_dma_set_buffer(uint8_t buf_num); static void furi_hal_infrared_tx_fill_buffer_last(uint8_t buf_num); static uint8_t furi_hal_infrared_get_current_dma_tx_buffer(void); -static void furi_hal_infrared_tx_dma_polarity_isr(); -static void furi_hal_infrared_tx_dma_isr(); +static void furi_hal_infrared_tx_dma_polarity_isr(void*); +static void furi_hal_infrared_tx_dma_isr(void*); static void furi_hal_infrared_tim_rx_isr(void* context) { UNUSED(context); diff --git a/targets/f7/furi_hal/furi_hal_interrupt.c b/targets/f7/furi_hal/furi_hal_interrupt.c index a0ce2f665..5c2c315ef 100644 --- a/targets/f7/furi_hal/furi_hal_interrupt.c +++ b/targets/f7/furi_hal/furi_hal_interrupt.c @@ -305,8 +305,8 @@ void DebugMon_Handler(void) { extern usbd_device udev; -extern void HW_IPCC_Tx_Handler(); -extern void HW_IPCC_Rx_Handler(); +extern void HW_IPCC_Tx_Handler(void); +extern void HW_IPCC_Rx_Handler(void); void SysTick_Handler(void) { furi_hal_os_tick(); diff --git a/targets/f7/furi_hal/furi_hal_os.c b/targets/f7/furi_hal/furi_hal_os.c index 4738faa7c..ba28a141f 100644 --- a/targets/f7/furi_hal/furi_hal_os.c +++ b/targets/f7/furi_hal/furi_hal_os.c @@ -51,7 +51,7 @@ void furi_hal_os_timer_callback(void) { } #endif -extern void xPortSysTickHandler(); +extern void xPortSysTickHandler(void); static volatile uint32_t furi_hal_os_skew;