Skip to content

Commit

Permalink
cpu/rpx0xx: fix C++ compatibility for gpio
Browse files Browse the repository at this point in the history
  • Loading branch information
fabian18 committed Jul 27, 2021
1 parent f7127fa commit e9a1c61
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cpu/rpx0xx/include/periph_cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,8 @@ static inline volatile uint32_t * gpio_pad_register(uint8_t pin)
*/
static inline void gpio_set_pad_config(uint8_t pin, gpio_pad_ctrl_t config)
{
*(volatile gpio_pad_ctrl_t*)gpio_pad_register(pin) = config;
uint32_t *c = (uint32_t *)&config;
*gpio_pad_register(pin) = *c;
}

/**
Expand All @@ -433,7 +434,8 @@ static inline volatile uint32_t * gpio_io_register(uint8_t pin)
*/
static inline void gpio_set_io_config(uint8_t pin, gpio_io_ctrl_t config)
{
*(volatile gpio_io_ctrl_t*)gpio_io_register(pin) = config;
uint32_t *c = (uint32_t *)&config;
*gpio_io_register(pin) = *c;
}

/**
Expand Down

0 comments on commit e9a1c61

Please sign in to comment.