Prevent warnings about some unused parameters in pico_stdio_usb when building with -Wextra (#431)

* Fix warnings about some unused parameters in pico_stdio_usb

* Use `__unused` for the unused parameter in tud_descriptor_configuration_cb

* Remove redundant inclusions of `pico/platform.h`

This header is included by the other library headers (via `pico.h`)
This commit is contained in:
Jonathan Reichelt Gjertsen 2021-05-24 23:42:28 +02:00 committed by GitHub
parent 80356a4f02
commit 048fcdefd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -100,7 +100,7 @@ usbd_class_driver_t const *usbd_app_driver_get_cb(uint8_t *driver_count) {
#if PICO_STDIO_USB_ENABLE_RESET_VIA_BAUD_RATE #if PICO_STDIO_USB_ENABLE_RESET_VIA_BAUD_RATE
// Support for default BOOTSEL reset by changing baud rate // Support for default BOOTSEL reset by changing baud rate
void tud_cdc_line_coding_cb(uint8_t itf, cdc_line_coding_t const* p_line_coding) { void tud_cdc_line_coding_cb(__unused uint8_t itf, cdc_line_coding_t const* p_line_coding) {
if (p_line_coding->bit_rate == PICO_STDIO_USB_RESET_MAGIC_BAUD_RATE) { if (p_line_coding->bit_rate == PICO_STDIO_USB_RESET_MAGIC_BAUD_RATE) {
#ifdef PICO_STDIO_USB_RESET_BOOTSEL_ACTIVITY_LED #ifdef PICO_STDIO_USB_RESET_BOOTSEL_ACTIVITY_LED
const uint gpio_mask = 1u << PICO_STDIO_USB_RESET_BOOTSEL_ACTIVITY_LED; const uint gpio_mask = 1u << PICO_STDIO_USB_RESET_BOOTSEL_ACTIVITY_LED;

View File

@ -115,12 +115,11 @@ const uint8_t *tud_descriptor_device_cb(void) {
return (const uint8_t *)&usbd_desc_device; return (const uint8_t *)&usbd_desc_device;
} }
const uint8_t *tud_descriptor_configuration_cb(uint8_t index) { const uint8_t *tud_descriptor_configuration_cb(__unused uint8_t index) {
(void)index;
return usbd_desc_cfg; return usbd_desc_cfg;
} }
const uint16_t *tud_descriptor_string_cb(uint8_t index, uint16_t langid) { const uint16_t *tud_descriptor_string_cb(uint8_t index, __unused uint16_t langid) {
#define DESC_STR_MAX (20) #define DESC_STR_MAX (20)
static uint16_t desc_str[DESC_STR_MAX]; static uint16_t desc_str[DESC_STR_MAX];