Commit Graph

550 Commits

Author SHA1 Message Date
marc hoffman 91eb0153d3 esp8266/uart: Add support for polling uart device. 2017-02-03 17:15:43 +11:00
Damien George 0bd61d23b9 extmod/vfs_fat: Remove MICROPY_FATFS_OO config option.
Everyone should now be using the new ooFatFs library.  The old one is no
longer supported and will be removed.
2017-01-30 12:26:07 +11:00
Damien George c95c583857 esp8266/mpconfigport.h: Remove obsolete MICROPY_FATFS_VOLUMES config. 2017-01-30 12:26:07 +11:00
Paul Sokolovsky 287180a0a8 esp8266/modmachine: Add Signal class. 2017-01-29 18:57:37 +03:00
Paul Sokolovsky 18b6835a92 esp8266/machine_pin: Implement pin ioctl protocol.
For polymorphic interfacing on C level.
2017-01-29 18:47:27 +03:00
Damien George 4565d42e70 esp8266/fatfs_port: Include new oofatfs header. 2017-01-27 23:22:15 +11:00
Damien George f9ecd484bb esp8266: Change to use new generic VFS sub-system.
The VFS sub-system supports mounting of an arbitrary number of devices
(limited only by available RAM).  The internal flash is now mounted at
"/flash".
2017-01-27 17:21:45 +11:00
Damien George 32a1138b9f extmod: Rename vfs_fat_file.h to vfs_fat.h.
And move declaration of mp_fat_vfs_type to this file.
2017-01-27 15:04:17 +11:00
Damien George 8d5c6332c0 esp8266: Switch to use OO version of FatFs library. 2017-01-27 13:19:11 +11:00
Damien George b32a38e373 esp8266: Factor out common linker code to esp8266_common.ld. 2017-01-25 09:49:55 +11:00
Damien George 4ccd899e65 esp8266: Convert to use builtin help function. 2017-01-22 11:56:16 +11:00
Damien George e343bea6e7 esp8266/modules/flashbdev: Change RESERVED_SECS to 0.
This effectively reverts the change that introduced this new constant.
The reason is so that users do not need to rebuild the filesystem on
their modules when upgrading the firmware.

