[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:
@@ -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) &&
|
||||
|
Reference in New Issue
Block a user