@@ -118,7 +118,6 @@ void reset_mp(void) {
118118 reset_status_led ();
119119 new_status_color (0x8f008f );
120120 autoreload_stop ();
121- autoreload_enable ();
122121
123122 // Sync the file systems in case any used RAM from the GC to cache. As soon
124123 // as we re-init the GC all bets are off on the cache.
@@ -249,6 +248,8 @@ bool start_mp(safe_mode_t safe_mode) {
249248 mp_hal_stdout_tx_str ("Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.\r\n" );
250249 } else if (safe_mode != NO_SAFE_MODE ) {
251250 mp_hal_stdout_tx_str ("Running in safe mode! Auto-reload is off.\r\n" );
251+ } else if (!autoreload_is_enabled ()) {
252+ mp_hal_stdout_tx_str ("Auto-reload is off.\r\n" );
252253 }
253254 }
254255 #endif
@@ -320,10 +321,12 @@ bool start_mp(safe_mode_t safe_mode) {
320321 mp_hal_stdout_tx_str ("\r\n\r\n" );
321322 }
322323
323- if (!cdc_enabled_at_start && autoreload_is_enabled ()) {
324- mp_hal_stdout_tx_str ("Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.\r\n" );
325- } else {
326- mp_hal_stdout_tx_str ("Auto-reload is off.\r\n" );
324+ if (!cdc_enabled_at_start ) {
325+ if (autoreload_is_enabled ()) {
326+ mp_hal_stdout_tx_str ("Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.\r\n" );
327+ } else {
328+ mp_hal_stdout_tx_str ("Auto-reload is off.\r\n" );
329+ }
327330 }
328331 if (safe_mode != NO_SAFE_MODE ) {
329332 mp_hal_stdout_tx_str ("\r\nYou are running in safe mode which means something really bad happened.\r\n" );
@@ -618,13 +621,17 @@ int main(void) {
618621 for (;;) {
619622 if (!skip_repl ) {
620623 // The REPL mode can change, or it can request a reload.
624+ bool autoreload_on = autoreload_is_enabled ();
621625 autoreload_disable ();
622626 new_status_color (REPL_RUNNING );
623627 if (pyexec_mode_kind == PYEXEC_MODE_RAW_REPL ) {
624628 exit_code = pyexec_raw_repl ();
625629 } else {
626630 exit_code = pyexec_friendly_repl ();
627631 }
632+ if (autoreload_on ) {
633+ autoreload_enable ();
634+ }
628635 reset_samd21 ();
629636 reset_mp ();
630637 }
0 commit comments