Users can change RESERVED_SECS by hand if they need the feature, and in
future firmware it may default to a non-zero value.
2017-01-06 18:30:55 +11:00
Damien George cc7e48fdc8 esp8266/modules/flashbdev: Remove now-unused function set_bl_flash_size. 2017-01-06 16:22:53 +11:00
Paul Sokolovsky 4a72294d7d esp8266/modules/flashbdev: Remove code to patch bootloader flash size.
This code is no longer pertinent for some time - since switchover to
SDK2.0, there must be correct flash size set for bootloader, or there's
a risk of flash data corruption. And indeed, the correct flash size is
by default auto-detected by esptool.py 1.2.
2017-01-05 22:26:23 +03:00
Paul Sokolovsky eac22e29a5 all: Consistently update signatures of .make_new and .call methods.
Otherwise, they serve reoccurring source of copy-paste mistakes and
breaking nanbox build.
2017-01-04 16:10:42 +03:00
Damien George bae7798f1e esp8266/modules/flashbdev: Add RESERVED_SECS before the filesystem.
Starting at esp.flash_user_start(), the reserved sectors are for general
purpose use, for example for native code generation.  There is currently
one sector reserved as such.
2017-01-04 23:47:09 +11:00
Paul Sokolovsky b0f23786da esp8266/Makefile: Put firmware-ota.bin in build/, for consistency. 2017-01-04 10:36:28 +03:00
TheSpooler 3d96201165 esp8266/modesp: Fix a typo, print -> printf. 2017-01-03 17:10:13 +11:00
Paul Sokolovsky 714a59ab64 esp8266/modesp: Make check_fw() work with OTA firmware. 2017-01-03 00:02:00 +03:00
Paul Sokolovsky f5750e88c5 esp8266/Makefile: Produce OTA firmware as firmware-ota.bin. 2017-01-02 19:29:41 +03:00
Paul Sokolovsky 86d210951f esp8266/scripts/inisetup: Dump FS starting sector/size on error.
Should allow to diagnose/try to recover FS easier.
2017-01-02 18:52:35 +03:00
Paul Sokolovsky 1328833663 stmhal, esp8266: Enable utimeq module. 2016-12-23 14:49:13 +03:00
Paul Sokolovsky 9af73bda33 esp8266: Force relinking OTA firmware image if built after normal one. 2016-12-20 23:23:45 +03:00
Paul Sokolovsky c1e94b77a4 esp8266/modesp: flash_user_start(): Support configuration with yaota8266.
It's pretty rough way to detect yaota8266 being used, but otherwise allows
to have a filesystem in such config.
2016-12-20 22:57:51 +03:00
Damien George 0d32f1aeb3 esp8266: When doing GC be sure to trace the memory holding native code.
Native code can hold pointers to objects on the heap, eg constant objects
like big integers.
2016-12-20 11:20:01 +11:00
Mike Causer 87e426c7c7 esp8266: Add "erase" target to Makefile, to erase entire flash. 2016-12-15 22:29:16 +11:00
Damien George 48d81c6900 esp8266: Use core-provided keyboard exception object. 2016-12-15 15:52:47 +11:00
Paul Sokolovsky ee7ad7e8be esp8266: Add "ota" target to produce firmware binary for use with yaota8266.
https://github.com/pfalcon/yaota8266 is a (WIP) OTA-enabled bootloader
which doesn't require reserving space 2x size of a firmware.
2016-12-14 17:44:05 +03:00
Damien George e8f2db7da3 py/runtime: Zero out fs_user_mount array in mp_init.
There's no need to force ports to copy-and-paste this initialisation
code.  If FSUSERMOUNT is enabled then this zeroing out must be done.
2016-12-14 11:40:11 +11:00
Damien George 3a4ebf5768 esp8266: Enable inline Xtensa assembler.
With this patch, @micropython.asm_xtensa can be used on the esp8266 port.
2016-12-09 17:13:00 +11:00
Damien George 45a6156dfd esp8266: Enable native emitter for Xtensa arch.
This patch allows esp8266 to use @micropython.native and
@micropython.viper function decorators.  By default the executable machine
code is written to the space at the end of the iram1 region.  The user can
call esp.set_native_code_location() to make the code go to flash instead.
2016-12-09 16:51:49 +11:00
Damien George 5e393007b9 esp8266/mpconfigport_512k: Disable framebuf module for 512k build.
The 512k build recently overflowed because of the newly-enabled uselect
module.  uselect is arguable more important than framebuf for small
devices so we disable framebuf to keep the 512k build within its limit.
2016-12-08 17:31:21 +11:00
Damien George ad166857bc esp8266: Refactor to use extmod implementation of software SPI class. 2016-12-08 14:41:58 +11:00
Damien George 1eb3c66e91 extmod/machine_spi: Provide reusable software SPI class.
So long as a port defines relevant mp_hal_pin_xxx functions (and delay) it
can make use of this software SPI class without the need for additional
code.
2016-12-08 13:47:01 +11:00
puuu 4fc607a1d7 esp8266: Move websocket_helper.py from scripts to modules for frozen BC.
websocket_helper.py is used by webrepl.  If webrepl is enabled and
websocket_helper.py is not frozen bytecode it leads to heap
fragmentation.
2016-12-05 13:01:08 +11:00
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 5bdf1650de py/lexer: Make lexer use an mp_reader as its source. 2016-11-16 18:35:01 +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
Damien George 6810f2c134 py: Factor persistent code load/save funcs into persistentcode.[ch]. 2016-11-16 16:14:14 +11:00
Paul Sokolovsky 59a1201da9 all: Remove readall() method, which is equivalent to read() w/o args.
Its addition was due to an early exploration on how to add CPython-like
stream interface. It's clear that it's not needed and just takes up
bytes in all ports.
2016-11-14 00:24:22 +03:00
Damien George 11957840e8 esp8266: Update 512k linker script, renaming modpyb to machine. 2016-11-09 17:16:00 +11:00
Chris Popp 52df2f889e esp8266/modnetwork.c: Expose configuration for station DHCP hostname.
The ESP SDK supports configuring the hostname that is
reported when doing a DHCP request in station mode.  This commit
exposes that under network.WLAN(network.STA_IF).config('dhcp_hostname')
as a read/write value similar to other parameters.
2016-11-09 00:33:13 +03:00
Damien George bdf33bc136 py: Move frozen bytecode Makefile rules from ports to common mk files.
Now, to use frozen bytecode all a port needs to do is define
FROZEN_MPY_DIR to the directory containing the .py files to freeze, and
define MICROPY_MODULE_FROZEN_MPY and MICROPY_QSTR_EXTRA_POOL.
2016-11-08 14:28:30 +11:00
Paul Sokolovsky 5630778f0f esp8266: Update docs for esptool 1.2.1/SDK 2.0 (--flash_size=detect). 2016-11-08 04:52:07 +03:00
Paul Sokolovsky 1cc168d487 esp8266: Include upip as a standard frozen bytecode module.
Previously, it was included only in release builds, but it's important
tool which should be always at the fingertips to be useful (and to
pump up its usage).
2016-11-08 01:34:35 +03:00
Olivier Ortigues bc4441afa7 esp8266/espneopixel.c: Solve glitching LED issues with cpu at 80MHz.
At the WS2812 driver level, a 400ns value was used for T0H (time high to
send a 0 bit) but LED specification says it should be 350ns +- 150ns.
Due to loop overhead the 400ns value could lead to T0H close to 500ns
which is too close from the limit value and gave glitches (bad data to
pixels) in some cases.  This patch makes the calculated T0H value 350ns.
2016-11-07 17:13:49 +11:00
Paul Sokolovsky e84e3e7c10 esp8266: Rework webrepl_setup to run over wired REPL. 2016-11-06 10:01:48 +03:00
Paul Sokolovsky 8bc3fc20fe esp8266: Rename "machine" module implementation to use contemporary naming.
Previously they used historical "pyb" affix causing confusion and
inconsistency (there's no "pyb" module in modern ports; but people
took esp8266 port as an example, and "pyb" naming kept proliferating,
while other people complained that source structure is not clear).
2016-11-06 01:30:19 +03:00
Damien George 7bb0f7b0f6 drivers: Add "from micropython import const" when const is used.
Following best-practice use of the const feature, to make it compatible
with Python.
2016-11-03 12:41:11 +11:00