Commit Graph

13720 Commits

Author SHA1 Message Date
Dan Halbert
1e13cd23b1 Revert "remove a few unused or one-off boards"
This reverts commit a18824ad82.
2019-08-18 16:06:10 -04:00
Dan Halbert
a18824ad82 remove a few unused or one-off boards 2019-08-18 15:58:09 -04:00
Dan Halbert
27afaea2b9 no boards for test-only subjob 2019-08-18 15:46:52 -04:00
Dan Halbert
da4a45ae0b nrf TRAVIS_SDK is obsolete 2019-08-18 14:48:50 -04:00
Dan Halbert
e6480ea288 try to group travis jobs more logically 2019-08-18 14:39:40 -04:00
Dan Halbert
3f7321af00
Merge pull request #2031 from jepler/nrf-lto
Enable link-time optimization for nrf targets
2019-08-18 12:35:26 -04:00
Dan Halbert
1dbb559792
Merge pull request #2070 from jepler/localtime-hardfault
localtime: don't hard-fault on type errors; handle localtime(float)
2019-08-18 11:43:08 -04:00
Jeff Epler
f384d2dd80 shared-bindings/time: style 2019-08-18 08:11:14 -05:00
Jeff Epler
9d164965c9 localtime: don't hard-fault on argument type errors; handle localtime(float)
It turns out `mp_obj_int_get_checked` is not appropriate to call when
the argument is not of int or long type--the "checked" refers to guarding
against overflow/underflow, not type checking.

For compatibility with CPython, handle float arguments.

Closes: #2069
2019-08-17 20:49:25 -05:00
Scott Shawcroft
85d7398476
Merge pull request #2066 from dhalbert/ble-pairing
BLE: more features
2019-08-16 14:50:00 -07:00
Dan Halbert
630c92392a address review comments; avoid calling common_hal_bleio_device... routines from shared-bindings 2019-08-16 15:18:53 -04:00
Dan Halbert
d244f7e070
Merge pull request #2067 from jepler/update-tinyusb-issue2057
update tinyusb
2019-08-16 10:28:46 -04:00
Jeff Epler
49d8ea648d update tinyusb
This fixes a problem with USB MIDI messages 0xc and 0xd and
Closes: #2057
2019-08-16 07:40:37 -05:00
Dan Halbert
af29fc3ea8 make translate and fix sphinx issues 2019-08-15 21:54:52 -04:00
Dan Halbert
485dd8a673
Merge pull request #2061 from dhalbert/cpblue
Initial board definition for Circuit Playground Bluefruit
2019-08-14 20:22:50 -04:00
Dan Halbert
fc772b42dd
Merge pull request #2063 from tannewt/fix_i2cdisplay
Fix I2CDisplay lifecycle and splash lifecycle.
2019-08-14 20:22:18 -04:00
Scott Shawcroft
b3de7efc07
Fix I2CDisplay lifecycle and splash lifecycle.
Fixes https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1306/issues/2
2019-08-14 15:53:58 -07:00
Dan Halbert
5877bd6036 CPblue initial definition 2019-08-13 22:12:36 -04:00
Scott Shawcroft
583392a5c6
Merge pull request #2046 from brentru/add-pyportal-titano
Add PyPortal Titano
2019-08-12 16:01:10 -07:00
Scott Shawcroft
49cb72d585
Merge pull request #2047 from brentru/fix-terminalio-clearing
Fix Terminal's Tilegrid not Clearing
2019-08-12 16:00:43 -07:00
Scott Shawcroft
c565ea6c29
Merge pull request #2043 from jepler/issue1908
Improvements to Audio DMA management
2019-08-12 15:58:09 -07:00
Scott Shawcroft
9a6e603ced
Merge pull request #2050 from jepler/issue2048
usb_hid: Allow USB work to progress while waiting for tud_hid_ready
2019-08-12 15:16:21 -07:00
Scott Shawcroft
eb1a158c1b
Merge pull request #2053 from jepler/namedtuple-tuple_get
py: mp_obj_tuple_get: accept any item which can use tuple_getiter
2019-08-12 15:14:31 -07:00
Jeff Epler
3eb418af39 py: mp_obj_tuple_get: accept any item which can use tuple_getiter
.. such as namedtuple and attrtuple objects.  This is the same
predicate used elsewhere in the file to check for adequate compatibility
between the types.

