Commit Graph

21 Commits

Author SHA1 Message Date
Damien George
71d40f132d esp8266: Zero out fs_user_mount state on (soft) reset.
Otherwise device stays mounted on soft reset and leads to corruption
(since block device object is now gone).
2016-03-28 13:28:41 +03:00
Paul Sokolovsky
53302f1616 esp8266: Set up UART handling task soon into init process.
Otherwise, events may be posted to non-initialized task, which leads to
segfaults.
2016-03-27 14:33:17 +03:00
Paul Sokolovsky
a0cd118b14 esp8266/main: Module to run on boot is "boot", not "main". 2016-03-08 12:37:24 +07:00
Paul Sokolovsky
db984b73f3 esp8266: Enable stack overflow checking. 2016-03-07 14:15:00 +07:00
Paul Sokolovsky
d3a4d39687 esp8266: Support raising KeyboardInterrupt on Ctrl+C. 2016-03-05 22:01:27 +02:00
Damien George
1febaf3ac3 esp8266: Change "soft reboot" message to work with pyboard.py. 2016-03-02 22:58:48 +02:00
Damien George
84b245f187 lib/utils: Add pyexec_frozen_module to load and execute frozen module.
This is a convenience function similar to pyexec_file.  It should be used
instead of raw mp_parse_compile_execute because the latter does not catch
and report exceptions.
2015-12-26 12:32:33 +00:00
Damien George
40274fec9c lib/pyexec: Move header pyexec.h from stmhal directory. 2015-11-09 13:13:09 +00:00
Damien George
731f359292 all: Add py/mphal.h and use it in all ports.
py/mphal.h contains declarations for generic mp_hal_XXX functions, such
as stdio and delay/ticks, which ports should provide definitions for.  A
port will also provide mphalport.h with further HAL declarations.
2015-10-31 19:14:30 +03:00
Paul Sokolovsky
5699fc9d0e esp8266: Switch to standard mp_hal_delay_us() MPHAL function. 2015-10-29 02:06:58 +03:00
Josef Gajdusek
967f3230f5 esp8266: Move initialization to system_init_done_cb
Initializing too early caused some of the API functions (wifi_*) to fail
when called in main.py
2015-05-26 22:22:08 +03:00
Josef Gajdusek
bda7041294 esp8266: Add support for frozen modules 2015-05-06 22:04:20 +01:00
Josef Gajdusek
28076f3d4b esp8266: Fix garbage collector by hard-coding stack end address.
As user_init() is not a true main functions, the stack pointer captured within
is not pointing at the base of the stack. This caused gc_collect being called
with sp being higher than stack_end, causing integer overflow and crashing as
gc tried to scan almost the entire address space.
2015-05-06 14:01:07 +01:00
Damien George
c98c128fe8 pyexec: Make raw REPL work with event-driven version of pyexec.
esp8266 port now has working raw and friendly REPL, as well as working
soft reset (CTRL-D at REPL, or raise SystemExit).

tools/pyboard.py now works with esp8266 port.
2015-05-06 00:02:58 +01:00
Damien George
0bfc7638ba py: Protect mp_parse and mp_compile with nlr push/pop block.
To enable parsing constants more efficiently, mp_parse should be allowed
to raise an exception, and mp_compile can already raise a MemoryError.
So these functions need to be protected by an nlr push/pop block.

This patch adds that feature in all places.  This allows to simplify how
mp_parse and mp_compile are called: they now raise an exception if they
have an error and so explicit checking is not needed anymore.
2015-02-07 18:33:58 +00:00
Paul Sokolovsky
f12ea7c7ed esp8266: Implement task-based, event-driven interface with UART.
This enables proper interfacing with underlying OS - MicroPython doesn't
run the main loop, OS does, MicroPython just gets called when some event
takes place.
2015-01-16 19:20:17 +02:00
Paul Sokolovsky
c6b8750c14 esp8266: Use dedicated heap allocated as static array.
We cannot assume that all memory belongs to us - it actually belongs to
ESP8266 OS.
2015-01-15 00:36:03 +02:00
Damien George
b4b10fd350 py: Put all global state together in state structures.
This patch consolidates all global variables in py/ core into one place,
in a global structure.  Root pointers are all located together to make
GC tracing easier and more efficient.
2015-01-07 20:33:00 +00:00
Damien George
fe7d542352 esp8266: Prefix includes with py/; remove need for -I../py. 2015-01-01 21:16:58 +00:00
Damien George
fbea810043 esp8266: Change bignum from mpz to longlong; move some rodata to iram.
Some rodata items can go in iram/irom segment, but not others.  With
this patch ESP now has 24256 bytes of heap ram.  It passes 228 out of
248 tests from tests/basics directory.
2014-11-28 14:58:25 +00:00
Damien George
075d597464 esp8266: New port of Micro Python to ESP8266 wifi module. 2014-11-27 20:30:33 +00:00