raspberrypi / tinyusb

MIT License
69 stars 18 forks source link

Mark `in_isr` as unused in osal_pico.h #12

Closed jonathangjertsen closed 3 years ago

jonathangjertsen commented 3 years ago

This prevents the following warning when building with -Wextra:

In file included from [redacted]/pico-sdk/lib/tinyusb/src/osal/osal.h:57,
                 from [redacted]/pico-sdk/lib/tinyusb/src/tusb.h:38,
                 from [redacted]/pico-sdk/lib/tinyusb/src/device/usbd.c:31:
[redacted]/pico-sdk/lib/tinyusb/src/osal/osal_pico.h: In function 'osal_semaphore_post':
[redacted]/pico-sdk/lib/tinyusb/src/osal/osal_pico.h:60:71: error: unused parameter 'in_isr' [-Werror=unused-parameter]
   60 | static inline bool osal_semaphore_post(osal_semaphore_t sem_hdl, bool in_isr)
      |                                                                       ^
In file included from [redacted]/pico-sdk/lib/tinyusb/src/osal/osal.h:57,
                 from [redacted]/pico-sdk/lib/tinyusb/src/tusb.h:38,
                 from [redacted]/pico-sdk/lib/tinyusb/src/device/usbd.c:31:
[redacted]/pico-sdk/lib/tinyusb/src/osal/osal_pico.h: In function 'osal_queue_send':
[redacted]/pico-sdk/lib/tinyusb/src/osal/osal_pico.h:162:79: error: unused parameter 'in_isr' [-Werror=unused-parameter]
  162 | static inline bool osal_queue_send(osal_queue_t qhdl, void const * data, bool in_isr)
      |

Casting unused arguments to void is how unused parameters are dealt with in the rest of the tinyusb codebase

jonathangjertsen commented 3 years ago

Oops, there are a few other places that have the same issue. I will fix them all and amend the commit

aallan commented 3 years ago

At some point in the near future we'll be switching to use upstream version of tinyusb (see raspberrypi/pico-sdk#321 ), so any PRs should probably be made to the upstream repo, https://github.com/hathach/tinyusb.

jonathangjertsen commented 3 years ago

OK. I can't get my application to compile with the upstream tinyusb, so I'll hold off until the switch is complete.