Merge pull request #8170 from tannewt/fix_rp2_safe_mode

Fix rp2 safe mode via reset press
This commit is contained in:
Dan Halbert 2023-07-15 17:13:18 -04:00 committed by GitHub
commit 4a21e05ab6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -2,6 +2,7 @@
#define MICROPY_HW_MCU_NAME "rp2040"
#define MICROPY_HW_NEOPIXEL (&pin_GPIO21)
#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO20)
#define DEFAULT_I2C_BUS_SCL (&pin_GPIO3)
#define DEFAULT_I2C_BUS_SDA (&pin_GPIO2)

View File

@ -247,14 +247,15 @@ uint32_t *port_heap_get_top(void) {
return port_stack_get_top();
}
uint32_t __uninitialized_ram(saved_word);
void port_set_saved_word(uint32_t value) {
// Store in a watchdog scratch register instead of RAM. 4-7 are used by the
// sdk. 0 is used by alarm. 1-3 are free.
watchdog_hw->scratch[1] = value;
// Store in RAM because the watchdog scratch registers don't survive
// resetting by pulling the RUN pin low.
saved_word = value;
}
uint32_t port_get_saved_word(void) {
return watchdog_hw->scratch[1];
return saved_word;
}
static volatile bool ticks_enabled;