Commit Graph

7896 Commits

Author SHA1 Message Date
Paul Sokolovsky f23c47fea7 docs/usocket: Clarify description of various methods. 2017-01-28 15:39:18 +03:00
Paul Sokolovsky 74fcb122f0 docs/usocket: Elaborate "Constants" section. 2017-01-28 14:46:58 +03:00
Paul Sokolovsky 59540dccf1 docs/usocket: Clarify exceptions used. 2017-01-28 13:55:51 +03:00
Paul Sokolovsky 0aa83142a4 docs/machine: Add explicit note on machine module level and scope.
It's very low, hardware level, with associated constraints on operations
and callbacks.
2017-01-28 12:08:25 +03:00
Paul Sokolovsky 56e7ebf07a docs/machine.Timer: Move WiPy adhoc parts to its documentation. 2017-01-28 12:08:00 +03:00
Paul Sokolovsky 300ecac336 zephyr/prj_frdm_k64f.conf: Add, enable Ethernet support. 2017-01-27 23:48:42 +03:00
Paul Sokolovsky 1df1642b70 zephyr: Allow to have per-board Zephyr config fragments.
To enable options which may be incompatible with other boards, etc.
2017-01-27 23:42:11 +03:00
Paul Sokolovsky 40e72e4a5c zephyr: Make sure that correct Zephyr config is used for "minimal" build.
Overriding CONF_FILE in "minimal" target itself is too late due to include-
pinned $(Z_EXPORTS) target.
2017-01-27 21:43:13 +03:00
Damien George 0390bc97ea lib/oofatfs: Update oofatfs library.
From https://github.com/micropython/oofatfs, branch work-R0.12b,
commit 1e295b40550664bbaac18d95a4b6a58154464d31.
2017-01-27 23:22:15 +11:00
Damien George a0c729681f tests/extmod/vfs_fat_ramdisk: Make it work on pyboard. 2017-01-27 23:22:15 +11:00
Damien George bfa948c0a5 cc3200: Add implementations of mp_import_stat and builtin_open.
They disappeared when stmhal changed to use new MICROPY_VFS code.
2017-01-27 23:22:15 +11:00
Damien George 84c614e729 stmhal: Convert to use VFS sub-system and new ooFatFs component.
This patch makes the following configuration changes:
- MICROPY_FSUSERMOUNT is disabled, removing old mounting infrastructure
- MICROPY_VFS is enabled, giving new VFS sub-system
- MICROPY_VFS_FAT is enabled, giving uos.VfsFat type
- MICROPY_FATFS_OO is enabled, to use new ooFatFs lib, R0.12b

User facing API should be almost unchanged.  Most notable changes are
removal of os.mkfs (use os.VfsFat.mkfs instead) and pyb.mount doesn't
allow unmounting by passing None as the device.
2017-01-27 23:22:15 +11:00
Damien George 3242cf2d36 stmhal/usbd_msc_storage: Use storage functions instead of disk ones. 2017-01-27 23:22:15 +11:00
Damien George 4565d42e70 esp8266/fatfs_port: Include new oofatfs header. 2017-01-27 23:22:15 +11:00
Damien George 9225ce6a14 unix/fatfs_port: Include new oofatfs header. 2017-01-27 23:22:15 +11:00
Damien George 8aa8a0a660 extmod/vfs_fat: Use SECSIZE macro to determine FatFs sector size. 2017-01-27 23:22:15 +11:00
Damien George 3f6b4e08e3 extmod/vfs: Expose mp_vfs_mount_t type.
It should only be used for low-level things and with caution, for example
putting mounted VFS data in ROM or the static data section.
2017-01-27 23:22:15 +11:00
Damien George f488fa29e4 extmod/modlwip: Add socket.readinto() method. 2017-01-27 21:01:18 +11:00
Damien George b9bfaa349a tests/extmod/vfs_fat: Update tests to work with new VFS sub-system.
The vfs_fat_fsusermount test is no longer relevant so has been removed.
2017-01-27 17:21:45 +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 f1e04148a1 unix: Change to use new generic VFS sub-system in coverage build.
This patch includes a new module "uos_vfs" which can be used for testing
the VFS syb-system.
2017-01-27 17:21:45 +11:00
Damien George 6c23c7587f extmod/vfs: Add ability for VFS sub-system to import using VfsFat. 2017-01-27 17:21:45 +11:00
Damien George fb3ae1784e extmod/vfs_fat: Rework to support new generic VFS sub-system.
The VfsFat object can now be mounted by the generic VFS sub-system.
2017-01-27 17:19:06 +11:00
Damien George dcb9ea7215 extmod: Add generic VFS sub-system.
This provides mp_vfs_XXX functions (eg mount, open, listdir) which are
agnostic to the underlying filesystem type, and just require an object with
the relevant filesystem-like methods (eg .mount, .open, .listidr) which can
then be mounted.

These mp_vfs_XXX functions would typically be used by a port to implement
the "uos" module, and mp_vfs_open would be the builtin open function.

