Commit Graph

81 Commits

Author SHA1 Message Date
Damien George e50cb73b7a esp8266: Enable uselect module.
Select and poll will now work on socket objects.
2016-12-02 16:44:31 +11:00
Damien George e5ef15a9d7 py/lexer: Provide generic mp_lexer_new_from_file based on mp_reader.
If a port defines MICROPY_READER_POSIX or MICROPY_READER_FATFS then
lexer.c now provides an implementation of mp_lexer_new_from_file using
the mp_reader_new_file function.
2016-11-16 18:13:51 +11:00
Damien George 6b239c271c py: Factor out persistent-code reader into separate files.
Implementations of persistent-code reader are provided for POSIX systems
and systems using FatFS.  Macros to use these are MICROPY_READER_POSIX and
MICROPY_READER_FATFS respectively.  If an alternative implementation is
needed then a port can define the function mp_reader_new_file.
2016-11-16 18:13:50 +11:00
Paul Sokolovsky 9514d847fe esp8266: Add MP_FASTCODE modifier to put a function to iRAM.
It can be used in the following manner:

void MP_FASTCODE(foo)(int arg) { ... }
2016-10-19 00:20:10 +03:00
Paul Sokolovsky a97284423e extmod/utime_mphal: Factor out implementations in terms of mp_hal_* for reuse.
As long as a port implement mp_hal_sleep_ms(), mp_hal_ticks_ms(), etc.
functions, it can just use standard implementations of utime.sleel_ms(),
utime.ticks_ms(), etc. Python-level functions.
2016-10-14 20:14:01 +03:00
Damien George ed878275b0 esp8266: Enable micropython.alloc_emergency_exception_buf(). 2016-10-14 01:27:53 +11:00
Damien George af8d791bd0 esp8266: Enable importing of precompiled .mpy files. 2016-10-12 11:03:58 +11:00
Damien George 11fc6553e8 esp8266: Enable sys.{stdin,stdout,stderr}.buffer for raw serial access. 2016-10-12 11:03:58 +11:00
Radomir Dopieralski db4e009217 esp8266/mpconfigport: Enable MICROPY_PY_BUILTINS_SLICE_ATTRS 2016-10-11 12:22:36 +02:00
Paul Sokolovsky 3b3612c65b esp8266: Make neopixel support configurable.
To save iRAM.
2016-10-09 00:56:46 +03:00
Damien George 056da75a8a esp8266: Make PY_UHASHLIB_SHA1 config depend on PY_USSL and SSL_AXTLS.
SHA1 can only be supported if ussl module is compiled in, and it uses
axtls.
2016-10-06 12:28:28 +11:00
Damien George 5863e15a23 esp8266/modpybspi: Use generic SPI helper methods to implement SPI. 2016-09-01 16:39:42 +10:00
Damien George 675d1c9c60 ports: Remove typedef of machine_ptr_t, it's no longer needed.
This type was used only for the typedef of mp_obj_t, which is now defined
by the object representation.  So we can now remove this unused typedef,
to simplify the mpconfigport.h file.
2016-08-15 11:02:59 +10:00
Paul Sokolovsky 9cf2949356 esp8266/mpconfigport.h: Enable support for all special methods. 2016-08-14 01:02:35 +03:00
Paul Sokolovsky 0e4cae5212 esp8266: Make APA102 driver inclusion configurable. 2016-08-01 00:03:55 +03:00
Paul Sokolovsky 61e77a4e88 py/mpconfig.h: Add MICROPY_STREAMS_POSIX_API setting.
To filter out even prototypes of mp_stream_posix_*() functions, which
require POSIX types like ssize_t & off_t, which may be not available in
some ports.
2016-07-30 20:05:56 +03:00
Paul Sokolovsky ba2c503541 esp8266/mpconfigport.h: Include sys/types.h for POSIX types definitions.
As required for related functions in stream.h.
2016-07-30 17:46:36 +03:00
Paul Sokolovsky 40214b9e26 esp8266: Enable MICROPY_PY_STR_BYTES_CMP_WARN. 2016-07-22 00:57:55 +03:00
Damien George db80c0ed46 esp8266: Enable frozen bytecode, with scripts in modules/ subdir.
To start with, the critical scripts _boot.py and flashbdev.py are frozen
to improve performance and reduce RAM consumption.

Saves about 1000 bytes of heap RAM for a bare boot with filesystem.
2016-06-29 13:59:19 +01:00
Paul Sokolovsky 15eb1ce52d esp8266: Enable MICROPY_PY_IO_FILEIO to get compliant text/binary streams. 2016-05-31 21:46:02 +03:00
Damien George 33168081f4 extmod/machine: Add MICROPY_PY_MACHINE_PULSE config for time_pulse_us.
Since not all ports that enable the machine module have the pin HAL
functions.
2016-05-31 14:25:19 +01:00
Paul Sokolovsky 9c2217a165 esp8266: Enable collections.OrderedDict. 2016-05-22 02:57:33 +03:00
Damien George 0d6d315ba6 esp8266: Change to use internal errno's. 2016-05-12 12:49:36 +01:00
Damien George 7e1f580910 esp8266: Enable uerrno module, weak linked also as errno. 2016-05-10 23:30:39 +01:00
Damien George 4f2ba9fbdc esp8266: Convert to use new MP_Exxx errno symbols.
These symbols are still defined in terms of the system Exxx symbols, and
can be switched to internal numeric definitions at a later stage.

