Commit Graph

13783 Commits

Author SHA1 Message Date
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
Dan Halbert e2a4c76a37 make nrf touchio be generic: now available for SAMD51 too 2019-08-18 08:44:10 -04: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
Jeff Epler 47d6dd843e audioio: By default, be compatible with 4.x
Testing performed: That the shipped .mpy files on a PyPortal (CP 4.x)
still work (play audio) with this branch, instead of erroring because
`WaveFile` can't be found in `audioio`.

Flash usage grew by 28 bytes.  (I expected 24, there must be some other
effect on size/alignment that I didn't predict)
2019-08-17 13:54:06 -05:00
Radomir Dopieralski 58b4cd4956 Improve docs for WaveFile buffer 2019-08-17 11:31:45 +02:00
Dave Astels 7a235f3746 Simplify to only extracting one line
Since this was the usecase, doing so simplifies the function significantly.
2019-08-16 21:10:09 -04: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 e3c0428838 shared-module: Use RUN_BACKGROUND_TASKS 2019-08-11 08:53:02 -05:00
Jeff Epler 32a6d36405 shared-bindings: Use RUN_BACKGROUND_TASKS 2019-08-11 08:53:02 -05:00
Jeff Epler 11dd3a260e nrf: Use RUN_BACKGROUND_TASKS 2019-08-11 08:53:02 -05:00
Jeff Epler d9ee2d28a0 atmel-samd: Use RUN_BACKGROUND_TASKS 2019-08-11 08:53:02 -05:00
Jeff Epler 076cbcc4f8 cicuitpy_mpconfg.h: Define RUN_BACKGROUND_TASKS
In #2013, @danh says:
    My choice of where to put the semicolon is deliberate,
    so that we can say

        RUN_BACKGROUND_TASKS;

    not have a redundant semicolon, and not confuse C code formatting.
2019-08-11 08:53:02 -05:00
Jeff Epler 568dfc73a9 cicuitpy_mpconfg.h: Alphebetize and standardize indentation
.. no semantic change intended
2019-08-11 08:53:02 -05: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
Dave Astels 239ad19765 Pass in preallocated result buffer 2019-08-07 15:27:43 -04:00
Dave Astels 263f6f439b Remove obsolete experimental property 2019-08-07 15:27:04 -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