This is an automated email from the ASF dual-hosted git repository.
xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 88a6d2ed372 boards/nrf5340-dk: read the button being scanned, not BTN1
88a6d2ed372 is described below
commit 88a6d2ed372a2e3c90b8462dfff2ea02d7b470f1
Author: AlmAck <[email protected]>
AuthorDate: Sat Aug 29 19:00:30 2026 +0200
boards/nrf5340-dk: read the button being scanned, not BTN1
board_buttons() loops over the four buttons but read the GPIO of
g_buttons[BUTTON_BTN1] on every iteration, so all four bits of the
returned set reflected the state of button 1 alone.
Matches the equivalent loop in nrf52840-dk's nrf52_buttons.c.
Signed-off-by: AlmAck <[email protected]>
---
boards/arm/nrf53/nrf5340-dk/src/nrf53_buttons.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/boards/arm/nrf53/nrf5340-dk/src/nrf53_buttons.c
b/boards/arm/nrf53/nrf5340-dk/src/nrf53_buttons.c
index 6dede0ca17a..7d9cfebfd26 100644
--- a/boards/arm/nrf53/nrf5340-dk/src/nrf53_buttons.c
+++ b/boards/arm/nrf53/nrf5340-dk/src/nrf53_buttons.c
@@ -101,7 +101,7 @@ uint32_t board_buttons(void)
{
/* A LOW value means that the key is pressed. */
- bool released = nrf53_gpio_read(g_buttons[BUTTON_BTN1]);
+ bool released = nrf53_gpio_read(g_buttons[i]);
/* Accumulate the set of depressed (not released) keys */