Skip to content
This repository was archived by the owner on Oct 28, 2023. It is now read-only.

Commit ed470e4

Browse files
authored
Merge pull request SHA2017-badge#228 from SHA2017-badge/basvs-apps-on-bpp-and-sdcard
Run applications from bpp and sdcard as well.
2 parents c4a5ad1 + 162bf53 commit ed470e4

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

esp32/main.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ mp_import_stat_t
8888
mp_import_stat(const char *path) {
8989
if (in_safe_mode) {
9090
// be more strict in which modules we would like to load
91-
if (strncmp(path, "/lib/", 5) != 0) {
91+
if (strncmp(path, "/lib/", 5) != 0
92+
&& strncmp(path, "/bpp/lib/", 9) != 0
93+
&& strncmp(path, "/sdcard/lib/", 12) != 0) {
9294
return MP_IMPORT_STAT_NO_EXIST;
9395
}
9496

@@ -129,8 +131,11 @@ void mp_task(void *pvParameter) {
129131
gc_init(mp_task_heap, mp_task_heap + sizeof(mp_task_heap));
130132
mp_init();
131133
mp_obj_list_init(mp_sys_path, 0);
134+
// library-path '' is needed for the internal modules.
132135
mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR_));
133136
mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR__slash_lib));
137+
mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR__slash_bpp_slash_lib));
138+
mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR__slash_sdcard_slash_lib));
134139
mp_obj_list_init(mp_sys_argv, 0);
135140
readline_init0();
136141

esp32/modules/boot.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@
2727

2828
try:
2929
if not splash=="shell":
30+
if splash.startswith('bpp '):
31+
splash = splash[4:len(splash)]
32+
badge.mount_bpp()
33+
elif splash.startswith('sdcard '):
34+
splash = splash[7:len(splash)]
35+
badge.mount_sdcard()
3036
__import__(splash)
3137
else:
3238
ugfx.clear(ugfx.WHITE)

esp32/qstrdefsport.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@
2828

2929
// Entries for sys.path
3030
Q(/lib)
31+
Q(/bpp/lib)
32+
Q(/sdcard/lib)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy