Commit Graph

12424 Commits

Author SHA1 Message Date
Kattni Rembor
3a38172627 Fixed documentation formatting for RTD 2018-06-06 18:28:01 -04:00
Kattni
ca24cad60a
Merge pull request #902 from dhalbert/feather_m0x_crickit
Feather M0 Express build with frozen Crickit libraries
2018-06-06 14:41:13 -04:00
Dan Halbert
1079f94fc5
Merge pull request #905 from jepler/main-stack-usage
main: move code pertaining to boot.py out of line
2018-06-06 09:24:51 -04:00
Jeff Epler
654591e11f main: move code pertaining to boot.py out of line
.. this reduces stack usage in main() substantially, because
the 512 byte stack allocation will only exist during the new run_boot_py
function's duration.

Closes: #904
2018-06-06 08:01:17 -05:00
Damien George
b789c640f7 travis: Install explicit version of urllib3 for coveralls.
Coveralls requires a "recent" version of urllib3, whereas requests requires
a "not so recent" version, less than 1.23.  So force urllib3 v1.22 to get
it all working.
2018-06-06 20:56:24 +10:00
Scott Shawcroft
aa636841a2
Merge pull request #903 from jepler/stack-overflow-crash
main: Explicitly set the stack top based on _estack
2018-06-05 22:05:13 -07:00
Damien George
a8b9e71ac1 py/mpconfig.h: Add default MICROPY_VFS_FAT config value.
At least to document it's existence.
2018-06-06 14:33:42 +10:00
Damien George
c117effddd extmod/vfs: Introduce a C-level VFS protocol, with fast import_stat.
Following other C-level protocols, this VFS protocol is added to help
abstract away implementation details of the underlying VFS in an efficient
way.  As a starting point, the import_stat function is put into this
protocol so that the VFS sub-system does not need to know about every VFS
implementation in order to do an efficient stat for importing files.

In the future it might be worth adding other functions to this protocol.
2018-06-06 14:33:42 +10:00
Damien George
fadd6bbe43 unix/moduos_vfs: Add missing uos functions from traditional uos module.
Now that the coverage build has fully switched to the VFS sub-system these
functions were no longer available, so add them to the uos_vfs module.

Also, vfs_open is no longer needed, it's available as the built-in open.
2018-06-06 14:28:23 +10:00
Damien George
5ef0d2ab14 tests/extmod: Remove conditional import of uos_vfs, it no longer exists.
This conditional import was only used to get the tests working on the unix
coverage build, which has now switched to use VFS by default so the uos
module alone has the required functionality.
2018-06-06 14:28:23 +10:00
Damien George
6c02da2eec tests/extmod: Add test for importing a script from a user VFS. 2018-06-06 14:28:23 +10:00
Damien George
1d40f12e44 unix: Support MICROPY_VFS_POSIX and enable it in coverage build.
The unix coverage build is now switched fully to the VFS implementation, ie
the uos module is the uos_vfs module.  For example, one can now sandbox uPy
to their home directory via:

    $ ./micropython_coverage

    >>> import uos
    >>> uos.umount('/') # unmount existing root VFS
    >>> vfs = uos.VfsPosix('/home/user') # create new POSIX VFS
    >>> uos.mount(vfs, '/') # mount new POSIX VFS at root

Some filesystem/OS features may no longer work with the coverage build due
to this change, and these need to be gradually fixed.

