Commit Graph

17476 Commits

Author SHA1 Message Date
Taku Fukada d18d79ac47 Small improvements to the dictionary compression 2020-09-14 01:50:01 +09:00
microDev 5deac8d249 Update board specific safe mode message 2020-09-13 18:22:40 +05:30
Limor "Ladyada" Fried ca136db210
Merge pull request #3407 from ladyada/qtpy_m0
cutie variant
2020-09-12 21:58:46 -04:00
Jeff Epler 15964a4750 makeqstrdata: Avoid encoding problems
Most users and the CI system are running in configurations where Python
configures stdout and stderr in UTF-8 mode.  However, Windows is different,
setting values like CP1252.  This led to a build failure on Windows, because
makeqstrdata printed Unicode strings to its stdout, expecting them to be
encoded as UTF-8.

This script is writing (stdout) to a compiler input file and potentially
printing messages (stderr) to a log or console.  Explicitly configure stdout to
use utf-8 to get consistent behavior on all platforms, and configure stderr so
that if any log/diagnostic messages are printed that cannot be displayed
correctly, they are still displayed instead of creating an error while trying
to print the diagnostic information.

I considered setting the encodings both to ascii, but this would just be
occasionally inconvenient to developers like me who want to show diagnostic
info on stderr and in comments while working with the compression code.

Closes: #3408
2020-09-12 19:43:08 -05:00
lady ada cc57ef8368 add to buildyml! 2020-09-12 19:58:27 -04:00
lady ada 2fac4851a5 fix typo, tested hardware, neopixel doesnt work tho 2020-09-12 19:56:13 -04:00
lady ada 6fff4ec00d cutie variant 2020-09-12 19:00:26 -04:00
Jeff Epler 11eb55cade
Merge pull request #3406 from CarlFK/main
doc fix: remove the text about the non-existing clock specification
2020-09-12 17:51:28 -05:00
Jeff Epler 01fdd9598a disable iimplicit-fallthrough warning inside asf4
.. there is an instance of it that looks like a "true positive", but it only
affects sdhc transfers that are not a multiple of 4 bytes, which I don't think
happens. (sd card blocks are always 512 bytes)  I can fix this in our
asf4 repo but that would mean this should be deferred until after #3384 is
merged, since that also touches asf4 very invasively by adding a whole new
chip family.
2020-09-12 17:48:42 -05:00
Jeff Epler 7151ee85ce _bleio: add missing break statement 2020-09-12 16:30:12 -05:00
Carl Karsten 2f058029e9 doc fix: remove the text about the non-existing clock specification 2020-09-12 15:25:04 -05:00
Jeff Epler 487de0551c
Merge pull request #3401 from weblate/weblate-circuitpython-main
Translations update from Weblate
2020-09-12 15:21:43 -05:00
Jeff Epler 5729097bc4 atmel-samd: enable build error for implicit fallthrough
If any diagnostics occur, we will want to either add `/* FALLTHROUGH */`
or `break;` as appropriate.  I only tested a few builds (trinket m0
and metro m4 express)
2020-09-12 15:11:29 -05:00
Jeff Epler 12d826d941 Add FALLTHROUGH comments as needed
I investigated these cases and confirmed that the fallthrough behavior
was intentional.
2020-09-12 15:11:29 -05:00
Jeff Epler 4d70872b2b make translate 2020-09-12 15:11:02 -05:00
Jeff Epler 54d97251fe modstruct: Improve compliance with python3
While checking whether we can enable -Wimplicit-fallthrough, I encountered
a diagnostic in mp_binary_set_val_array_from_int which led to discovering
the following bug:
```
>>> struct.pack("xb", 3)
b'\x03\x03'
```
That is, the next value (3) was used as the value of a padding byte, while
standard Python always fills "x" bytes with zeros.  I initially thought
this had to do with the unintentional fallthrough, but it doesn't.
Instead, this code would relate to an array.array with a typecode of
padding ('x'), which is ALSO not desktop Python compliant:
```
>>> array.array('x', (1, 2, 3))
array('x', [1, 0, 0])
```
Possibly this is dead code that used to be shared between struct-setting
and array-setting, but it no longer is.

