Commit Graph

291 Commits

Author SHA1 Message Date
Scott Shawcroft 51cd4da76e atmel-samd: Add mass storage support.
Fixes #260
2017-10-18 11:52:51 -07: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
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
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
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
Radomir Dopieralski c2bb9e2eb5 Add board file for the hacked Trinket M0 Haxpress (#303)
Add a hacked Tinket M0 Haxpress board definition

Based on https://daveastels.com/2017/09/01/trinket-m0-express-hack/
2017-10-03 11:24:48 -07:00
Dan Halbert 7f74412882 Make touch more sensitive. Add .raw_value and .threshold attributes. 2017-10-02 11:15:51 -07:00
Scott Shawcroft 211b44e630 Update `time` to use SysTick (#274)
* atmel-samd: Add time back using the SysTick counter in the core. Fixes #261

* Switch to SysTick_Config
2017-09-29 16:58:13 -04:00
Scott Shawcroft bac841df61 atmel-samd: Fix CDC by making sure we define (#294)
CONF_USB_COMPOSITE_CDC_ACM_EN before including ASF4 files.
2017-09-29 16:03:05 -04:00
Dan Halbert b2dcc5bb6c reset pins on PDMIn deinit(). Fixes #275. 2017-09-29 08:54:05 -07:00
Scott Shawcroft 0bbb7a8199 Add support for patching newer ASF4 code. (#292)
* atmel-samd: Support patching after updating ASF4.

This makes it possible to automatically fix newer code.

* atmel-samd: Update ASF4 to include flash APIs for SAMD51.

This is the first automatic update that has caused a few deletions
where code was previously copied instead of moved.

This is a prerequisite for #260.
2017-09-28 23:33:44 -04:00
Scott Shawcroft 8466d760f9 atmel-samd: Port baudrate reset to asf4 so we no longer hose Rosie.
We still won't be able to run tests but we will be reset into the
bootloader to test other stuff.
2017-09-27 21:58:54 -04:00
Scott Shawcroft 6839fff313 Move to ASF4 and introduce SAMD51 support. (#258)
* atmel-samd: Remove ASF3. This will break builds.

* atmel-samd: Add ASF4 for the SAMD21 and SAMD51.

* Introduce the supervisor concept to facilitate porting.

The supervisor is the code which runs individual MicroPython VMs. By
splitting it out we make it more consistent and easier to find.

This also adds very basic SAMD21 and SAMD51 support using the
supervisor. Only the REPL currently works.

This begins the work for #178.
2017-09-22 21:05:51 -04:00
Jerry Needell 3ad01ddb04 Add Ananlog Pin aliases to trinket_m0 pins.c 2017-09-19 21:36:06 -07:00
Dan Halbert 75c3be37ac Re-initialize ADC before every AnalogIn read. (#255)
`microcontroller.cpu.temperature` uses different ADC settings, and caused
AnalogIn to give wrong answers. AnalogIn can no longer assume it's the
only user of the ADC.
2017-09-16 13:06:23 -04:00
Asher Lieber 5aa8922038 add set_rgb_status_brightness (#246)
Add set_rgb_status_brightness() via `samd.rgb_status_brightness`.

Fixes #162.
2017-09-12 12:09:22 -07:00
Dan Halbert acbca44512 Ctrl-C was causing a soft-reset in REPL.
Also allow an immediate ctrl-c in `input()`.
2017-09-06 14:47:23 -07:00
Scott Shawcroft c0159c5e80 atmel-samd: Ensure MTB is off in case we ran a debug build before
a non-debug build.
2017-09-06 11:56:41 -07:00
Scott Shawcroft 6d9d683443 atmel-samd: Enable 8-bit audio recording support even though it'll be
quiet. Also update the examples.

Fixes #226
2017-09-05 16:37:02 -07:00
Dan Halbert a0d0b27faf Fix issue #207, esp8266 file operations problems (#222)
The frozen module `_boot.py` was not being loaded on restart
because `pyexec_frozen_module()` did not know about the new `.frozen`
pseudo-directory. Updated lower-level routine to look in the right place.
Also made ".frozen" and related values be `#define`s.
2017-09-01 16:12:26 -04:00
Scott Shawcroft e2f39a8d93 atmel-samd: Remember SPI baudrate.
This prevents the SERCOM from blipping the data line on each
transaction and therefore fixes #219.
2017-09-01 12:44:52 -07:00
Scott Shawcroft 17ec02a77d atmel-samd: Add SPI pin names to the Trinket. Fixes #213 (#217) 2017-08-31 15:05:43 -04:00
Dan Halbert 59faa05a10 Add ".frozen" to end of sys.path, so that internal frozen modules are visible on boot. 2017-08-31 11:38:00 -07:00
Dan Halbert fdb97eda09 Add microcontroller.cpu.temperature, for use as a simple sensor on minimal boards. (#211)
* Add microcontroller.cpu, the sole instance of microcontroller.Processor.
microcontroller.cpu.frequency is the clock frequency, in Hz.
microcontroller.cpu.temperature is the reading from the internal temperature sensor, in Celsius. None if not available.

* Squeeze firmware size by using -finline-limit. Otherwise non-Express builds were slightly too big.

* Update submodules.

* Fix documentation glitches
2017-08-31 13:48:30 -04:00
Dan Halbert c679c80c71 Modernize module and class static dicts; update freetouch 2017-08-27 15:02:50 -04:00
Dan Halbert ef61b5ecb5 Initial merge of micropython v1.9.2 into circuitpython 2.0.0 (in development) master.
cpx build compiles and loads and works in repl; test suite not run yet
esp8266 not tested yet
2017-08-25 22:17:07 -04:00
Scott Shawcroft 266be30777 atmel-samd: Introduce a nvm module for non-volatile byte-level memory access. (#203)
* atmel-samd: Introduce a nvm module for non-volatile byte-level memory access.

This allows for persisting small configuration values even when the file system
is read-only from CircuitPython.

Fixes #160

* Review feedback:
* Add tests.
* Fix non-zero index.
* Fix len()
2017-08-25 16:00:27 -04:00
Dan Halbert 74cfdeb316 Added ability to freeze multiple directories; freeze neopixel library in cpx build (#199)
Reworked frozen module support: clean up makefiles and handle multiple directories.
Modules to freeze are included as git submodules.

Add neopixel to circuitplayground express build.

Fixes #56
2017-08-23 11:05:59 -07:00
Scott Shawcroft 45a31b1c2a Fix ADC input def for PB07. (#195)
Fixes #194
2017-08-22 15:19:05 -04:00
Scott Shawcroft fab634e3ee Turn on Rosie CI testing to test new builds on real hardware.
This introduces a skip_if module that can be used by tests to
determine when they should be skipped due to the environment.

Some tests have been split in order to have finer grained skip
control.
2017-08-11 17:16:13 -07:00
Scott Shawcroft 42156484ae shared-bindings/atmel-samd: Fix and improve trigger duration timing on PulseIn.resume. 2017-08-10 11:55:34 -07:00
Scott Shawcroft 509d5223ea atmel-samd: Fix crash when fs mount fails and fix mounting internal flash. It was broken by the update to 1.9.1. Related to #82 2017-08-07 15:56:10 -07:00
Dan Halbert 5d509ecace Allow max stack checking to be used with -flto build by determining top
of stack in a different way.
2017-08-05 17:48:16 -07:00
Dan Halbert 91d4cdb476 Increase heap size at the expense of stack size, from 16k to 16k+4k. 2017-08-05 17:47:00 -07:00
Scott Shawcroft 13cb4aa89d atmel-samd: Add support for a second flash chip so either may be used. 2017-08-03 13:44:31 -07:00
Scott Shawcroft 8f3c5ebdc8 atmel-samd: Clear the error bit after the known buffer overflow and be explicit about dst increase. 2017-08-03 13:44:31 -07:00
Scott Shawcroft 557ceded00 atmel-samd: Introduce audiobusio.PDMIn for recording audio from PDM
microphones.
2017-07-28 12:12:38 -07:00
Dan Halbert f91493c97e Measure and report maximum stack usage. (#175)
Add max stack usage tracking, visible via debug module ustack.
Add separate cpp flag for enabling modules: MICROPY_DEBUG_MODULES
2017-07-23 15:32:05 -04:00
Dan Halbert 0d2c1bf2bb Fix problems that prevented use of internal frozen modules:
1. Allow -Wlto-type-mismatch to be just a warning when building with frozen modules.
2. Fix extern decls that triggered -Wnested-externs when building with frozen modules.
3. Pass the correct value of -mlongint-impl to $(MPY_TOOL). New file mpconfigport.mk to do this.
2017-07-16 16:00:41 -07:00
Scott Shawcroft c82b84e0a9 atmel-samd: Fix potential buffer overflow in UART.c by recalculating
the buffer end rather than naively adding 1. It could have needed to
wrap around. Thanks @dhalbert for spotting the bug.

Fixes #132
2017-07-13 16:21:12 -07:00
Scott Shawcroft 3660023046 atmel-samd: Update README and add pinout tables that map MCU names
to names in the board module and explain pin capabilities.

Fixes #149
2017-07-13 16:05:24 -07:00
Scott Shawcroft 1e04e8ea1c atmel-samd: Reboot to bootloader when a 1200 baud serial connection is
closed. This is how Arduino triggers the bootloader.
2017-07-12 11:58:22 -07:00
Scott Shawcroft 09b80b10d1 atmel-samd: Add Trinket Rev D support. 2017-07-12 11:55:50 -07:00
Scott Shawcroft 94346d97ba atmel-samd: Add TX/RX and SCL/SDA pins names for Gemma M0. 2017-07-12 11:55:50 -07:00
Scott Shawcroft e02e423510 atmel-samd: Switch streams to non-blocking mode. Fixes #159. 2017-07-12 11:55:50 -07:00
Scott Shawcroft ffc37faadc atmel-samd: Update Gemma M0 USB device name. 2017-07-12 11:55:49 -07:00