Skip to content
Prev Previous commit
Next Next commit
Remove some unused parameter warnings
Signed-off-by: fpr <fabien.perroquin@wi6labs.com>
  • Loading branch information
fpr committed Sep 12, 2017
commit 91b06e864ab50fe7a67771d78c1cf532938a06b7
2 changes: 2 additions & 0 deletions cores/arduino/stm32/usbd_hid_composite.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ __ALIGN_BEGIN static uint8_t HID_KEYBOARD_ReportDesc[HID_KEYBOARD_REPORT_DESC_SI
static uint8_t USBD_HID_Init (USBD_HandleTypeDef *pdev,
uint8_t cfgidx)
{
UNUSED(cfgidx);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's ok, but why do you remove them ? can you explain in commit message ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This removed only function parameters not used inside the function. There is no impact on the rest of the code but allow to remove some warning messages at compilation time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok sorry - this is clear enough in the commit title already !

uint8_t ret = 0;

/* Open EP IN */
Expand Down Expand Up @@ -407,6 +408,7 @@ static uint8_t USBD_HID_Init (USBD_HandleTypeDef *pdev,
static uint8_t USBD_HID_DeInit (USBD_HandleTypeDef *pdev,
uint8_t cfgidx)
{
UNUSED(cfgidx);
/* Close HID EPs */
USBD_LL_CloseEP(pdev,
HID_MOUSE_EPIN_ADDR);
Expand Down
2 changes: 2 additions & 0 deletions variants/DISCO_L475VG_IOT/usb/usbd_conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd)
*/
void HAL_PCD_MspDeInit(PCD_HandleTypeDef *hpcd)
{
UNUSED(hpcd);

/* Disable USB FS Clock */
__HAL_RCC_USB_OTG_FS_CLK_DISABLE();
__HAL_RCC_SYSCFG_CLK_DISABLE();
Expand Down
8 changes: 6 additions & 2 deletions variants/DISCO_L475VG_IOT/usb/usbd_desc.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ __ALIGN_BEGIN static uint8_t USBD_LangIDDesc[USB_LEN_LANGID_STR_DESC] __ALIGN_EN
HIBYTE(USBD_LANGID_STRING),
};

uint8_t USBD_StringSerial[USB_SIZ_STRING_SERIAL] =
static uint8_t USBD_StringSerial[USB_SIZ_STRING_SERIAL] =
{
USB_SIZ_STRING_SERIAL,
USB_DESC_TYPE_STRING,
Expand All @@ -158,6 +158,7 @@ static void Get_SerialNum(void);
*/
uint8_t *USBD_HID_DeviceDescriptor(USBD_SpeedTypeDef speed, uint16_t *length)
{
UNUSED(speed);
*length = sizeof(USBD_DeviceDesc);
return (uint8_t*)USBD_DeviceDesc;
}
Expand All @@ -170,6 +171,7 @@ uint8_t *USBD_HID_DeviceDescriptor(USBD_SpeedTypeDef speed, uint16_t *length)
*/
uint8_t *USBD_HID_LangIDStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length)
{
UNUSED(speed);
*length = sizeof(USBD_LangIDDesc);
return (uint8_t*)USBD_LangIDDesc;
}
Expand Down Expand Up @@ -201,6 +203,7 @@ uint8_t *USBD_HID_ProductStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length
*/
uint8_t *USBD_HID_ManufacturerStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length)
{
UNUSED(speed);
USBD_GetString((uint8_t *)USBD_MANUFACTURER_STRING, USBD_StrDesc, length);
return USBD_StrDesc;
}
Expand All @@ -213,6 +216,7 @@ uint8_t *USBD_HID_ManufacturerStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *l
*/
uint8_t *USBD_HID_SerialStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length)
{
UNUSED(speed);
*length = USB_SIZ_STRING_SERIAL;

/* Update the serial number string descriptor with the data from the unique ID*/
Expand Down Expand Up @@ -282,7 +286,7 @@ static void Get_SerialNum(void)
}

/**
* @brief Convert Hex 32Bits value into char
* @brief Convert Hex 32Bits value into char
* @param value: value to convert
* @param pbuf: pointer to the buffer
* @param len: buffer length
Expand Down