diff options
| author | Ben Avison <[email protected]> | 2022-08-24 19:53:12 +0100 |
|---|---|---|
| committer | Ben Avison <[email protected]> | 2022-09-12 18:46:09 +0100 |
| commit | 6dfc857b916855e57a15813f423987449dd1a935 (patch) | |
| tree | ff2f95fbfe2f9548767e18dbf6732091cc97a2b5 /src | |
| parent | e5355d0335082541ae47b128add049a9d91ec070 (diff) | |
[rp2040] Explicit cast value of `hw_set_alias`
Some compilers don't support the GNU extension `typeof` so their definitions
of `hw_set_alias` can't inherit their type from their argument, and the best
we can do is have `hw_set_alias` act the same as `hw_set_alias_untyped`.
This requires an explicit cast when the macro is used instead, otherwise
IAR generates error Pe132 'expression must have pointer-to-struct-or-union
type but it has type "void *"'.
The same goes for `hw_clear_alias`.
Diffstat (limited to 'src')
| -rw-r--r-- | src/portable/raspberrypi/rp2040/dcd_rp2040.c | 4 | ||||
| -rw-r--r-- | src/portable/raspberrypi/rp2040/hcd_rp2040.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/portable/raspberrypi/rp2040/dcd_rp2040.c b/src/portable/raspberrypi/rp2040/dcd_rp2040.c index 2003f72fd..89fd6b82d 100644 --- a/src/portable/raspberrypi/rp2040/dcd_rp2040.c +++ b/src/portable/raspberrypi/rp2040/dcd_rp2040.c @@ -46,8 +46,8 @@ /* Low level controller *------------------------------------------------------------------*/ -#define usb_hw_set hw_set_alias(usb_hw) -#define usb_hw_clear hw_clear_alias(usb_hw) +#define usb_hw_set ((usb_hw_t *)hw_set_alias(usb_hw)) +#define usb_hw_clear ((usb_hw_t *)hw_clear_alias(usb_hw)) // Init these in dcd_init static uint8_t *next_buffer_ptr; diff --git a/src/portable/raspberrypi/rp2040/hcd_rp2040.c b/src/portable/raspberrypi/rp2040/hcd_rp2040.c index e9118c6a3..5badb261a 100644 --- a/src/portable/raspberrypi/rp2040/hcd_rp2040.c +++ b/src/portable/raspberrypi/rp2040/hcd_rp2040.c @@ -56,8 +56,8 @@ static_assert(PICO_USB_HOST_INTERRUPT_ENDPOINTS <= USB_MAX_ENDPOINTS, ""); static struct hw_endpoint ep_pool[1 + PICO_USB_HOST_INTERRUPT_ENDPOINTS]; #define epx (ep_pool[0]) -#define usb_hw_set hw_set_alias(usb_hw) -#define usb_hw_clear hw_clear_alias(usb_hw) +#define usb_hw_set ((usb_hw_t *)hw_set_alias(usb_hw)) +#define usb_hw_clear ((usb_hw_t *)hw_clear_alias(usb_hw)) // Flags we set by default in sie_ctrl (we add other bits on top) enum { |
