probably due to gc_collect (we suspect that transpiled C does not have
access to javascript variables preventing it from collecting all
required roots and leading to deleting objects prematuraly). Enabling
PyStack reduces the use of the heap and fixes the bug.
A SandboxController is now pushed on the StackViewController and sets the
KDIonContext::sharedContext before drawing, sets a white background and handles
user input after the Python computation to dismiss the drawing screen.
Change-Id: I51b0474365a85e845227379a16d090541fa8ded7
Micropython did not work because of two problems:
- the stack in ascending order on emscripten
- if optimized, some variables may be stored in local JavaScript
variables, which breaks garbage collection.
Change-Id: Ib454e0c4d995e9f5f85370eea758526119b35773
When running a script with infinite recursion, micropython now throws an
error instead of aborting and rebooting the device.
Change-Id: Icd409e56de58a48b25b6bdb30eea1e70b344cc14
On the device, the stack is stored in reverse order, but it might not be
the case on other platforms, which changes stack length computation.
Change-Id: I0218224a77465b9672f137771c00f734fdfaea64
A script can now be imported in the console.
Moved all the MicroPython functions to python/port files.
Change-Id: I0a23e8cb20005719b800e81470e1c574c702c3b7