mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-12 12:42:30 +04:00
fbt: added -Wstrict-prototypes for main firmware (#3557)
* fbt: added -Wstrict-prototypes for main firmware (excludes extapps) * unit_tests: fixed declarations using strict prototypes * furi_hal: ble: changed gap stop log level to debug Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -4,11 +4,11 @@
|
|||||||
#include "../minunit.h"
|
#include "../minunit.h"
|
||||||
|
|
||||||
// v2 tests
|
// v2 tests
|
||||||
void test_furi_create_open();
|
void test_furi_create_open(void);
|
||||||
void test_furi_concurrent_access();
|
void test_furi_concurrent_access(void);
|
||||||
void test_furi_pubsub();
|
void test_furi_pubsub(void);
|
||||||
|
|
||||||
void test_furi_memmgr();
|
void test_furi_memmgr(void);
|
||||||
|
|
||||||
static int foo = 0;
|
static int foo = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -8,31 +8,31 @@
|
|||||||
|
|
||||||
#define TAG "UnitTests"
|
#define TAG "UnitTests"
|
||||||
|
|
||||||
int run_minunit_test_furi();
|
int run_minunit_test_furi(void);
|
||||||
int run_minunit_test_furi_hal();
|
int run_minunit_test_furi_hal(void);
|
||||||
int run_minunit_test_furi_hal_crypto();
|
int run_minunit_test_furi_hal_crypto(void);
|
||||||
int run_minunit_test_furi_string();
|
int run_minunit_test_furi_string(void);
|
||||||
int run_minunit_test_infrared();
|
int run_minunit_test_infrared(void);
|
||||||
int run_minunit_test_rpc();
|
int run_minunit_test_rpc(void);
|
||||||
int run_minunit_test_manifest();
|
int run_minunit_test_manifest(void);
|
||||||
int run_minunit_test_flipper_format();
|
int run_minunit_test_flipper_format(void);
|
||||||
int run_minunit_test_flipper_format_string();
|
int run_minunit_test_flipper_format_string(void);
|
||||||
int run_minunit_test_stream();
|
int run_minunit_test_stream(void);
|
||||||
int run_minunit_test_storage();
|
int run_minunit_test_storage(void);
|
||||||
int run_minunit_test_subghz();
|
int run_minunit_test_subghz(void);
|
||||||
int run_minunit_test_dirwalk();
|
int run_minunit_test_dirwalk(void);
|
||||||
int run_minunit_test_power();
|
int run_minunit_test_power(void);
|
||||||
int run_minunit_test_protocol_dict();
|
int run_minunit_test_protocol_dict(void);
|
||||||
int run_minunit_test_lfrfid_protocols();
|
int run_minunit_test_lfrfid_protocols(void);
|
||||||
int run_minunit_test_nfc();
|
int run_minunit_test_nfc(void);
|
||||||
int run_minunit_test_bit_lib();
|
int run_minunit_test_bit_lib(void);
|
||||||
int run_minunit_test_datetime();
|
int run_minunit_test_datetime(void);
|
||||||
int run_minunit_test_float_tools();
|
int run_minunit_test_float_tools(void);
|
||||||
int run_minunit_test_bt();
|
int run_minunit_test_bt(void);
|
||||||
int run_minunit_test_dialogs_file_browser_options();
|
int run_minunit_test_dialogs_file_browser_options(void);
|
||||||
int run_minunit_test_expansion();
|
int run_minunit_test_expansion(void);
|
||||||
|
|
||||||
typedef int (*UnitTestEntry)();
|
typedef int (*UnitTestEntry)(void);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const char* name;
|
const char* name;
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ static const uint8_t reset_display_mask = 1 << 5;
|
|||||||
static const uint8_t reset_blink_mask = 1 << 6;
|
static const uint8_t reset_blink_mask = 1 << 6;
|
||||||
|
|
||||||
static void notification_vibro_on(bool force);
|
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_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_display_brightness(NotificationApp* app, uint8_t value);
|
||||||
static uint8_t notification_settings_get_rgb_led_brightness(NotificationApp* app, uint8_t value);
|
static uint8_t notification_settings_get_rgb_led_brightness(NotificationApp* app, uint8_t value);
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class ApplicationsCGenerator:
|
|||||||
|
|
||||||
def get_app_ep_forward(self, app: FlipperApplication):
|
def get_app_ep_forward(self, app: FlipperApplication):
|
||||||
if app.apptype == FlipperAppType.STARTUP:
|
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);"
|
return f"extern int32_t {app.entry_point}(void* p);"
|
||||||
|
|
||||||
def get_app_descr(self, app: FlipperApplication):
|
def get_app_descr(self, app: FlipperApplication):
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ Import("ENV")
|
|||||||
ENV.AppendUnique(
|
ENV.AppendUnique(
|
||||||
CFLAGS=[
|
CFLAGS=[
|
||||||
"-std=gnu2x",
|
"-std=gnu2x",
|
||||||
|
"-Wstrict-prototypes",
|
||||||
],
|
],
|
||||||
CXXFLAGS=[
|
CXXFLAGS=[
|
||||||
"-std=c++20",
|
"-std=c++20",
|
||||||
|
|||||||
@@ -48,6 +48,9 @@ appenv.AppendUnique(
|
|||||||
"stdc++",
|
"stdc++",
|
||||||
"supc++",
|
"supc++",
|
||||||
],
|
],
|
||||||
|
CFLAGS=[
|
||||||
|
"-Wno-strict-prototypes",
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ static BleGlue* ble_glue = NULL;
|
|||||||
// static int32_t ble_glue_shci_thread(void* argument);
|
// 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_status_not_callback(SHCI_TL_CmdStatus_t status);
|
||||||
static void ble_sys_user_event_callback(void* pPayload);
|
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(
|
void ble_glue_set_key_storage_changed_callback(
|
||||||
BleGlueKeyStorageChangedCallback callback,
|
BleGlueKeyStorageChangedCallback callback,
|
||||||
|
|||||||
@@ -375,7 +375,7 @@ static void gap_advertise_start(GapState new_state) {
|
|||||||
uint16_t min_interval;
|
uint16_t min_interval;
|
||||||
uint16_t max_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) {
|
if(new_state == GapStateAdvFast) {
|
||||||
min_interval = 0x80; // 80 ms
|
min_interval = 0x80; // 80 ms
|
||||||
@@ -420,7 +420,7 @@ static void gap_advertise_start(GapState new_state) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void gap_advertise_stop(void) {
|
static void gap_advertise_stop(void) {
|
||||||
FURI_LOG_I(TAG, "Stop");
|
FURI_LOG_D(TAG, "Stop");
|
||||||
tBleStatus ret;
|
tBleStatus ret;
|
||||||
if(gap->state > GapStateIdle) {
|
if(gap->state > GapStateIdle) {
|
||||||
if(gap->state == GapStateConnected) {
|
if(gap->state == GapStateConnected) {
|
||||||
|
|||||||
@@ -15,14 +15,14 @@
|
|||||||
(LL_C2_IPCC_IsActiveFlag_CHx(IPCC, channel) && \
|
(LL_C2_IPCC_IsActiveFlag_CHx(IPCC, channel) && \
|
||||||
LL_C1_IPCC_IsEnabledReceiveChannel(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_EvtHandler(void);
|
||||||
static void HW_IPCC_BLE_AclDataEvtHandler();
|
static void HW_IPCC_BLE_AclDataEvtHandler(void);
|
||||||
static void HW_IPCC_MM_FreeBufHandler();
|
static void HW_IPCC_MM_FreeBufHandler(void);
|
||||||
static void HW_IPCC_SYS_CmdEvtHandler();
|
static void HW_IPCC_SYS_CmdEvtHandler(void);
|
||||||
static void HW_IPCC_SYS_EvtHandler();
|
static void HW_IPCC_SYS_EvtHandler(void);
|
||||||
static void HW_IPCC_TRACES_EvtHandler();
|
static void HW_IPCC_TRACES_EvtHandler(void);
|
||||||
|
|
||||||
void HW_IPCC_Rx_Handler(void) {
|
void HW_IPCC_Rx_Handler(void) {
|
||||||
if(HW_IPCC_RX_PENDING(HW_IPCC_SYSTEM_EVENT_CHANNEL)) {
|
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);
|
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)) {
|
if(LL_C1_IPCC_IsActiveFlag_CHx(IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL)) {
|
||||||
FreeBufCb = cb;
|
FreeBufCb = cb;
|
||||||
LL_C1_IPCC_EnableTransmitChannel(IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL);
|
LL_C1_IPCC_EnableTransmitChannel(IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL);
|
||||||
|
|||||||
@@ -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_dma_set_buffer(uint8_t buf_num);
|
||||||
static void furi_hal_infrared_tx_fill_buffer_last(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 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_polarity_isr(void*);
|
||||||
static void furi_hal_infrared_tx_dma_isr();
|
static void furi_hal_infrared_tx_dma_isr(void*);
|
||||||
|
|
||||||
static void furi_hal_infrared_tim_rx_isr(void* context) {
|
static void furi_hal_infrared_tim_rx_isr(void* context) {
|
||||||
UNUSED(context);
|
UNUSED(context);
|
||||||
|
|||||||
@@ -305,8 +305,8 @@ void DebugMon_Handler(void) {
|
|||||||
|
|
||||||
extern usbd_device udev;
|
extern usbd_device udev;
|
||||||
|
|
||||||
extern void HW_IPCC_Tx_Handler();
|
extern void HW_IPCC_Tx_Handler(void);
|
||||||
extern void HW_IPCC_Rx_Handler();
|
extern void HW_IPCC_Rx_Handler(void);
|
||||||
|
|
||||||
void SysTick_Handler(void) {
|
void SysTick_Handler(void) {
|
||||||
furi_hal_os_tick();
|
furi_hal_os_tick();
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ void furi_hal_os_timer_callback(void) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern void xPortSysTickHandler();
|
extern void xPortSysTickHandler(void);
|
||||||
|
|
||||||
static volatile uint32_t furi_hal_os_skew;
|
static volatile uint32_t furi_hal_os_skew;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user