summaryrefslogtreecommitdiff
path: root/py
AgeCommit message (Collapse)Author
2020-01-14Merge pull request #2505 from theodox/masterScott Shawcroft
Make all `PYTHON` env vars into `PYTHON3`
2020-01-14Merge pull request #2504 from rhooper/fix-tuple-subscrScott Shawcroft
Fix tuple subscr
2020-01-13merge from adafruit/circuitpythonDan Halbert
2020-01-13Merge pull request #2457 from hierophect/stm32-cpython-compatScott Shawcroft
STM32: Cpython compatibility flag 2
2020-01-12fix CCCD bonding store; avoid excessive bonding writesDan Halbert
2020-01-11Make all `PYTHON` env vars into `PYTHON3`Steve Theodore
make file contained a mix of references to `PYTHON` and `PYTHON3`, and did not build on a fresh install of Ubuntu (under Windows LXSS)
2020-01-11make types that depend on tuple subscr workRoy Hooper
2020-01-10Merge pull request #2498 from dhalbert/optional-i2c-pullup-checkingScott Shawcroft
Make requiring I2C pullups be optional
2020-01-10Merge pull request #2461 from jepler/urandom-hardfaultsScott Shawcroft
Urandom hardfaults
2020-01-09Make requiring I2C pullups be optionalDan Halbert
2020-01-08use CFLAG to properly set defineHierophect
2020-01-08styleJeff Epler
2020-01-08Merge pull request #2445 from jepler/mp3-jeplayer-fixes5.0.0-beta.3Scott Shawcroft
Fixes for JEplayer
2020-01-08Merge remote-tracking branch 'adafruit/master' into packet_bufferScott Shawcroft
2020-01-08vstr_init_len: Don't crash if (size_t)-1 is passedJeff Epler
In this unusual case, (len + 1) is zero, the allocation in vstr_init succeeds (allocating 1 byte), and then the caller is likely to erroneously access outside the allocated region, for instance with a memset(). This could be triggered with os.urandom(-1) after it was converted to use mp_obj_new_bytes_of_zeros.
2020-01-06Fix more build problemsJeff Epler
2020-01-04changes only for monster m4skMarius-450
2020-01-04CIRCUITPY_DISPLAY_LIMIT = 2Marius-450
2020-01-03Add PacketBuffer and MTU negotiation support.Scott Shawcroft
PacketBuffer facilitates packet oriented BLE protocols such as BLE MIDI and the Apple Media Service. This also adds PHY, MTU and connection event extension negotiation to speed up data transfer when possible.
2020-01-02remove unnecessary GCC pragmasRoy Hooper
2019-12-29Merge branch 'master' into pixelbuf-subscr-changeRoy Hooper
2019-12-20Remove `re` from CPX Displayio build to make space.Scott Shawcroft
2019-12-16py.mk: Fix race condition building .mo filesJeff Epler
By having an order-only dependency on the directory itself, the directory is sure to be created before the rule to create a .mo file is. This fixes a low-freqency error on github actions such as > msgfmt: error while opening "build/genhdr/en_US.mo" for writing: No such file or directory
2019-12-13try 2. make namedtuple types handle subclassesScott Shawcroft
2019-12-13Fix tuple testScott Shawcroft
2019-12-13Revert subscr signature changeRoy Hooper
2019-12-13push changesRoy Hooper
2019-12-13Merge branch 'master' into new-pixelbuf-apiRoy Hooper
2019-12-12merge from masterDan Halbert
2019-12-12py/nlrthumb: Save and restore VFP registers s16-s21 when CPU has them.Damien George
These s16-s21 registers are used by gcc so need to be saved. Future versions of gcc (beyond v9.1.0), or other compilers, may eventually need additional registers saved/restored. See issue #4844.
2019-12-12py/nlr: Use MP_UNREACHABLE at the end of arch-specific nlr_jump funcs.Damien George
Recent versions of gcc perform optimisations which can lead to the following code from the MP_NLR_JUMP_HEAD macro being omitted: top->ret_val = val; \ MP_NLR_RESTORE_PYSTACK(top); \ *_top_ptr = top->prev; \ This is noticeable (at least) in the unix coverage on x86-64 built with gcc 9.1.0. This is because the nlr_jump function is marked as no-return, so gcc deduces that the above code has no effect. Adding MP_UNREACHABLE tells the compiler that the asm code may branch elsewhere, and so it cannot optimise away the code.
2019-12-12py: Introduce MP_UNREACHABLE macro to annotate unreachable code.Damien George
And use it to replace the same pattern at the end of nlrthumb.c:nlr_jump.
2019-12-11Merge remote-tracking branch 'adafruit/master' into ld-cleanupDan Halbert
2019-12-10merge from upstreamDan Halbert
2019-12-10Merge branch 'master' into new-pixelbuf-apiRoy Hooper
2019-12-10working on all portsDan Halbert
2019-12-10gc_free: give a better error when freeing outside of VMJeff Epler
2019-12-10audiocore: Add MP3File using Adafruit_MP3 libraryJeff Epler
2019-12-09Merge pull request #2353 from jepler/audiosample-protocolScott Shawcroft
Convert audiosamples to use micropython "protocols" (safely)
2019-12-06atmel-samd workingDan Halbert
2019-12-05wipDan Halbert
2019-12-05proto: Use %q format-string shortcutJeff Epler
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-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-02Merge pull request #2345 from jepler/compressed-unicodeScott Shawcroft
translation: Compress as unicode, not bytes
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-02Merge branch 'master' into new-pixelbuf-apiRoy Hooper
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-11-29Merge remote-tracking branch 'origin/master' into tick-refactorJeff Epler