This repository was archived by the owner on Oct 28, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,9 @@ mp_import_stat_t
88
88
mp_import_stat (const char * path ) {
89
89
if (in_safe_mode ) {
90
90
// 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 ) {
92
94
return MP_IMPORT_STAT_NO_EXIST ;
93
95
}
94
96
@@ -129,8 +131,11 @@ void mp_task(void *pvParameter) {
129
131
gc_init (mp_task_heap , mp_task_heap + sizeof (mp_task_heap ));
130
132
mp_init ();
131
133
mp_obj_list_init (mp_sys_path , 0 );
134
+ // library-path '' is needed for the internal modules.
132
135
mp_obj_list_append (mp_sys_path , MP_OBJ_NEW_QSTR (MP_QSTR_ ));
133
136
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 ));
134
139
mp_obj_list_init (mp_sys_argv , 0 );
135
140
readline_init0 ();
136
141
Original file line number Diff line number Diff line change 27
27
28
28
try :
29
29
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 ()
30
36
__import__ (splash )
31
37
else :
32
38
ugfx .clear (ugfx .WHITE )
Original file line number Diff line number Diff line change 28
28
29
29
// Entries for sys.path
30
30
Q (/lib )
31
+ Q (/bpp /lib )
32
+ Q (/sdcard /lib )
You can’t perform that action at this time.
0 commit comments