@@ -118,7 +118,6 @@ void reset_mp(void) {
118
118
reset_status_led ();
119
119
new_status_color (0x8f008f );
120
120
autoreload_stop ();
121
- autoreload_enable ();
122
121
123
122
// Sync the file systems in case any used RAM from the GC to cache. As soon
124
123
// 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) {
249
248
mp_hal_stdout_tx_str ("Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.\r\n" );
250
249
} else if (safe_mode != NO_SAFE_MODE ) {
251
250
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" );
252
253
}
253
254
}
254
255
#endif
@@ -320,10 +321,12 @@ bool start_mp(safe_mode_t safe_mode) {
320
321
mp_hal_stdout_tx_str ("\r\n\r\n" );
321
322
}
322
323
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
+ }
327
330
}
328
331
if (safe_mode != NO_SAFE_MODE ) {
329
332
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) {
618
621
for (;;) {
619
622
if (!skip_repl ) {
620
623
// The REPL mode can change, or it can request a reload.
624
+ bool autoreload_on = autoreload_is_enabled ();
621
625
autoreload_disable ();
622
626
new_status_color (REPL_RUNNING );
623
627
if (pyexec_mode_kind == PYEXEC_MODE_RAW_REPL ) {
624
628
exit_code = pyexec_raw_repl ();
625
629
} else {
626
630
exit_code = pyexec_friendly_repl ();
627
631
}
632
+ if (autoreload_on ) {
633
+ autoreload_enable ();
634
+ }
628
635
reset_samd21 ();
629
636
reset_mp ();
630
637
}
0 commit comments