This was discovered due to crashing `time.time()` on the nrf port.

Closes: #2052
2019-08-10 10:10:41 -05:00
Jeff Epler
be5205d020 usb_hid: Allow USB work to progress while waiting for tud_hid_ready
Otherwise, examples like the one attached to the related issue fail
because tud_hid_ready never returns true.

Testing performed: Adapted the example to nrf particle xenon (it was
handy), removed dependency on IR, verified that the problem occurred
before this change, and that it was fixed after this change.

Closes: #2048
2019-08-10 09:33:45 -05:00
brentru
5a8846d33c remove cruft from prv board 2019-08-08 15:12:01 -04:00
brentru
1b7e213be4 fix terminalio not clearing on construct 2019-08-08 14:58:51 -04:00
brentru
f87f48ab88 adding pyportal titano board definition 2019-08-08 14:56:28 -04:00
Dan Halbert
1570ef2dd4 specifying attribute length; fix up value setting 2019-08-07 23:49:09 -04:00
Jeff Epler
33b949abfa samd: audio_dma, audio_background: Gate with CIRCUITPY_ defines
Some ports which actually don't have audioio or audiobusio were still
calling into audio_dma_background().  This wasn't an error until
the assignment to audio_dma_state in audio_dma_stop was added, though
it's not clear why.
2019-08-07 21:29:24 -05:00
Jeff Epler
500d1bb168 samd: audio_dma.c: Remove exceptions, just return early
These were most useful debugging, but because this code can be reached
"outside of the VM", it's not actually permitted to throw exceptions here.
2019-08-07 20:20:36 -05:00
brentru
1d4700cb6c add pindefs for tft and tft control 2019-08-07 18:29:20 -04:00
brentru
8f6eac98f3 add defs for pyportal titano 2019-08-07 17:10:31 -04:00
Dan Halbert
d047b73a9c fix newly-introduced bugs; UART client/server working again 2019-08-07 11:10:21 -04:00
Jeff Epler
39c64bf83c samd: audio_dma_stop: don't free invalid channel
audio_dma_stop can be reached twice in normal usage of AudioOut.

This may bear further investigation, but stop it here, by making the
function check for a previously freed channel number.  This also prevents
the event channel from being disabled twice.

The first stop location is from audio_dma_get_playing, when the buffers
are exhausted; the second is from common_hal_audioio_audioout_stop when
checking the 'playing' flag.
2019-08-06 22:00:31 -05:00
Jeff Epler
8b717955ba samd: audio_dma: wrap dma_{en,dis}able_channel and add error checking
It turns out the "disable" error will fire in practice, we'll fix that
next.
2019-08-06 22:00:31 -05:00
Dan Halbert
d74c8b9425 WIP: more Descriptor work; refactor gattc/gatts read/write 2019-08-06 22:55:25 -04:00
Jeff Epler
6253f11503 samd: audio_dma_stop: Clear out audio_dma_state[]
As identified in #1908, when both AudioOut and PDMIn are used, hard
locks can occur.  Because audio_dma_stop didn't clear audio_dma_state[],
a future call to audio_dma_load_next_block could occur using a DMA
object which belongs to PDMIn.

I believe that this Closes: #1908 though perhaps it is still not the full
story.

Testing performed: Loaded a sketch similar to the one on #1908 that
tends to reproduce the bug within ~30s.  Ran for >300s without hard
lock.  HOWEVER, while my cpx is no longer hard locking, it occasionally
(<1 / 200s) announces
    Code done running. Waiting for reload.