This feature is controlled by MICROPY_VFS, disabled by default.
2017-01-27 17:19:06 +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 143fa0ffeb unix: Get minimal version compiling again. 2017-01-27 13:32:15 +11:00
Damien George 8d5c6332c0 esp8266: Switch to use OO version of FatFs library. 2017-01-27 13:19:11 +11:00
Damien George 94d87fbb30 test/extmod: Update vfs_fat tests for new OO FatFs library.
The new version of FatFs requires a minimum of 50 blocks on the device.
Also, some tests no longer make sense with an OO vfs.
2017-01-27 13:19:10 +11:00
Damien George 5395f5bc71 unix: Switch to OO version of FatFS library. 2017-01-27 13:19:10 +11:00
Damien George f5f4cdae89 extmod/vfs_fat: Rework so it can optionally use OO version of FatFS.
If MICROPY_VFS_FAT is enabled by a port then the port must switch to using
MICROPY_FATFS_OO.  Otherwise a port can continue to use the FatFs code
without any changes.
2017-01-27 13:19:10 +11:00
Damien George d4464b0050 py/py.mk: Add CFLAGS_MOD flag to set config file for FatFs. 2017-01-27 13:19:10 +11:00
Damien George 9b08faf3ae lib/oofatfs: Add OO version of FatFS library.
From https://github.com/micropython/oofatfs, branch work-R0.12b,
commit a346ccec123c2e4d887e2751d64156208d03bff4.
2017-01-27 13:19:10 +11:00
Damien George f1db8a3097 qemu-arm: Don't compile tests in "REPL" mode.
Previous to this patch the qemu-arm tests were compiled with is_relp=true
meaning that the __repl_print__ function was called for all lines of code
in the outer scope.  This is not the right behaviour for scripts that are
executed as though they were a file (eg tests).

With this fix the micropython/heapalloc_str.py test now works so it is
removed from the test blacklist.
2017-01-27 12:35:46 +11:00
Damien George cc4c1adf6e py/showbc: Make sure to set the const_table before printing bytecode. 2017-01-27 12:34:09 +11:00
Glenn Ruben Bakke 726fe1aa27 nrf5/examples: Updating game file to use ssd1305 display driver. 2017-01-26 23:37:19 +01:00
Paul Sokolovsky 4614403f63 tools/tinytest-codegen.py: Blacklist heapalloc_str.py test for qemu-arm. 2017-01-27 01:19:36 +03:00
Glenn Ruben Bakke d37d799204 nrf5/drivers: Updating examples in comment in oled ssd1305 object to use the draw module. 2017-01-26 22:56:30 +01:00
Paul Sokolovsky 9ffc3ae0e7 tests/heapalloc_str: Test for alloc-free string operations.
Starts with concatenation with an empty string.
2017-01-27 00:49:39 +03:00
Paul Sokolovsky e2e663291d py/objstr: Optimize string concatenation with empty string.
In this, don't allocate copy, just return non-empty string. This helps
with a standard pattern of buffering data in case of short reads:

    buf = b""
    while ...:
        s = f.read(...)
        buf += s
        ...

For a typical case when single read returns all data needed, there won't
be extra allocation. This optimization helps uasyncio.
2017-01-27 00:49:39 +03:00
Glenn Ruben Bakke 87e7ab8862 nrf5/hal: Fixing nrf51 SPI pin configuration to use pin member of struct. 2017-01-26 22:31:23 +01:00
Glenn Ruben Bakke 9009ad67b0 nrf5/boards: Updating boards to comply to new style of configuring pins for uart and spi. 2017-01-26 22:29:58 +01:00
Glenn Ruben Bakke 6387490e4a nrf5/boards: Updating board configuration for pca10056 (nrf52840) with new pin configuration scheme for SPI and UART. 2017-01-26 22:15:35 +01:00
Glenn Ruben Bakke 0b0cb19608 nrf5/hal: Updating hal QSPI header with define guard to filter out usage of undefined structures and names when compiling against non-52840 targets. 2017-01-26 22:10:36 +01:00
Glenn Ruben Bakke b4d53ad560 nrf5/drivers: Updating display objects to use new SPI pin configuration in print function. 2017-01-26 22:08:39 +01:00
Glenn Ruben Bakke 0254cab228 nrf5/hal: Updating SPI DMA variant with more frequencies, and allowing rx and tx buffers to be NULL. 2017-01-26 22:01:43 +01:00
Glenn Ruben Bakke 632afd1fa8 nrf5/uart: Updating uart module to use new config hal config structure members for pins. Changing board config provided pins to use const pointers from generated pins instead of pin name. 2017-01-26 21:59:37 +01:00
Glenn Ruben Bakke d87d0141b3 nrf5/hal: Updating uart hal to use pointers to Pin objects instead of uint pin and port number. 2017-01-26 21:58:12 +01:00
Glenn Ruben Bakke 3c6c6c6d05 nrf5/hal: Updating uart hal to use pointers to Pin objects instead of uint pin and port number. 2017-01-26 21:57:38 +01:00
Glenn Ruben Bakke afcf07ca76 nrf5: Updating modmachine to add SPI in globals dict when MICROPY_PY_MACHINE_HW_SPI define is set. This diverge from regular MICROPY_PY_MACHINE_SPI config. Fixes missing SPI in the machine module after renaming port SPI enable define. 2017-01-26 21:31:24 +01:00
Glenn Ruben Bakke f94836ef74 nrf5: Updating main.c to enable SPI if MICROPY_PY_MACHINE_HW_SPI is set. This diverge from regular MICROPY_PY_MACHINE_SPI config. Fixing missing init of SPI after renaming port SPI enable define. 2017-01-26 21:29:24 +01:00