Skip to content
This repository has been archived by the owner on Dec 11, 2021. It is now read-only.

Mark in_isr as unused in osal_pico.h #12

Conversation

jonathangjertsen
Copy link

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
Copy link
Author

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

@aallan
Copy link
Contributor

aallan commented May 21, 2021

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.

This is the way unused parameters are dealt with in the rest of the
tinyusb codebase. It prevents the following warning when building
with -Wextra:

```C
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)
      |
```
@jonathangjertsen
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants