Commit Graph

9705 Commits

Author SHA1 Message Date
Scott Shawcroft 5a59a10bf2 Add log folding to Travis outout. 2017-10-25 11:01:43 -07:00
Scott Shawcroft d2ddf36c1d shared-bindings: Use unary_op type. 2017-10-25 10:52:03 -07:00
Scott Shawcroft 00766e43a0 Merge commit 'f57be61' into nrf2_merge 2017-10-24 23:26:41 -07:00
Scott Shawcroft 60e9b8f70a tools: Correct ports directory name 2017-10-24 23:06:02 -07:00
Scott Shawcroft d665334e94 esp8266: Fix includes 2017-10-24 23:05:20 -07:00
Scott Shawcroft 2c26f35429 Re-add atmel submodules. 2017-10-24 22:39:08 -07:00
Scott Shawcroft 73c15dcf8b Merge commit 'f869d6b2e339c04469c6c9ea3fb2fabd7bbb2d8c' into nrf2_merge
This is prep for merging in the NRF5 pull request.
2017-10-24 22:31:16 -07:00
Scott Shawcroft d43564f854 atmel-samd: Use our own CDC output cache because the internal (#366)
atmel-samd: Use our own CDC output cache because the internal
cache is only used when the memory isn't aligned even if we're
going to change the memory immediately after.
2017-10-24 12:57:03 -07:00
Scott Shawcroft ee1092fcaf atmel-samd: Update metro m4 USB PID. (#365) 2017-10-24 14:47:43 -04:00
Dan Halbert 6df99b5d0e Merge 2.1.0 changes into master. 2017-10-23 15:26:36 -07:00
Radomir Dopieralski 1c97b7f4df Gracefully reset the gamepad module
If a soft reset happens while the gamepad module is scanning for button
presses, there is a moment when the pins get de-initialized, but the
gamepad module is still trying to read them, which ends in a crash.
We can avoid it by disabling scanning on reset.

(cherry picked from commit 470a23d4c9)

Conflicts:
	atmel-samd/main.c
2017-10-22 20:54:10 -07:00
Scott Shawcroft a1be272b1e atmel-samd: Correct the UF2 bootloader offset when converting the bin to uf2. 2017-10-22 12:39:01 -07:00
mrmcwethy bb008cdbc9 First attempt to move py/modmath.c to shared-bindings/math 2017-10-21 10:34:25 -07:00
Scott Shawcroft 536bcb42c9 atmel-samd: Re-enable pin reset. Fixes #352 (#353) 2017-10-20 07:49:33 -04:00
Scott Shawcroft a800a25e88 atmel-samd: Switch Metro M4 Express to SAMD51J19. (#351) 2017-10-19 22:39:16 -04:00
Josh Gadeken 3ba5ba6e66 shared-bindings/storage/__init__.c: Change remount() readonly to kw arg (#286).
The readonly arg to storage.remount() is now a keyword arg that
defaults to False. To maintain backwards compatibility, readonly
can be passed as a positional arg or keyword arg.
2017-10-19 17:11:30 -07:00
Scott Shawcroft 535c0059d7 atmel-samd: Turn on SAMD51 bootloader build layout. (#348) 2017-10-18 16:07:38 -04:00
Michael McWethy b41cbe9256 CircuitPython now has struct instead of ustruct (#302)
Added struct module to shared-bindings and shared-module.  removed ustruct
2017-10-18 12:50:20 -07:00
Scott Shawcroft 88c6d2349b atmel-samd: Update asf4 to include USB fix for SAMD51. 2017-10-18 15:46:26 -04:00
Scott Shawcroft f31a7b70e8 atmel-samd: Fix CDC now that its clear its async. 2017-10-18 15:46:26 -04:00
Scott Shawcroft 51cd4da76e atmel-samd: Add mass storage support.
Fixes #260
2017-10-18 11:52:51 -07:00
Andon c80e1908c5 Added Trinket to README.md (#344)
Added Trinket to README.md

Despite shipping with CircuitPython pre-installed, the Trinket M0 is
absent from the README.md file. This fixes that issue.
2017-10-17 13:00:10 -07:00
Dan Halbert 6e8fa8b3c9 Merge pull request #320 from dhalbert/master
merge 2.x changes into master; touch up Makefile CFLAGS logic
2017-10-13 14:51:09 -04:00
Ayke van Laethem f57be619fc ports/nrf: Add compile switch to disable VFS.
This saves about 17kB.
2017-10-13 18:29:41 +02:00
Dan Halbert 3c54e2c03c TEMPORARY changes to get build to work on all boards. Make space on CPX; turn off -finline-limit 2017-10-12 21:54:38 -04:00
Dan Halbert fabaa2ec30 merge 2.x changes into master; touch up Makefile CFLAGS logic 2017-10-12 20:10:31 -04:00
Ayke van Laethem 61b6faed15 ports/nrf: Use --gc-sections to reduce code size
This saves about 6-7kB.
2017-10-12 21:44:55 +02:00
Dan Halbert 922006dd59 Don't create a new filesystem if we restart in safe mode. (#319) 2017-10-12 14:35:39 -04:00
Dan Halbert b7591cfd19 Replace asf4 tree with submodule repo adafruit/asf4, branch circuitpython. 2017-10-12 10:55:15 -07:00
Scott Shawcroft 80654779e1 atmel-samd: Add support for internal filesystems. (#311)
* atmel-samd: Add support for internal filesystems.

This allows us to re-enable `os`. `random` is also enabled because
it solely depends on `os`.

Fixes #266. Its also a pre-requisite for #260.

* atmel-samd: Update SAMD51 linker script comments and MICROPY_MAX_STACK_USAGE enabling.
2017-10-10 14:36:00 -04:00
Ayke van Laethem d18bf876e3 ports/nrf: Add WT51822-S4AT board. 2017-10-08 23:23:11 +02:00
Dan Halbert ef65ee78c5 Freeze libraries needed by adafruit_circuitplayground library into firmware.
This saves a lot of RAM. Fixes #287.
Also fixed compilation of frozen_mpy.c to use supplied make rule rather than
builtin rule (supplied rule suppresses printing out the gcc command line).
2017-10-08 10:54:46 -06:00
Alex Vasylenko 9a9584aee0 Update pwm.rst
replace reference to non-existent `time.sleep_ms()`
2017-10-08 10:53:25 -06:00
Glenn Ruben Bakke a414199793 ports/nrf: Update Makefile and README.md after moving port to new directory 2017-10-04 21:54:01 +02:00
Glenn Ruben Bakke 831759faaa ports/nrf: Align help.c builtin help text to use correct type after upmerge with upstream master. 2017-10-04 21:52:08 +02:00
Glenn Ruben Bakke 44e2cb415f ports/nrf: Moving nrf51/52 port to new ports directory 2017-10-04 21:46:48 +02:00
Glenn Ruben Bakke bcab2ba0a8 ports/nrf: Upmerging port with upstream master 2017-10-04 21:45:04 +02:00
Glenn Ruben Bakke 4468731e3d nrf: Aligning with upstream the use of nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, ...) 2017-10-04 20:49:49 +02:00
glennrub 795116b432 nrf/modules/random: Backport of microbit random number generator module
Backport of micro:bit random module.
Plugged into the port as a general random module for all nrf51/nrf52 targets. Works both with and without Bluetooth LE stack enabled.

Behavioral change: seed() method has been removed, as the use of RNG peripheral generates true random sequences and not pseudo-random sequences.
2017-10-04 20:49:03 +02:00
glennrub f49b202e7d nrf/hal/rng: Adding HAL driver for accessing RNG peripheral
The driver also takes care of calling the Bluetooth LE stack for random values if the stack is enabled. The reason for this is that the Bluetooth LE stack take ownership of the NRF_RNG when enabled. Tolerate to enable/disable on the fly, and will choose to use direct access to the peripheral if Bluetooth LE stack is disabled or not compiled in at all.

Driver has been included in the top Makefile, and will not be compiled in unless nrf51_hal_conf.h/nrf52_hal_conf.h defines HAL_RNG_MODULE_ENABLED (1).
2017-10-04 20:45:40 +02:00
glennrub 8c0bbb983b nrf/boards: Adding Arduino Primo board support (#88)
* nrf: Adding Arduino Primo board support

* nrf: Adding arduino_primo to target boards table in readme.md

* nrf/boards: Activating pyb.LED module for arduino_primo board.

* nrf/boards: Removing define not needed for arduino_primo

Updating arduino_primo board mpconfigboard.h. Removing a define
that was wrongly named. Instead of renaming it, it was removed as
it was never used.
2017-10-04 20:44:11 +02:00
Glenn Ruben Bakke 863a5c1734 nrf: Add support for floating point on nrf52 targets.
Duplicating pattern for detecting location of libm, libc and libgcc
from teensy port. Activating MICROPY_FLOAT_IMPL (FLOAT) for nrf52 targets
and adding libs into the compile. For nrf51 targets it is still set to
NONE as code grows to much (about 30k).

Some numbers on flash use if MICROPY_FLOAT_IMPL is set to
MICROPY_FLOAT_IMPL_FLOAT and math libraries are enabled (lgcc, lc, lm).

nrf51:
======

without float support:
   text	   data	    bss	    dec	    hex	filename
 144088	    260	  30020	 174368	  2a920	build-pca10028/firmware.elf

with float support:
   text	   data	    bss	    dec	    hex	filename
 176228	   1336	  30020	 207584	  32ae0	build-pca10028/firmware.elf

nrf52:
======

without float support:
   text	   data	    bss	    dec	    hex	filename
 142040	    356	  36236	 178632	  2b9c8	build-pca10040/firmware.elf

with float support:
   text	   data	    bss	    dec	    hex	filename
 165068	   1436	  36236	 202740	  317f4	build-pca10040/firmware.elf
2017-10-04 20:42:27 +02:00
Damien George f869d6b2e3 lib/libm: Fix tanhf so that it correctly handles +/- infinity args. 2017-10-04 21:14:00 +11:00
Damien George 23faf88cab py/mpprint: Only check for null string printing when NDEBUG not defined.
Printing "(null)" when a NULL string pointer is passed to %s is a debugging
feature and not a feature that's relied upon by the code.  So it only needs
to be compiled in when debugging (such as assert) is enabled, and saves
roughy 30 bytes of code when disabled.

This patch also fixes this NULL check to not do the check if the precision
is specified as zero.
2017-10-04 18:07:32 +11:00
Damien George dfa563c71f py/objstr: Make empty bytes object have a null-terminating byte.
Because a lot of string processing functions assume there is a null
terminating byte, so they can work in an efficient way.

Fixes issue #3334.
2017-10-04 17:59:22 +11:00
Damien George a3dc1b1957 all: Remove inclusion of internal py header files.
Header files that are considered internal to the py core and should not
normally be included directly are:
    py/nlr.h - internal nlr configuration and declarations
    py/bc0.h - contains bytecode macro definitions
    py/runtime0.h - contains basic runtime enums

Instead, the top-level header files to include are one of:
    py/obj.h - includes runtime0.h and defines everything to use the
        mp_obj_t type
    py/runtime.h - includes mpstate.h and hence nlr.h, obj.h, runtime0.h,
        and defines everything to use the general runtime support functions

Additional, specific headers (eg py/objlist.h) can be included if needed.
2017-10-04 12:37:50 +11:00
Damien George 6c82cfc089 py/objtype: Change type of enum-to-qstr table to uint16_t to save space.
Qstr values fit in 16-bits (and this fact is used elsewhere in the code) so
no need to use more than that for the large lookup tables.  The compiler
will anyway give a warning if the qstr values don't fit in 16 bits.  Saves
around 80 bytes of code space for Thumb2 archs.
2017-10-04 11:31:05 +11:00
Gabe 9e0cdb22f1 docs/esp8266/tutorial: Update neopixel with example of using 4 bbp. 2017-10-04 10:35:22 +11:00
Radomir Dopieralski f4981677b0 Add a `gamepad` module for handling buttons in the background. (#295)
The `GamePad` singleton monitors buttons in the background to make sure a button press is never missed and debouncing happens consistently.
2017-10-03 13:35:57 -07:00
Dan Halbert c478c10923 Do not allow a *io object to be used after deinit().
Fixes #278, #277, #276, #275.
2017-10-03 12:07:17 -07:00