Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix safe mode on rp2040 #4779

Merged
merged 2 commits into from
May 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ jobs:
id: idf-cache
with:
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
run: |
(cd $IDF_PATH && git submodule update --init)
Expand Down
6 changes: 3 additions & 3 deletions ports/raspberrypi/supervisor/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,13 @@ uint32_t *port_heap_get_top(void) {
return port_stack_get_top();
}

extern uint32_t __scratch_x_start__;
void port_set_saved_word(uint32_t value) {
// NOTE: This doesn't survive pressing the reset button (aka toggling RUN).
watchdog_hw->scratch[0] = value;
__scratch_x_start__ = value;
}

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) {
Expand Down
2 changes: 1 addition & 1 deletion supervisor/shared/safe_mode.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ safe_mode_t wait_for_safe_mode_reset(void) {
#endif
uint64_t start_ticks = supervisor_ticks_ms64();
uint64_t diff = 0;
while (diff < 700) {
while (diff < 1000) {
#ifdef MICROPY_HW_LED_STATUS
// 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);
Expand Down