boards/nucleo64: adapt user button for nucleo-g431rb

This commit is contained in:
Alexandre Abadie 2020-09-25 16:16:26 +02:00
parent 4de05b4837
commit 0eb5c81501
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
2 changed files with 4 additions and 2 deletions

View File

@ -54,7 +54,8 @@ extern "C" {
* @{ * @{
*/ */
#define BTN0_PIN GPIO_PIN(PORT_C, 13) #define BTN0_PIN GPIO_PIN(PORT_C, 13)
#if defined(CPU_MODEL_STM32L433RC) || defined(CPU_MODEL_STM32G474RE) #if defined(CPU_MODEL_STM32L433RC) || defined(CPU_MODEL_STM32G474RE) || \
defined(CPU_MODEL_STM32G431RB)
#define BTN0_MODE GPIO_IN_PD #define BTN0_MODE GPIO_IN_PD
#else #else
#define BTN0_MODE GPIO_IN_PU #define BTN0_MODE GPIO_IN_PU

View File

@ -43,7 +43,8 @@ static const saul_gpio_params_t saul_gpio_params[] =
.name = "Button(B1 User)", .name = "Button(B1 User)",
.pin = BTN0_PIN, .pin = BTN0_PIN,
.mode = BTN0_MODE, .mode = BTN0_MODE,
#if !defined(CPU_MODEL_STM32L433RC) && !defined(CPU_MODEL_STM32G474RE) #if !defined(CPU_MODEL_STM32L433RC) && !defined(CPU_MODEL_STM32G474RE) && \
!defined(CPU_MODEL_STM32G431RB)
.flags = SAUL_GPIO_INVERTED .flags = SAUL_GPIO_INVERTED
#endif #endif
}, },