Commit Graph

13695 Commits

Author SHA1 Message Date
Jeff Epler
79f8a85786 nrf: stub out audiobusio.PDMIn, audiobusio.I2SOut 2019-08-18 15:55:57 -05: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
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
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
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
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
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
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
Radomir Dopieralski
c1e5247d51 Add support for scaling to _stage
On high-resolution displays we can use 2x2 or even 3x3 pixels.
2019-08-02 22:55:55 +02:00
Scott Shawcroft
64bf0f8f1f
Merge pull request #1996 from jepler/nrf-reboot-bootloader
[DRAFT] nrf: enable "reboot to bootloader" functionality
2019-08-02 11:55:33 -07:00
Scott Shawcroft
08718993be
Merge pull request #2028 from pewpew-game/master
Update circuitpython-stage to 1.0.4 for audiocore changes
2019-08-02 11:36:31 -07:00
jepler
34e2bab96a nrf: Implement RUNMODE_BOOTLOADER and RUNMODE_SAFE_MODE 2019-08-01 18:53:07 -05:00
Radomir Dopieralski
fd2299e51a Update circuitpython-stage to 1.0.4 for audiocore changes
Since some parts of audioio were moved to audiocore, we now have
to import them differently.
2019-08-01 04:19:50 +02:00
Jeff Epler
76f65ac694 Implement play/pause
.. and also incidentally fix a problem where a RawSample could only
be looped 131070 times.
2019-07-31 20:02:56 -05:00
Scott Shawcroft
95d2694bc3
Merge pull request #2026 from pewpew-game/master
Fix missing write_ram_command in _stage
2019-07-31 16:44:39 -07:00
Scott Shawcroft
eee759455a
Merge pull request #2018 from keith-packard/snekboard
Add board support for keithp.com SnekBoard
2019-07-31 16:38:51 -07:00
Jeff Epler
b0f7c7bc4c Merge remote-tracking branch 'origin/master' into nrf-pwm-audio 2019-07-31 16:32:54 -05:00
Radomir Dopieralski
c4c5d8c5e7 Fix missing write_ram_command in _stage
Since the changes in displayio, displayio_display_set_region_to_update
no longer sends the write_ram_command, so we have to send it explicitly.
2019-07-31 23:32:42 +02:00
Scott Shawcroft
366fdcce18
Merge pull request #2011 from tannewt/ssd1322
Add knobs for SSD1322 and two displayio fixes.
2019-07-30 14:15:37 -07:00
Scott Shawcroft
9dd56b1566
Merge branch 'master' into snekboard 2019-07-30 14:12:08 -07:00
Scott Shawcroft
bb04fbf410
Merge pull request #2014 from robotics-masters/wallarug-robohat
Robo HAT MM1 updates v1.8 board
2019-07-30 11:49:31 -07:00
wallarug
ecfffac3a8
Delete samd51x19-bootloader-external-flash-crystalless.ld 2019-07-30 19:48:35 +10:00
wallarug
ff6ae1aefb
Update mpconfigboard.mk to use standard linker file 2019-07-30 19:13:33 +10:00
Scott Shawcroft
f9d314b263
Merge pull request #1985 from sommersoft/dynamic_support_matrix
Docs: Dynamically Build Support Matrix Table
2019-07-29 18:08:16 -07:00
Scott Shawcroft
3b3a7bbd06
Update pwmaudioio module for PWMAudioOut 2019-07-29 17:45:06 -07:00
Scott Shawcroft
3961014a9e
Update doc comments for PWMAudioOut 2019-07-29 17:43:22 -07:00
Jeff Epler
b72352949b PWM audio: Rename AudioOut -> PWMAudioOut, _audioio_ -> _audiopwmio_ 2019-07-29 18:39:00 -04:00