Merge pull request #4779 from tannewt/fix_sm_rp2040

Fix safe mode on rp2040
This commit is contained in:
Dan Halbert 2021-05-19 14:21:08 -04:00 committed by GitHub
commit 1d39be4954
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -482,7 +482,7 @@ jobs:
id: idf-cache id: idf-cache
with: with:
path: ${{ github.workspace }}/.idf_tools path: ${{ github.workspace }}/.idf_tools
key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20210422 key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20210518
- name: Clone IDF submodules - name: Clone IDF submodules
run: | run: |
(cd $IDF_PATH && git submodule update --init) (cd $IDF_PATH && git submodule update --init)

View File

@ -196,13 +196,13 @@ uint32_t *port_heap_get_top(void) {
return port_stack_get_top(); return port_stack_get_top();
} }
extern uint32_t __scratch_x_start__;
void port_set_saved_word(uint32_t value) { void port_set_saved_word(uint32_t value) {
// NOTE: This doesn't survive pressing the reset button (aka toggling RUN). __scratch_x_start__ = value;
watchdog_hw->scratch[0] = value;
} }
uint32_t port_get_saved_word(void) { uint32_t port_get_saved_word(void) {
return watchdog_hw->scratch[0]; return __scratch_x_start__;
} }
uint64_t port_get_raw_ticks(uint8_t *subticks) { uint64_t port_get_raw_ticks(uint8_t *subticks) {

View File

@ -78,7 +78,7 @@ safe_mode_t wait_for_safe_mode_reset(void) {
#endif #endif
uint64_t start_ticks = supervisor_ticks_ms64(); uint64_t start_ticks = supervisor_ticks_ms64();
uint64_t diff = 0; uint64_t diff = 0;
while (diff < 700) { while (diff < 1000) {
#ifdef MICROPY_HW_LED_STATUS #ifdef MICROPY_HW_LED_STATUS
// Blink on for 100, off for 100, on for 100, off for 100 and on for 200 // Blink on for 100, off for 100, on for 100, off for 100 and on for 200
common_hal_digitalio_digitalinout_set_value(&status_led, diff > 100 && diff / 100 != 2 && diff / 100 != 4); common_hal_digitalio_digitalinout_set_value(&status_led, diff > 100 && diff / 100 != 2 && diff / 100 != 4);