Fix rp2 safe mode via reset press
The picodvi PR #7880 switched the saved word to the watchdog register since it reworked the RAM layout. This works for reset_into_safe_mode because the watchdog scratch registers are preserved by soft resets. They *aren't* preserved for pressing the reset button. So it broken manual safe mode. Switch back to using RAM to store the saved word but use the pico-sdks "uninitialized" designation instead of a fixed location. Also fixes USB host feather status neopixel by setting the power pin.
This commit is contained in:
parent
5dc2b168d7
commit
4e01674cbd
@ -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)
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user