Skip to content

Commit

Permalink
Fix issue #337 (#338)
Browse files Browse the repository at this point in the history
Reworked code for GPIO declaration.

Signed-off-by: Christophe Gerbier <[email protected]>
  • Loading branch information
Christophe Gerbier authored and josesimoes committed May 28, 2017
1 parent 06903fd commit 0e523a6
Showing 1 changed file with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,35 @@

using namespace Windows::Devices::Gpio;

stm32_gpio_t* gpioPort[] = { GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH, GPIOI, GPIOJ };
stm32_gpio_t* gpioPort[] = { GPIOA, GPIOB
#if STM32_HAS_GPIOC
, GPIOC
#endif
#if STM32_HAS_GPIOD
, GPIOD
#endif
#if STM32_HAS_GPIOE
, GPIOE
#endif
#if STM32_HAS_GPIOF
, GPIOF
#endif
#if STM32_HAS_GPIOG
, GPIOG
#endif
#if STM32_HAS_GPIOH
, GPIOH
#endif
#if STM32_HAS_GPIOI
, GPIOI
#endif
#if STM32_HAS_GPIOJ
, GPIOJ
#endif
#if STM32_HAS_GPIOK
, GPIOK
#endif
};

#define GPIO_PORT(pin) (gpioPort[(pin/16) - 1])

Expand Down

0 comments on commit 0e523a6

Please sign in to comment.