summaryrefslogtreecommitdiff
path: root/py
AgeCommit message (Collapse)Author
2020-08-27Merge remote-tracking branch 'adafruit/main' into native_wifiScott Shawcroft
2020-08-25Merge pull request #3318 from jepler/interrupt-serial-rxJeff Epler
supervisor: check for interrupt during rx_chr
2020-08-25Merge remote-tracking branch 'adafruit/main' into native_wifiScott Shawcroft
2020-08-25mp_obj_print_helper: Handle a ctrl-c that comes in during printingJeff Epler
In #2689, hitting ctrl-c during the printing of an object with a lot of sub-objects could cause the screen to stop updating (without showing a KeyboardInterrupt). This makes the printing of such objects acutally interruptable, and also correctly handles the KeyboardInterrupt: ``` >>> l = ["a" * 100] * 200 >>> l ['aaaaaaaaaaaaaaaaaaaaaa...aaaaaaaaaaa', Traceback (most recent call last): File "<stdin>", line 1, in <module> KeyboardInterrupt: >>> ```
2020-08-21Make socket reads interruptableScott Shawcroft
2020-08-20merge from upstream; working; includes debug_out code for debugging via ↵Dan Halbert
Saleae for posterity
2020-08-19Add basic error handlingScott Shawcroft
2020-08-19Add espidf module.Scott Shawcroft
2020-08-19SSL works until it runs out of memoryScott Shawcroft
2020-08-19SocketPool stubbed outScott Shawcroft
2020-08-19Ping work and start to add socketpoolScott Shawcroft
2020-08-19Fix ipaddress import and parse ipv4 stringsScott Shawcroft
2020-08-19Add ipaddressScott Shawcroft
2020-08-19Scanning WIP. Need to sort out supervisor memoryScott Shawcroft
2020-08-19First crack at native wifi APIScott Shawcroft
2020-08-18Split pulseio.PWMOut into pwmioScott Shawcroft
This gives us better granularity when implementing new ports because PWMOut is commonly implemented before PulseIn and PulseOut. Fixes #3211
2020-08-18Merge pull request #3295 from tannewt/turn_off_terminalioScott Shawcroft
Turn off terminalio for ja and ko
2020-08-18Calculate the Huffman codebook without MP_QSTRsTaku Fukada
2020-08-17Turn off terminalio for ja and koScott Shawcroft
The font is missing many characters and the build needs the space. We can optimize font storage when we get a good font. The serial output will work as usual.
2020-08-16makeqstrdata: don't print "compression incrased length" messagesJeff Epler
This check as implemented is misleading, because it compares the compressed size in bytes (including the length indication) with the source string length in Unicode code points. For English this is approximately fair, but for Japanese this is quite unfair and produces an excess of "increased length" messages. This message might have existed for one of two reasons: * to alert to an improperly function huffman compression * to call attention to a need for a "string is stored uncompressed" case We know by now that the huffman compression is functioning as designed and effective in general. Just to be on the safe side, I did some back-of-the-envelope estimates. I considered these three replacements for "the true source string size, in bytes": + decompressed_len_utf8 = len(decompressed.encode('utf-8')) + decompressed_len_utf16 = len(decompressed.encode('utf-16be')) + decompressed_len_bitsize = ((1+len(decompressed)) * math.ceil(math.log(1+len(values), 2)) + 7) // 8 The third counts how many bits each character requires (fewer than 128 characters in the source character set = 7, fewer than 256 = 8, fewer than 512 = 9, etc, adding a string-terminating value) and is in some way representative of the best way we would be able to store "uncompressed strings". The Japanese translation (largest as of writing) has just a few strings which increase by this metric. However, the amount of loss due to expansion in those cases is outweighed by the cost of adding 1 bit per string to indicate whether it's compressed or not. For instance, in the BOARD=trinket_m0 TRANSLATION=ja build the loss is 47 bytes over 300 strings. Adding 1 bit to each of 300 strings will cost about 37 bytes, leaving just 5 Thumb instructions to implement the code to check and decode "uncompressed" strings in order to break even.
2020-08-12Don't define SHARPDISPLAY when !DISPLAYIOJeff Epler
.. even if FULL_BUILD
2020-08-12sharpmemory: Implement support for Sharp Memory Displays in framebufferioJeff Epler
2020-08-04"pop from empty %q"Jeff Epler
Saves 12 bytes code on trinket m0
2020-08-04py: mp_obj_get_type_qstr as macro saves 24 bytesJeff Epler
2020-08-04Combine some "can't convert" messagesJeff Epler
2020-08-04Combine 'index out of range' messagesJeff Epler
2020-08-04various: Use mp_obj_get_type_qstr more widelyJeff Epler
This removes runtime allocations of the cstring version of the qstring. It is not a size improvement
2020-08-04Use qstrs to save an additional 4 bytesJeff Epler
2020-08-04fix exception type for pop from empty setJeff Epler
2020-08-04py: introduce, use mp_raise_msg_vlistJeff Epler
This saves a very small amount of flash, 8 bytes on trinket_m0
2020-08-04Combine similar strings to reduce size of translationsJeff Epler
This is a slight trade-off with code size, in places where a "_varg" mp_raise variant is now used. The net savings on trinket_m0 is just 32 bytes. It also means that the translation will include the original English text, and cannot be translated. These are usually names of Python types such as int, set, or dict or special values such as "inf" or "Nan".
2020-08-02wip: compilesDan Halbert
2020-07-30Merge remote-tracking branch 'origin/main' into blm_badgeJeff Epler
2020-07-29Merge pull request #3222 from WarriorOfWire/pick_micropythonScott Shawcroft
py/compile: Don't await __aiter__ special method in async-for.
2020-07-28Upgrade ulabJeff Epler
This version * moves source files to reflect module structure * adds inline documentation suitable for extract_pyi * incompatibly moves spectrogram to fft * incompatibly removes "extras" There are some remaining markup errors in the specific revision of extmod/ulab but they do not prevent the doc building process from completing.
2020-07-28Merge remote-tracking branch 'adafruit/main' into blm_badgeDan Halbert
2020-07-28add blm_badge; add CIRCUITPY_AUDIOBUSIOIO_I2SOUTDan Halbert
2020-07-27 adjust stack for SAMD21 to accomodate larger pystack -- update frozen ↵Jerry Needell
module adafruit_busdevice
2020-07-24py/compile: Don't await __aiter__ special method in async-for.Jonathan Hogg
MicroPython's original implementation of __aiter__ was correct for an earlier (provisional) version of PEP492 (CPython 3.5), where __aiter__ was an async-def function. But that changed in the final version of PEP492 (in CPython 3.5.2) where the function was changed to a normal one. See https://www.python.org/dev/peps/pep-0492/#why-aiter-does-not-return-an-awaitable See also the note at the end of this subsection in the docs: https://docs.python.org/3.5/reference/datamodel.html#asynchronous-iterators And for completeness the BPO: https://bugs.python.org/issue27243 To be consistent with the Python spec as it stands today (and now that PEP492 is final) this commit changes MicroPython's behaviour to match CPython: __aiter__ should return an async-iterable object, but is not itself awaitable. The relevant tests are updated to match. See #6267.
2020-07-24require async for and async with to actually be in an async def method ↵Kenny
instead of just a generator
2020-07-23remove new char*s because m0 is way oversubscribedKenny
2020-07-23add coroutine behavior for generatorsKenny
coroutines don't have __next__; they also call themselves coroutines. This does not change the fact that `async def` methods are generators, but it does make them behave more like CPython.
2020-07-23wip: ATT protocolDan Halbert
2020-07-22py/py.mk: Use additional CFLAGS to compile string0.c.Damien George
Otherwise functions like memset might get optimised to call themselves (eg with gcc 10). And provide CFLAGS_BUILTIN so these options can be changed by a port if needed. Fixes issue #6053.
2020-07-22Add externs. GCC10 complains about duplicate definesScott Shawcroft
2020-07-22Merge branch 'main' into memmonitorScott Shawcroft
2020-07-21Turn off find when CPYTHON_COMPAT is offScott Shawcroft
2020-07-21Merge remote-tracking branch 'adafruit/main' into bytearray_findScott Shawcroft
2020-07-21Merge pull request #3160 from tannewt/enable_pystackScott Shawcroft
Enable PYSTACK to keep function state out of the heap
2020-07-21Only add .find without CPYTHON_COMPATScott Shawcroft