The standard unix port remains unchanged, it still uses the traditional uos
module which directly accesses the underlying host filesystem.
2018-06-06 14:28:23 +10:00
Damien George
d4ce57e4e3 extmod/vfs: Add fast path for stating VfsPosix filesystem. 2018-06-06 14:28:23 +10:00
Damien George
a93144cb65 py/reader: Allow MICROPY_VFS_POSIX to work with MICROPY_READER_POSIX. 2018-06-06 14:28:23 +10:00
Damien George
8d82b0edbd extmod: Add VfsPosix filesystem component.
This VFS component allows to mount a host POSIX filesystem within the uPy
VFS sub-system.  All traditional POSIX file access then goes through the
VFS, allowing to sandbox a uPy process to a certain sub-dir of the host
system, as well as mount other filesystem types alongside the host
filesystem.
2018-06-06 14:28:23 +10:00
Damien George
f35aae366c extmod/vfs_fat: Rename FileIO/TextIO types to mp_type_vfs_fat_XXX.
So they don't clash with other VFS implementations.
2018-06-06 14:28:23 +10:00
Damien George
172c23fe5d extmod/vfs: Use u_rom_obj properly in argument structures. 2018-06-06 14:28:23 +10:00
Jeff Epler
a4e06bd998 main: Explicitly set the stack top based on _estack
.. setting it based on the ad-hoc stack pointer calculation of
mp_stack_ctrl_init() meant that the stack used above main() counts
against the 1KiB safety factor that the mp_stack_set_limit call tries
to establish.  It turns out, at least on M4, that over half of the
safety factor is used up by stack-above-main()!

In the case of the basics/gen_stack_overflow.py test,
which blows the stack on purpose, it turns out that gc would be called
while handling the "maximum recursion depth exceeded" error, and this
needed more stack than was left.

Closes: #900
2018-06-05 22:04:55 -05:00
Dan Halbert
36a7ebe88e add feather_m0_express_crickit to .travis.yml 2018-06-05 18:24:55 -04:00
Dan Halbert
9ba6990228 Feather M0 Express build with Crickit libraries 2018-06-05 18:21:47 -04:00
Dan Halbert
74ced174ce
Merge pull request #898 from dhalbert/feather_m4_d4
add PA14 as D4 to Feather M4 Express
2018-06-05 11:41:31 -04:00
Dan Halbert
7e7e33e460 add PA14 as D4 to Feather M4 Exprses 2018-06-05 08:15:34 -04:00
Damien George
aace60a75e esp8266/modules/ntptime.py: Remove print of newly-set time.
It should be up to the user if they want to print the new time out or not.

Fixes issue #3766.
2018-06-05 14:30:35 +10:00
Damien George
a90124a9e2 esp32: Add support for building with external SPI RAM.
This patch adds support for building the firmware with external SPI RAM
enabled.  It is disabled by default because it adds overhead (due to
silicon workarounds) and reduces performance (because it's slower to have
bytecode and objects stored in external RAM).

To enable it, either use "make CONFIG_SPIRAM_SUPPORT=1", or add this line
to you custom makefile/GNUmakefile (before "include Makefile"):

    CONFIG_SPIRAM_SUPPORT = 1

When this option is enabled the MicroPython heap is automatically allocated
in external SPI RAM.

