summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2020-08-04 12:39:55 -0500
committerJeff Epler <jepler@gmail.com>2020-08-04 14:45:45 -0500
commita85b6441fc6373689d793cd0904382464a5d58b7 (patch)
tree55e8760491170c16fbd512f38c5301981a867908 /main.c
parent024c8da57869b2aa49004f091520aaf5dacb26e6 (diff)
main: Drop "double extension" detection if not FULL_BUILD
This saves nearly 200 bytes. Curiously, it also saves RAM.
Diffstat (limited to 'main.c')
-rwxr-xr-xmain.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main.c b/main.c
index 11399bbb5..1363ce636 100755
--- a/main.c
+++ b/main.c
@@ -257,20 +257,24 @@ bool run_code_py(safe_mode_t safe_mode) {
new_status_color(MAIN_RUNNING);
static const char *supported_filenames[] = STRING_LIST("code.txt", "code.py", "main.py", "main.txt");
+ #if CIRCUITPY_FULL_BUILD
static const char *double_extension_filenames[] = STRING_LIST("code.txt.py", "code.py.txt", "code.txt.txt","code.py.py",
"main.txt.py", "main.py.txt", "main.txt.txt","main.py.py");
+ #endif
stack_resize();
filesystem_flush();
supervisor_allocation* heap = allocate_remaining_memory();
start_mp(heap);
found_main = maybe_run_list(supported_filenames, &result);
+ #if CIRCUITPY_FULL_BUILD
if (!found_main){
found_main = maybe_run_list(double_extension_filenames, &result);
if (found_main) {
serial_write_compressed(translate("WARNING: Your code filename has two extensions\n"));
}
}
+ #endif
cleanup_after_vm(heap);
if (result.return_code & PYEXEC_FORCED_EXIT) {