summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-12-10Merge pull request #2337 from jepler/mp35.0.0-beta.1Scott Shawcroft
Add MP3 playback
2019-12-10audiocore: Add MP3File using Adafruit_MP3 libraryJeff Epler
2019-12-10nRF: disk_read must be 4-byte alignedJeff Epler
.. a requirement that oofatfs needs to be taught to respect. This problem can be demonstrated with the following snippet, except that the related file ("test.bin") must also be contiguous on the filesystem. You can ensure this by reformatting your device's filesystem before testing, then copying any single file bigger than 4kB to test.bin. f = open("test.bin", "rb") f.seek(2048) b = bytearray(2048) v = memoryview(b) f.readinto(v[909:]) Closes: #2332
2019-12-10Merge pull request #2315 from hierophect/stm32-pyb-nanoScott Shawcroft
STM32: Add PYB Nano support
2019-12-10Merge pull request #2363 from jepler/samd-neopixelScott Shawcroft
samd: neopixel: Fix neopixels after #2297
2019-12-10Merge pull request #2365 from dhalbert/cpb-power-switchScott Shawcroft
Add POWER_SWITCH pin to CPB
2019-12-09Add POWER_SWITCH pin to CPBDan Halbert
2019-12-09Merge pull request #2353 from jepler/audiosample-protocolScott Shawcroft
Convert audiosamples to use micropython "protocols" (safely)
2019-12-09Merge pull request #2364 from jepler/nrf-stereo-rateScott Shawcroft
nRF: PWMAudioOut: fix half-speed playback of stereo samples
2019-12-09nRF: PWMAudioOut: fix half-speed playback of stereo samplesJeff Epler
The "spacing" of "buffer structure" is confusing, use the "channel count" instead. Testing performed on nrf52840 feather: Play stereo and mono, 8- and 16-bit, 8kHz RawSamples representing 333.33Hz square waves. Use both mono and stereo PWMAudioOut instances. Scope the RC-filtered signal and use the scope's frequency measurement function, verify the frequency is 333 or 334Hz in all tested cases. In the "stereo output" cases, verify both the L and R channels. Verify the output amplitude is the same in both channels. In the "stereo output" cases, run a second test where the L channel's amplitude is attenuated 50%. Verify the output amplitude is correct in each channel.
2019-12-07samd: neopixel: Fix neopixels after #2297Jeff Epler
This adapts the "inline assembler" code from the UF2 bootloader, which in turn is said to be adapted from the arduino neopixel library. This requires the cache remain ON when using M0, and be turned OFF on M4 (determined by trial and error) Testing performed on a Metro M4: * measured timings using o'scope and found all values within datasheet tolerance. * Drove a string of 96 neopixels without visible glitches * on-board neopixel worked Testing performed on a Circuit Playground Express (M0): * Color wheel code works on built-in neopixels * Color wheel code works on 96 neopixel strip As a bonus, this may have freed up a bit of flash on M0 targets. (2988 -> 3068 bytes free on Trinket M0) Closes: #2297
2019-12-06Merge pull request #2301 from tannewt/support_extended_advertisingDan Halbert
Add support for extended (>31 byte) BLE advertisements.
2019-12-06Merge pull request #2362 from tannewt/fix_service_list_crashDan Halbert
Check connection validity after service discovery.
2019-12-06Check connection validity after service discovery.Scott Shawcroft
Fixes #2347
2019-12-06Merge pull request #2356 from tannewt/central_pairingDan Halbert
Add connection interval and debugging
2019-12-06audiocore: use mp_obj_t in prototypesJeff Epler
2019-12-06make translateJeff Epler
2019-12-06Comment supervisor ble data arrays.Scott Shawcroft
2019-12-06Merge pull request #2350 from hierophect/stm32-neopixel-fixScott Shawcroft
Fix for neopixels on <100MHz STM32 boards
2019-12-05audiocore: restore the prototypes of audiosample_xxx functionsJeff Epler
2019-12-05proto: Use %q format-string shortcutJeff Epler
2019-12-05Merge pull request #2352 from hierophect/stm32-displayioScott Shawcroft
STM32: Displayio
2019-12-05Merge pull request #2358 from dhalbert/idempotent-bleio-disconnectScott Shawcroft
Make _bleio.Connection.disconnect() idempotent
2019-12-05remove redundant NOPsHierophect
2019-12-05Define polarity and phase in FourwireHierophect
2019-12-05change default phase for SPIHierophect
2019-12-05Make _bleio.Connection.disconnect() idempotentDan Halbert
2019-12-04Add connection interval and debuggingScott Shawcroft
This also sets TinyUSB to master and to not include its submodules. It also fixes an old displayio example comment and retries gattc reads.
2019-12-04Merge pull request #2351 from hierophect/stm32-i2c-never-resetScott Shawcroft
STM32: Add I2C never reset
2019-12-04Update translationsJeff Epler
2019-12-04Merge remote-tracking branch 'upstream/master' into stm32-displayioHierophect
2019-12-04audiosample: convert to use a protocolJeff Epler
This eases addition of new sample sources, since the manual virtual function dispatch functions are just calls via a protocol
2019-12-04protocols: Allow them to be (optionally) type-safeJeff Epler
Protocols are nice, but there is no way for C code to verify whether a type's "protocol" structure actually implements some particular protocol. As a result, you can pass an object that implements the "vfs" protocol to one that expects the "stream" protocol, and the opposite of awesomeness ensues. This patch adds an OPTIONAL (but enabled by default) protocol identifier as the first member of any protocol structure. This identifier is simply a unique QSTR chosen by the protocol designer and used by each protocol implementer. When checking for protocol support, instead of just checking whether the object's type has a non-NULL protocol field, use `mp_proto_get` which implements the protocol check when possible. The existing protocols are now named: protocol_framebuf protocol_i2c protocol_pin protocol_stream protocol_spi protocol_vfs (most of these are unused in CP and are just inherited from MP; vfs and stream are definitely used though) I did not find any crashing examples, but here's one to give a flavor of what is improved, using `micropython_coverage`. Before the change, the vfs "ioctl" protocol is invoked, and the result is not intelligible as json (but it could have resulted in a hard fault, potentially): >>> import uos, ujson >>> u = uos.VfsPosix('/tmp') >>> ujson.load(u) Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: syntax error in JSON After the change, the vfs object is correctly detected as not supporting the stream protocol: >>> ujson.load(p) Traceback (most recent call last): File "<stdin>", line 1, in <module> OSError: stream operation not supported
2019-12-03Add module and empty parallelbusHierophect
2019-12-03Add I2C never reset, SPI bugfixHierophect
2019-12-03copy from busted branchHierophect
2019-12-02Merge pull request #2345 from jepler/compressed-unicodeScott Shawcroft
translation: Compress as unicode, not bytes
2019-12-02Merge pull request #2297 from jepler/tick-refactorScott Shawcroft
Call background tasks only once per ms
2019-12-02Merge pull request #2306 from jepler/gcc9Scott Shawcroft
build.yml: Use a newer build toolchain
2019-12-02Merge pull request #2344 from hexthat/patch-5Scott Shawcroft
Update zh_Latn_pinyin.po
2019-12-02makeqstrdata: reclaim some more bytes on some translationsJeff Epler
If a translation only has unicode code points 255 and below, the "values" array can be 8 bits instead of 16 bits. This reclaims some code size, e.g., in a local build, trinket_m0 / en_US reclaimed 112 bytes and de_DE reclaimed 104 bytes. However, languages like zh_Latn_pinyin, which use code points above 255, did not benefit.
2019-12-02remove F401 additions to streamlineHierophect
2019-12-02makeqstrdata: fix printing of 'increased length' messageJeff Epler
2019-12-02translation: Compress as unicode, not bytesJeff Epler
By treating each unicode code-point as a single entity for huffman compression, the overall compression rate can be somewhat improved without changing the algorithm. On the decompression side, when compressed values above 127 are encountered, they need to be converted from a 16-bit Unicode code point into a UTF-8 byte sequence. Doing this returns approximately 1.5kB of flash storage with the zh_Latn_pinyin translation. (292 -> 1768 bytes remaining in my build of trinket_m0) Other "more ASCII" translations benefit less, and in fact zh_Latn_pinyin is no longer the most constrained translation! (de_DE 1156 -> 1384 bytes free in flash, I didn't check others before pushing for CI) English is slightly pessimized, 2840 -> 2788 bytes, probably mostly because the "values" array was changed from uint8_t to uint16_t, which is strictly not required for an all-ASCII translation. This could probably be avoided in this case, but as English is not the most constrained translation it doesn't really matter. Testing performed: built for feather nRF52840 express and trinket m0 in English and zh_Latn_pinyin; ran and verified the localized messages such as Àn xià rènhé jiàn jìnrù REPL. Shǐyòng CTRL-D chóngxīn jiāzài. and Press any key to enter the REPL. Use CTRL-D to reload. were properly displayed.
2019-12-02samd: trinket_m0: make board fit againJeff Epler
2019-12-02Merge branch 'master' into gcc9Jeff Epler
2019-12-01Update zh_Latn_pinyin.pohexthat
Added Translations
2019-11-29Merge remote-tracking branch 'origin/master' into tick-refactorJeff Epler
2019-11-29samd: Consolidate small build optimization flagsJeff Epler
.. inline-unit-growth was the same across all boards, and the highest max-inline-insns-auto parameter was shared across 2 of 5 boards, so it's worth a little work to follow the DRY principle
2019-11-27Merge pull request #2331 from dhalbert/uart-blocking-and-timeoutScott Shawcroft
make UART.write be blocking on SAMD; add timeout property