(and does so), even though my main loop is surrounded by a 'while True:'
condition, so there are still gremlins nearby.
2019-08-06 21:34:21 -05:00
Scott Shawcroft
47a0b7cba1
Merge pull request #2042 from jepler/qstr-expansion
makeqstrdata: permit longer "compressed" outputs
2019-08-06 14:13:48 -07:00
Jeff Epler
c4f3a02b3b makeqstrdata: permit longer "compressed" outputs
It is possible for this routine to expand some inputs, and in fact
it does for certan strings in the proposed Korean translation of
CircuitPython (#1858).  I did not determine what the maximum
expansion is -- it's probably modest, like len()/7+2 bytes or
something -- so I tried to just make enc[] an adequate
over-allocation, and then ensured that all the strings in the
proposed ko.po now worked.  The worst actual expansion seems to be a
string that goes from 65 UTF-8-encoded bytes to 68 compressed bytes
(+4.6%).  Only a few out of all strings are reported as
non-compressed.
2019-08-06 07:39:09 -05:00
Dan Halbert
243334da75 Merge remote-tracking branch 'adafruit/master' into ble-pairing 2019-08-05 23:06:24 -04:00
Dan Halbert
1e8800117a
Merge pull request #2040 from tannewt/merge_in_410
Merge 4.1.0 into master
2019-08-05 22:54:12 -04:00
Scott Shawcroft
59efce3035
Merge pull request #2039 from dhalbert/metro-52840
Metro nRF52840 rev A defn; remove '#define FEATHER52840' from mpconfigboard.h
2019-08-05 18:48:36 -07:00
Scott Shawcroft
26f64dd8ec
Merge remote-tracking branch 'adafruit/4.1.x' into merge_in_410 2019-08-05 17:53:08 -07:00
Scott Shawcroft
b675a27e16
Merge pull request #2000 from jepler/nrf-pwm-audio
Implement PWM audio out for the nrf port
2019-08-05 17:26:27 -07:00
Dan Halbert
c56566179a Metro nRF52840 rev A defn; also remove '#define FEATHER52840' from mpconfigboard.h files 2019-08-05 18:10:27 -04:00
Dan Halbert
b67d04a5b1 Merge remote-tracking branch 'adafruit/master' into ble-pairing 2019-08-05 16:35:44 -04:00
Jeff Epler
77bc1ba03e nrf: PWMAudioOut: Remove the need to wait in "pause"
The original formulation was because I saw the need to avoid a transition
from playing to stopped exactly when a resume was taking place.  However,
@tannewt was concerned about this pause causing trouble, because it could
be relatively lengthy (several ms even in a typical case).

After reflection, I've convinced myself that updating the registers
in this order in resume avoids a window where a "stopped" event can
be missed as long as the shortcut is updated first.

Testing re-performed: pause/resume testing of looped RawSample and
WaveFile audio sources.
2019-08-03 08:19:25 -05:00
Jeff Epler
4bae29b925 nrf: enable link-time optimization
Testing performed: installed freshly built .uf2 on a Particle Xenon.
Checked that circuitpython still starts.
Checked that the size of all .uf2 files for nrf builds are plausible.

Aside from memory savings, the performance of Python code (pystone)
increased by about +14%.

However, this adds about 12-16 seconds to each nrf build.

Timings & Sizes (build system: i5-3320M, -j5 parallelism on 4 threads):

Before:
$ make -j5 BOARD=particle_xenon
765004 bytes free in flash out of 1048576 bytes ( 1024.0 kb ).
232076 bytes free in ram for stack out of 245760 bytes ( 240.0 kb ).
68.54user 11.83system 0:34.34elapsed 234%CPU
pystones before: 570

After:
$ make -j5 BOARD=particle_xenon
804284 bytes free in flash out of 1048576 bytes ( 1024.0 kb ).
232072 bytes free in ram for stack out of 245760 bytes ( 240.0 kb ).
71.06user 11.77system 0:46.91elapsed 176%CPU
pystones after: 650

Timings on travis:

Before:
Build feather_nrf52840_express for pl took 55.79s and succeeded
Build feather_nrf52840_express for zh_Latn_pinyin took 3.18s and succeeded

After:
Build feather_nrf52840_express for pl took 62.72s and succeeded
Build feather_nrf52840_express for zh_Latn_pinyin took 19.10s

Closes: #1396
2019-08-02 20:59:47 -05:00
Dan Halbert
347fbb652f
Merge pull request #2030 from pewpew-game/stage-scale
Add support for scaling to _stage
2019-08-02 18:28:16 -04:00