From 417677aae40469594ba69b70a41d988522c5ec96 Mon Sep 17 00:00:00 2001 From: Jerzy Kasenberg Date: Thu, 23 Sep 2021 12:32:17 +0200 Subject: [PATCH] da14695_dk_usb: Fix button configuration Unlike da1469x_dk_pro, K1 pin (6) is connected to VCC when active. This adds required pull down and reverses active logic state. --- hw/bsp/da14695_dk_usb/da14695_dk_usb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/bsp/da14695_dk_usb/da14695_dk_usb.c b/hw/bsp/da14695_dk_usb/da14695_dk_usb.c index bdb30e0e..95fe70d0 100644 --- a/hw/bsp/da14695_dk_usb/da14695_dk_usb.c +++ b/hw/bsp/da14695_dk_usb/da14695_dk_usb.c @@ -68,7 +68,7 @@ void board_init(void) hal_gpio_init_out(5, 0); // Button - hal_gpio_init_in(BUTTON_PIN, HAL_GPIO_PULL_NONE); + hal_gpio_init_in(BUTTON_PIN, HAL_GPIO_PULL_DOWN); // 1ms tick timer SysTick_Config(SystemCoreClock / 1000); @@ -101,8 +101,8 @@ void board_led_write(bool state) uint32_t board_button_read(void) { - // button is active LOW - return hal_gpio_read(BUTTON_PIN) ^ 1; + // button is active HIGH + return hal_gpio_read(BUTTON_PIN); } int board_uart_read(uint8_t* buf, int len)