Thanks to Angus Gratton for help with the compiler and linker settings.
2018-06-05 13:57:59 +10:00
Angus Gratton
bc92206f89 esp32/Makefile: Extract common C & C++ flags for consistent compilation. 2018-06-05 13:05:12 +10:00
Scott Shawcroft
52cc3ed76a
Merge pull request #893 from notro/cpboard
tools: Add cpboard.py
2018-06-04 17:31:44 -07:00
Scott Shawcroft
0c7c0821fc
Merge pull request #891 from godlygeek/low_flash_errno_fixes
Human readable OSError messages for low flash devices
2018-06-04 17:22:57 -07:00
Damien George
df13ecde06 cc3200/mods: Include stream.h to get definition of mp_stream_p_t. 2018-06-04 16:58:45 +10:00
Damien George
1427f8f593 py/stream: Move definition of mp_stream_p_t from obj.h to stream.h.
Since a long time now, mp_obj_type_t no longer refers explicitly to
mp_stream_p_t but rather to an abstract "const void *protocol".  So there's
no longer any need to define mp_stream_p_t in obj.h and it can go with all
its associated definitions in stream.h.  Pretty much all users of this type
will already include the stream header.
2018-06-04 16:53:17 +10:00
Damien George
309fe39dbb stm32/modnetwork: Fix arg indexing in generic ifconfig method. 2018-06-03 21:50:49 +10:00
Dan Halbert
9a6a5ea2d9
Merge pull request #892 from tannewt/clock_w_crystal
Use the external crystal on SAMD21 again.
2018-06-02 18:43:23 -04:00
Kattni
47b60fd3fa
Merge pull request #896 from dhalbert/update_frozen_lis3dh
Update HID code and seesaw version
2018-06-02 18:09:52 -04:00
Dan Halbert
0ed946c5b8 Merge remote-tracking branch 'adafruit/master' into update_frozen_lis3dh 2018-06-02 17:44:56 -04:00
Dan Halbert
27eba65dc7 update HID, and update seesaw version 2018-06-02 17:43:08 -04:00
Kattni
41865887f7
Merge pull request #895 from dhalbert/update_frozen_lis3dh
Update frozen LIS3DH to 4.2.1 to save space
2018-06-02 17:37:41 -04:00
Dan Halbert
6e6bfc4d57 Update frozen LIS3DH to 4.2.1 to save space 2018-06-02 17:00:23 -04:00
Noralf Trønnes
d08cc2ab17 tests: Point pyboard.py to tools/cpboard.py
This makes it possible to run-tests on the board itself.
2018-06-02 19:09:54 +02:00
Noralf Trønnes
e37d5622fe tools: Add cpboard.py
This is a variant of pyboard.py aimed at Circuit Python boards.
It can emulate pyboard.py enough so it works with tests/run-tests.
2018-06-02 19:09:44 +02:00
Matt Wozniski
d0e6bb269f Use the system errno's on nrf 2018-06-02 12:55:07 -04:00
Scott Shawcroft
e580d22f4a Use the external crystal on SAMD21 again.
Also, re-enable calibration storage for CircuitPlayground Express.
Tested with a 500hz PWMOut on Metro M0 with Saleae:
 * with crystal 500hz
 * with usb 500hz +- 0.1hz
 * without either 487hz += 0.1hz

SAMD51 is skipped due to DFLL errata and the fact it defaults to a
factory calibrated 48mhz that works fine for USB.

Fixes #648
2018-06-01 18:01:42 -07:00
Matt Wozniski
22f4438787 Prune atmel-samd errno list
Remove errnos that are only raised by modules that aren't linked into
the atmel-samd port.
2018-06-01 19:04:14 -04:00
Matt Wozniski
e798b67ca2 Begin a custom list of errnos for atmel-samd
The uerrno module was written to allow boards to customize the list of
errnos they can raise.  Start by copying the default list.
2018-06-01 19:04:04 -04:00
Matt Wozniski
1c35dbfb5d Provide mp_errno_to_str even without uerrno
We can provide a basic version of mp_errno_to_str even if the uerrno
module won't be provided.  Rather than looking errno names up in the
uerrno module's globals dict, we'll just rely on a simple mapping in the
function itself.
2018-06-01 19:03:51 -04:00
Dan Halbert
de61bd0d05
Merge pull request #887 from tannewt/rotaryio
Add rotary encoder support.
2018-06-01 18:50:00 -04:00
Scott Shawcroft
717199018b Adapt for feedback and hack around pIRkey size constraint. 2018-06-01 15:08:52 -07:00
Dan Halbert
f386144428 redo state algorithm 2018-06-01 15:08:52 -07:00
Scott Shawcroft
9920f0a5de atmel-samd: Make ticks more atomic.
Always use current_tick when sub millisecond precision is required.
Otherwise getting the ms/us to correspond is tricky.
2018-06-01 15:08:52 -07:00
Scott Shawcroft
d0fb6e7a2f atmel-samd: Add rotary encoder support.
Fixes #283
2018-06-01 15:08:48 -07:00
Scott Shawcroft
fd71e56891 atmel-samd: Re-org helper peripheral files into their own subdirectory.
Ideally in the future they won't depend on ASF4 or MicroPython.
2018-06-01 15:07:31 -07:00
Dan Halbert
ae31c4ac18
Merge pull request #889 from tannewt/audioio_timers_in_use
Turn off timer on AudioOut deinit.
2018-06-01 18:03:29 -04:00