Skip to content

Commit e4d3ab3

Browse files
sebromerodpgeorge
authored andcommitted
nrf/main: Add /flash and /flash/lib to sys.path.
This allows to follow good practice and have libraries live in the lib folder which means they will be found by the runtime without adding this path manually at runtime. Signed-off-by: Sebastian Romero <s.romero@arduino.cc>
1 parent d69e69a commit e4d3ab3

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

ports/nrf/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ int main(int argc, char **argv) {
191191

192192
if (ret != 0) {
193193
printf("MPY: can't mount flash\n");
194+
} else {
195+
mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR__slash_flash));
196+
mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR__slash_flash_slash_lib));
194197
}
195198
#endif
196199

ports/nrf/qstrdefsport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
// Entries for sys.path
3131
Q(/flash)
32+
Q(/flash/lib)
3233

3334
// For os.sep
3435
Q(/)

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