[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`.
This commit is contained in:
Ben Avison 2022-08-24 19:53:12 +01:00
parent e5355d0335
commit 6dfc857b91
2 changed files with 4 additions and 4 deletions

View File

@ -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;

View File

@ -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 {