Note that extmod/modlwip still uses many system Exxx symbols.
2016-05-10 23:30:39 +01:00
Paul Sokolovsky f16bec6bc9 esp8266/mpconfigport: Reduce various parser-related allocation params.
This gives noticeable result for parsing simple input (modelled on 32-bit
unix port):

Before:
>>> micropython.mem_total()
3360
>>> micropython.mem_total()
4472

After:
>>> micropython.mem_total()
3072
>>> micropython.mem_total()
4052

However, effect on parsing large input is much less conclusive, e.g.:

Before:
>>> micropython.mem_total()
3376
>>> import pystone_lowmem
>>> micropython.mem_total()
33006

delta=29630

After:
>>> micropython.mem_total()
3091
>>> import pystone_lowmem
>>> micropython.mem_total()
32509

delta=29418
2016-05-10 15:38:31 +03:00
Damien George 9215cdc7fd esp8266: Change platform name from ESP8266 to esp8266.
The port name is lowercase, and this change is made for consistency with
the docs and other ports.
2016-05-02 18:54:46 +01:00
Paul Sokolovsky adae53d522 esp8266: Enable webrepl module. 2016-04-29 19:38:21 +03:00
Paul Sokolovsky f8170db390 esp8266: Enable WebREPL file transfer rate limiting. 2016-04-29 19:15:26 +03:00
Paul Sokolovsky b639ce27c7 esp8266/help: Implement help() builtin. 2016-04-29 00:17:11 +03:00
Damien George a6aa35af09 esp8266: Move pyb.info() function to esp module and remove pyb module.
All functionality of the pyb module is available in other modules, like
time, machine and os.  The only outstanding function, info(), is
(temporarily) moved to the esp module and the pyb module is removed.
2016-04-28 12:23:55 +01:00
Paul Sokolovsky 4f811d0e4c esp8266: Enable input() builtin. 2016-04-15 00:08:39 +03:00
Paul Sokolovsky 9b0714b24c py: Declare help, input, open builtins in core.
These are *defined* per-port, but why redeclare them again and again.
2016-04-15 00:07:56 +03:00
Damien George 674bf1bc81 esp8266: Add hard IRQ callbacks for pin change on GPIO0-15. 2016-04-14 12:44:26 +01:00
Damien George 0a2e9650f5 py: Add ability to have frozen persistent bytecode from .mpy files.
The config variable MICROPY_MODULE_FROZEN is now made of two separate
parts: MICROPY_MODULE_FROZEN_STR and MICROPY_MODULE_FROZEN_MPY.  This
allows to have none, either or both of frozen strings and frozen mpy
files (aka frozen bytecode).
2016-04-13 16:07:47 +01:00
Paul Sokolovsky 47442d9f52 lib/utils/printf: Rework overriding printer of DEBUG_printf().
By default it uses mp_plat_print, but a port may override it to another
value with MICROPY_DEBUG_PRINTER_DEST.
2016-04-13 11:53:12 +03:00
Damien George e813ea1070 esp8266: Enable framebuf module. 2016-04-12 14:06:54 +01:00
Damien George a525493e40 esp8266: Switch from using custom I2C driver to generic extmod one. 2016-04-12 14:06:54 +01:00
Paul Sokolovsky f49d63a75c esp8266: Enable websocket module. 2016-04-11 21:25:43 +03:00
Damien George 2c407bcf20 esp8266: Switch from terse error messages to normal ones.
Adds 2k to the code size.
2016-04-07 00:38:08 +03:00
Damien George a0cb4eda9a esp8266: Use VM_HOOK to call ets_loop_iter within the VM.
Starting with a divisor of 10, pystone_lowmem gives a score of 256.
2016-04-02 01:34:32 +03:00
Paul Sokolovsky fc4c43a72e esp8266: Switch to non event-driven REPL to support paste mode. 2016-04-01 14:22:28 +03:00
Paul Sokolovsky 2e75a17bab esp8266: Fix issue when current repl line was garbage-collected.
Reference it from root pointers section.
2016-03-30 18:13:03 +03:00
Damien George 9475cc59e6 esp8266: Support synchronous wifi scanning.
That is: aps = if0.scan()

TODO: make sure that returned list has tuple with values in "standard"
order (whatever that standard is).
2016-03-30 11:35:03 +03:00
Paul Sokolovsky c961889e34 esp8266: Add basic support for duplicating REPL output. 2016-03-29 11:13:32 +03:00
Paul Sokolovsky 374654f2b8 esp8266: Enable FatFs support. 2016-03-27 17:13:47 +03:00
Damien George 78d0dde562 esp8266: Add onewire helper functions as C module.
Includes functions to read and write bits and bytes.
2016-03-24 17:33:42 +02:00
Paul Sokolovsky a1d072df81 esp8266: Enable auto-indent in REPL. 2016-03-23 16:30:29 +02:00
Paul Sokolovsky df1f6783f2 esp8266: Add "socket" and "usocket" aliases for lwip module. 2016-03-23 16:25:55 +02:00
Paul Sokolovsky 494aea3e86 esp8266: Enable non-blocking stream support. 2016-03-23 16:15:49 +02:00