I also discovered that the argument list length for struct.pack
and struct.pack_into were not checked, and that the length of binary data
passed to array.array was not checked to be a multiple of the element
size.

I have corrected all of these to conform more closely to standard Python
and revised some tests where necessary.  Some tests for micropython-specific
behavior that does not conform to standard Python and is not present
in CircuitPython was deleted outright.
2020-09-12 14:07:23 -05:00
Wellington Terumi Uemura 7cb60d3b69 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (793 of 793 strings)

Translation: CircuitPython/main
Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/
2020-09-12 20:18:38 +02:00
Limor "Ladyada" Fried b24d3b886a
Merge pull request #3399 from jepler/feather-m4-quadspi
feather_m4_express: Use quad data mode on flash
2020-09-12 14:18:32 -04:00
Jeff Epler 4fa419a751
Merge pull request #3390 from weblate/weblate-circuitpython-main
Translations update from Weblate
2020-09-12 12:27:07 -05:00
Jeff Epler 40ab5c6b21 compression: Implement ciscorn's dictionary approach
Massive savings.  Thanks so much @ciscorn for providing the initial
code for choosing the dictionary.

This adds a bit of time to the build, both to find the dictionary
but also because (for reasons I don't fully understand), the binary
search in the compress() function no longer worked and had to be
replaced with a linear search.

I think this is because the intended invariant is that for codebook
entries that encode to the same number of bits, the entries are ordered
in ascending value.  However, I mis-placed the transition from "words"
to "byte/char values" so the codebook entries for words are in word-order
rather than their code order.

Because this price is only paid at build time, I didn't care to determine
exactly where the correct fix was.

I also commented out a line to produce the "estimated total memory size"
-- at least on the unix build with TRANSLATION=ja, this led to a build
time KeyError trying to compute the codebook size for all the strings.
I think this occurs because some single unicode code point ('ァ') is
no longer present as itself in the compressed strings, due to always
being replaced by a word.

As promised, this seems to save hundreds of bytes in the German translation
on the trinket m0.

Testing performed:
 - built trinket_m0 in several languages
 - built and ran unix port in several languages (en, de_DE, ja) and ran
   simple error-producing codes like ./micropython -c '1/0'
2020-09-12 10:10:45 -05:00
microDev e9f411bebc Add translation for safe mode 2020-09-12 18:10:04 +05:30
microDev 4da478382d Fix serial console output & add more boards 2020-09-12 17:46:52 +05:30
Scott Shawcroft 8f58669ddd
Fix bug with socket.recv_into size == 0.
It returned 0 when it should have filled the buffer.

Python reference: https://docs.python.org/3/library/socket.html#socket.socket.recv_into
2020-09-11 16:17:20 -07:00
Hosted Weblate 5197085d79 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: CircuitPython/main
Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/
2020-09-11 21:48:01 +02:00
Scott Shawcroft 7611e71a1b
Merge pull request #3374 from kmatch98/shape_update
Add dirty rectangle tracking to Shape display element
2020-09-11 12:47:54 -07:00
Scott Shawcroft 01daf5b8ce
Merge pull request #3378 from DavePutz/issue3266
Fix for #3266: ensure SPI lock is free after a soft reboot
2020-09-11 12:41:06 -07:00
root 870326b221 Moved SPI unlock code 2020-09-11 10:54:46 -05:00
microDev 305bed6d9e Added esp32s2 safe_mode & fixed user_safe_mode 2020-09-11 21:06:54 +05:30
Kevin Matocha 37e85aebd2 Fix off-by-one error, simplify the logic, add comments 2020-09-10 21:34:03 -05:00
Jeff Epler cacb0124ac feather_m4_express: Use quad data mode on flash
Limor confirmed that the all shipping revisions starting with Rev D had QSPI flash chips installed.

Note that when neither EXTERNAL_FLASH_QSPI_SINGLE nor EXTERNAL_FLASH_QSPI_DUAL is specified quad mode is assumed, so this is addressed by removing the setting altogether.
2020-09-10 20:20:21 -05:00
Scott Shawcroft 9256e6b376
Merge pull request #3302 from xiongyihui/main
support to get HID OUT report
2020-09-10 17:35:04 -07:00
Scott Shawcroft c7c90f47b0
Add non-DMA SPI support.
This fixes SPI with PSRAM allocated buffers. DMA with SPI2 was
attempted but produced junk output. This manual copy is less than
2x slower than DMA when not interrupted.

Fixes #3339
2020-09-10 17:32:20 -07:00
Lucian Copeland f95ad7b27c Fix reset pin null reference, construct error null reference 2020-09-10 15:37:43 -04:00
Scott Shawcroft 9e722c8c99
Merge pull request #3375 from DavePutz/issue3296
Correction for Issue #3296 - ble hanging on nrf52840
2020-09-10 12:36:17 -07:00
Scott Shawcroft e5dd2a32f4
Merge pull request #3388 from jerryneedell/jerryn_rfm69
freeze rfm69 and bus_device libraries into feather_m0_rfm69
2020-09-10 11:49:37 -07:00
Scott Shawcroft 1ba28b3edc
Merge pull request #3370 from jepler/compression-bigrams
add bigram compression to makeqstrdata (save ~100 bytes on trinket m0 de_DE)
2020-09-10 11:44:56 -07:00
Dan Halbert f0bb9635bf
MIssed one change for .last_received_report 2020-09-10 14:21:36 -04:00
Scott Shawcroft 683462c1b1
Merge pull request #3326 from tannewt/native_wifi
Add native wifi API with ESP32S2 support
2020-09-10 11:20:44 -07:00
Dan Halbert 40f3cd3615
Change `.report` to `.last_received_report` 2020-09-10 13:26:51 -04:00
Dan Halbert af742b9ba7
Merge pull request #3386 from weblate/weblate-circuitpython-main
Translations update from Weblate
2020-09-10 09:34:05 -04:00
Scott Shawcroft f3fc7c1c72
Add safe mode translation 2020-09-09 14:34:57 -07:00
Jerry Needell 2529ee2359 freeze rfm69 and bus_device libraries int feather_m0_rfm69 2020-09-09 14:54:20 -04:00
Lucian Copeland be199983c1 Merge remote-tracking branch 'upstream/main' into esp32-displayio-fix 2020-09-09 13:24:30 -04:00
Jelle Jager 5322aa5fcd
Translated using Weblate (Dutch)
Currently translated at 99.2% (779 of 785 strings)

Translation: CircuitPython/main
Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/nl/
2020-09-09 18:05:17 +02:00
hierophect 66cf6c46c0
Merge pull request #3382 from microDev1/tempSense
Add esp32s2 internal temp sensor support
2020-09-09 12:05:10 -04:00
root 59165cabbe Removed unneeded pointer 2020-09-09 10:36:55 -05:00
root 61e1c906bf Merge branch 'issue3266' of https://github.com/DavePutz/circuitpython into issue3266 2020-09-09 09:34:55 -05:00
root 24a18c63f9 Moved SPI unlock to reset_board_busses() 2020-09-09 09:32:25 -05:00
Jeff Epler 0eee93729a Fix decompression of unicode values above 2047
Two problems: The lead byte for 3-byte sequences was wrong, and one
mid-byte was not even filled in due to a missing "++"!

Apparently this was broken ever since the first "Compress as unicode,
not bytes" commit, but I believed I'd "tested" it by running on the
Pinyin translation.

This rendered at least the Korean and Japanese translations completely
illegible, affecting 5.0 and all later releases.
2020-09-08 20:54:47 -05:00
Kevin Matocha d600759bc8 Utilize MIN and MAX functions from py/misc.h 2020-09-08 20:02:34 -05:00