[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 <alleteam@gmail.com>
This commit is contained in:
@@ -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);
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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) {
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user