From bf1329bb1ff2de70469edfd010b20ec39d528030 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 16 Mar 2022 12:36:52 -0400 Subject: [PATCH] fix ReloadException when in REPL --- supervisor/shared/reload.c | 2 +- supervisor/shared/usb/usb_msc_flash.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/supervisor/shared/reload.c b/supervisor/shared/reload.c index f30d4249e2..e1ae2e6764 100644 --- a/supervisor/shared/reload.c +++ b/supervisor/shared/reload.c @@ -80,7 +80,7 @@ inline bool autoreload_is_enabled() { } void autoreload_trigger() { - if (autoreload_enabled) { + if (autoreload_enabled & !autoreload_suspended) { last_autoreload_trigger = supervisor_ticks_ms32(); // Guard against the rare time that ticks is 0; if (last_autoreload_trigger == 0) { diff --git a/supervisor/shared/usb/usb_msc_flash.c b/supervisor/shared/usb/usb_msc_flash.c index 67d57bceb5..f1830332d4 100644 --- a/supervisor/shared/usb/usb_msc_flash.c +++ b/supervisor/shared/usb/usb_msc_flash.c @@ -216,8 +216,8 @@ void tud_msc_write10_complete_cb(uint8_t lun) { (void)lun; // This write is complete; initiate an autoreload. - autoreload_trigger(); autoreload_resume(AUTORELOAD_SUSPEND_USB); + autoreload_trigger(); } // Invoked when received SCSI_CMD_INQUIRY