File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,8 @@ Behavior
133
133
``code.py `` **in the REPL anymore, as the REPL is a fresh vm. ** CircuitPython's goal for this
134
134
change includes reducing confusion about pins and memory being used.
135
135
- After the main code is finished the REPL can be entered by pressing any key.
136
+ - If the file ``repl.py `` exists, it is executed before the REPL Prompt is shown
137
+ - In safe mode this functionality is disabled, to ensure the REPL Prompt can always be reached
136
138
- Autoreload state will be maintained across reload.
137
139
138
140
- Adds a safe mode that does not run user code after a hard crash or brown out. This makes it
@@ -155,7 +157,7 @@ Behavior
155
157
- Re-runs ``code.py `` or other main file after file system writes by a workflow. (Disable with
156
158
``supervisor.disable_autoreload() ``)
157
159
- Autoreload is disabled while the REPL is active.
158
- - ``code.py `` may also be named``code.txt``, ``main.py ``, or ``main.txt ``.
160
+ - ``code.py `` may also be named ``code.txt ``, ``main.py ``, or ``main.txt ``.
159
161
- ``boot.py `` may also be named ``boot.txt ``.
160
162
- ``safemode.py `` may also be named ``safemode.txt ``.
161
163
Original file line number Diff line number Diff line change @@ -934,6 +934,11 @@ STATIC int run_repl(safe_mode_t safe_mode) {
934
934
935
935
autoreload_suspend (AUTORELOAD_SUSPEND_REPL );
936
936
937
+ if (get_safe_mode () == SAFE_MODE_NONE ) {
938
+ const char * const filenames [] = { "repl.py" };
939
+ (void )maybe_run_list (filenames , MP_ARRAY_SIZE (filenames ));
940
+ }
941
+
937
942
// Set the status LED to the REPL color before running the REPL. For
938
943
// NeoPixels and DotStars this will be sticky but for PWM or single LED it
939
944
// won't. This simplifies pin sharing because they won't be in use when
You can’t perform that action at this time.
0 commit comments