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>
This commit is contained in:
Sebastian Romero 2023-12-21 17:42:19 +01:00 committed by Damien George
parent d69e69adb6
commit e4d3ab3304
2 changed files with 4 additions and 0 deletions

View File

@ -191,6 +191,9 @@ soft_reset:
if (ret != 0) { if (ret != 0) {
printf("MPY: can't mount flash\n"); printf("MPY: can't mount flash\n");
} else {
mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR__slash_flash));
mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR__slash_flash_slash_lib));
} }
#endif #endif

View File

@ -29,6 +29,7 @@
// Entries for sys.path // Entries for sys.path
Q(/flash) Q(/flash)
Q(/flash/lib)
// For os.sep // For os.sep
Q(/) Q(/)