diff options
| author | Scott Shawcroft <scott.shawcroft@gmail.com> | 2018-05-24 13:12:18 -0700 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2018-07-31 05:18:03 -0700 |
| commit | 777542c716e07e78439c3c6bbf442722ebaaecc6 (patch) | |
| tree | 2882c68c4d9655e52d9741d4ef5808ed8758a228 /shared-bindings | |
| parent | bf033123a7fa75394fd7a01d17ec99afd9abe645 (diff) | |
Add basic memory allocation outside Python runtime
This allows for the heap to fill all space but the stack. It also
allows us to designate space for memory outside the runtime for
things such as USB descriptors, flash cache and main filename.
Fixes #754
Diffstat (limited to 'shared-bindings')
| -rwxr-xr-x[-rw-r--r--] | shared-bindings/supervisor/__init__.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/shared-bindings/supervisor/__init__.c b/shared-bindings/supervisor/__init__.c index e6429be32..619af5a35 100644..100755 --- a/shared-bindings/supervisor/__init__.c +++ b/shared-bindings/supervisor/__init__.c @@ -31,7 +31,7 @@ #include "supervisor/shared/autoreload.h" #include "supervisor/shared/rgb_led_status.h" - + #include "shared-bindings/supervisor/__init__.h" #include "shared-bindings/supervisor/Runtime.h" @@ -107,6 +107,15 @@ STATIC mp_obj_t supervisor_reload(void) { } MP_DEFINE_CONST_FUN_OBJ_0(supervisor_reload_obj, supervisor_reload); +//| .. method:: set_main_file(filename) +//| +//| Set which file to run after a reload. +//| +STATIC mp_obj_t supervisor_set_main_file(void) { + + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_0(supervisor_set_main_file_obj, supervisor_set_main_file); STATIC const mp_rom_map_elem_t supervisor_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_supervisor) }, @@ -115,6 +124,8 @@ STATIC const mp_rom_map_elem_t supervisor_module_globals_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_set_rgb_status_brightness), MP_ROM_PTR(&supervisor_set_rgb_status_brightness_obj) }, { MP_ROM_QSTR(MP_QSTR_runtime), MP_ROM_PTR(&common_hal_supervisor_runtime_obj) }, { MP_ROM_QSTR(MP_QSTR_reload), MP_ROM_PTR(&supervisor_reload_obj) }, + { MP_ROM_QSTR(MP_QSTR_set_main_file), MP_ROM_PTR(&supervisor_set_main_file_obj) }, + }; STATIC MP_DEFINE_CONST_DICT(supervisor_module_globals, supervisor_module_globals_table); |
