Skip to content

Commit

Permalink
Merge pull request RIOT-OS#16685 from fabian18/cpu_rp2040_fix_gpio_wa…
Browse files Browse the repository at this point in the history
…rnings

cpu/rpx0xx: fix minor gpio warnings
  • Loading branch information
benpicco authored Jul 27, 2021
2 parents 666a457 + e9a1c61 commit 9645950
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cpu/rpx0xx/include/periph_cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ extern "C" {
* @note The RPX0XX MCU family only has a single GPIO port. Still the API requires a
* port parameter, which is currently ignored.
*/
#define GPIO_PIN(port, pin) (pin)
#define GPIO_PIN(port, pin) ((((port) & 0)) | (pin))

/**
* @brief Overwrite the default gpio_t type definition
Expand Down 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 9645950

Please sign in to comment.