I'm a little new at this so hoping someone can provide some guidance. I'm trying to run MicroPython as a static library on a small iot device that has no console access. While the device isn't executing a script its running an application doing whatever else it needs to do. However, the iot device can download a string (the script) at anytime based user's configuration and/or behavior.
When the iot device downloads a script, I want to be able to pass that script to MP to run. What is the minimal setup that MP needs to do to be able to run this script and then shut down? I don't have any concern about doing this every time a script needs to run but want to make sure I'm init-ing and deinit-ing everything properly. Thanks
Code: Select all
mp_stack_set_limit(...)
gc_init(...)
mp_init()
do_str("for i in range(10):\r\n x=i", MP_PARSE_FILE_INPUT); #this would be my script
mp_deinit()