Content-Length: 277730 | pFad | http://github.com/adafruit/circuitpython/commit/d7cf11d3ef736ceb56b950279163d889bf83040d

FA Add repl.py support · adafruit/circuitpython@d7cf11d · GitHub
Skip to content

Commit d7cf11d

Browse files
committedAug 28, 2023
Add repl.py support
1 parent adfd90f commit d7cf11d

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed
 

Diff for: ‎README.rst

+2
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ Behavior
133133
``code.py`` **in the REPL anymore, as the REPL is a fresh vm.** CircuitPython's goal for this
134134
change includes reducing confusion about pins and memory being used.
135135
- 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
136138
- Autoreload state will be maintained across reload.
137139

138140
- Adds a safe mode that does not run user code after a hard crash or brown out. This makes it

Diff for: ‎main.c

+5
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,11 @@ STATIC int run_repl(safe_mode_t safe_mode) {
929929

930930
autoreload_suspend(AUTORELOAD_SUSPEND_REPL);
931931

932+
if (get_safe_mode() == SAFE_MODE_NONE) {
933+
const char *const filenames[] = { "repl.py" };
934+
(void)maybe_run_list(filenames, MP_ARRAY_SIZE(filenames));
935+
}
936+
932937
// Set the status LED to the REPL color before running the REPL. For
933938
// NeoPixels and DotStars this will be sticky but for PWM or single LED it
934939
// won't. This simplifies pin sharing because they won't be in use when

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/adafruit/circuitpython/commit/d7cf11d3ef736ceb56b950279163d889bf83040d

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy