summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2024-11-14 12:46:51 +0700
committerGitHub <[email protected]>2024-11-14 12:46:51 +0700
commit0569188aed17d19d5954f1e1b911e989814ec93d (patch)
tree55ad84806b5d183daf1e7ca806a1b209203bbffa
parent7e1c91fac2341f3f8e18452428340ff3277a55ec (diff)
parent394045f5960d9e9f1fe85f605b9f113c4a162d4e (diff)
Merge pull request #2869 from subsonicpulse/master
Fix Usage of Bootsel Button for Pico 2
-rw-r--r--hw/bsp/rp2040/family.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/hw/bsp/rp2040/family.c b/hw/bsp/rp2040/family.c
index ccc1e1f70..452a5568f 100644
--- a/hw/bsp/rp2040/family.c
+++ b/hw/bsp/rp2040/family.c
@@ -79,7 +79,13 @@ bool __no_inline_not_in_flash_func(get_bootsel_button)(void) {
// The HI GPIO registers in SIO can observe and control the 6 QSPI pins.
// Note the button pulls the pin *low* when pressed.
- bool button_state = (sio_hw->gpio_hi_in & (1u << CS_PIN_INDEX));
+
+ #ifdef __ARM_ARCH_6M__ // CM0 for rp2040
+ #define CS_BIT (1u << 1)
+ #else // rp2350 (cm33/risv)
+ #define CS_BIT SIO_GPIO_HI_IN_QSPI_CSN_BITS
+ #endif
+ bool button_state = (sio_hw->gpio_hi_in & CS_BIT);
// Need to restore the state of chip select, else we are going to have a
// bad time when we return to code in flash!