Commit Graph

4694 Commits

Author SHA1 Message Date
Scott Shawcroft fb6b438580
Make `getpass` and `traceback` full build only
This leaves much more space on SAMD21 builds that aren't "full builds".
These are new APIs that we don't need to add to old boards.

Also, tweak two Arduino boards to save space on them.
2021-08-11 14:47:35 -07:00
Scott Shawcroft 0c1d6cef75
Merge remote-tracking branch 'adafruit/main' into fix_cp_irremote 2021-08-11 13:43:59 -07:00
Scott Shawcroft 083960ce90
Fix SAMD51 builds and Prox Trinkey
Adds CIRCUITPY_BUSIO_UART to disable UART by raising ValueError
that no pins work.
2021-08-11 11:53:26 -07:00
microDev 93c9d59960
Merge branch 'main' into getpass 2021-08-10 01:00:10 +05:30
Jeff Epler c1ffab7476 Reduce code duplication in traceback module 2021-08-09 08:27:28 -05:00
Jeff Epler bfea6947e5 Improve mp_printf with support for compressed strings
* The new nonstandard '%S' format takes a pointer to compressed_string_t
   and prints it

 * The new mp_cprintf and mp_vcprintf take a format string that is a
   compressed_string_t
2021-08-09 08:27:28 -05:00
microDev 51f8603783
add getpass module 2021-08-09 17:50:28 +05:30
Jeff Epler d59a28db97 Compress word offset table
By storing "count of words by length", the long `wends` table can be
replaced with a short `wlencount` table.  This saves flash storage space.

Extend the range of string lengths that can be in the dictionary.
Originally it was to 2 to 9; at one point it was changed to 3 to 9.
Putting the lower bound back at 2 has a positive impact on the French
translation (a bunch of them, such as "ch", "\r\n", "%q", are used).
Increasing the maximum length gets 'mpossible', ' doit être ',
and 'CircuitPyth' at the long end.  This adds a bit of processing time
to makeqstrdata. The specific 2/11 values are again empirical based on
the French translation on the adafruit_proxlight_trinkey_m0.
2021-08-07 09:23:35 -05:00
microDev 063e3946d6
Merge pull request #5094 from jepler/quirc
Add qrio: Decode QR codes with quirc lib
2021-08-07 09:30:20 +05:30
Jeff Epler 67551c1ac0 qrio: Split QRInfo & PixelPolicy to their own .c/.h files 2021-08-06 09:53:17 -05:00
Jeff Epler bd903f2f03 Add qrio: Decode QR codes with quirc lib 2021-08-04 09:16:00 -05:00
microDev 193a8d2e67
add traceback object 2021-08-04 12:10:57 +05:30
microDev f371c0a609
add traceback module 2021-07-28 18:06:23 +05:30
Dan Halbert b0fb709d83 more gamepad removal 2021-07-26 23:34:25 -04:00
Dan Halbert 901a6c27c0 remove gamepad; deprecate gamepadshift 2021-07-26 22:15:09 -04:00
microDev 79aaa3cc3a
make pre-commit happy
fix formatting
2021-07-23 09:27:54 +05:30
Scott Shawcroft f84cb94819
Remove OSError(0) and old network modules
The newer modules are `socketpool` and `ssl`.

Fixes #3924, related to #2021, closes #1880, closes #2273, closes #2274
2021-07-21 17:33:40 -07:00
Jeff Epler 9a373c4fb9
Merge pull request #4961 from dhalbert/restore-1970-epoch
Restore default epoch to 1970
2021-07-19 14:51:08 -05:00
Kattni Rembor dc2907ac1b Rename _pixelbuf to adafruit_pixelbuf, alias. 2021-07-16 13:31:40 -04:00
Scott Shawcroft 0fadf028ef
Create first BLE-only board, Micro:Bit v2
This fixes build issues with USB off, tweaks the README to allow
for BLE-only boards and adds the Micro:Bit v2 definition.

Fixes #4546
2021-07-14 09:55:51 -07:00
Scott Shawcroft 9fdecacec7
Merge pull request #4903 from jepler/split-type-objects
Split type objects
2021-07-12 16:37:55 -07:00
Kattni Rembor 4579bf9b12 Rename rainbow to rainbowio 2021-07-12 14:40:01 -04:00
Jeff Epler 93c6d16d3c Rename mp_type_attr -> mp_type_get_attr_slot 2021-07-12 07:30:29 -05:00
Jeff Epler 88434c53c7 Rename mp_type_parent -> mp_type_get_parent_slot 2021-07-12 07:30:16 -05:00
Jeff Epler 75e995f372 Rename mp_type_protocol -> mp_type_get_protocol_slot 2021-07-12 07:04:04 -05:00
Jeff Epler 1b2da0cda3 Rename mp_type_getbuffer -> mp_type_get_getbuffer_slot 2021-07-12 07:04:02 -05:00
Jeff Epler cdd879a3cc Rename mp_type_iternext -> mp_type_get_iternext_slot 2021-07-12 07:03:59 -05:00
Jeff Epler 9f6132b2ba Rename mp_type_getiter -> mp_type_get_getiter_slot 2021-07-12 07:03:57 -05:00
Jeff Epler 0efdf4a549 Rename mp_type_subscr -> mp_type_get_subscr_slot 2021-07-12 07:03:55 -05:00
Jeff Epler 6b8190b408 Rename mp_type_binary_op -> mp_type_get_binary_op_slot 2021-07-12 07:03:52 -05:00
Jeff Epler 46b5ed33ed Rename mp_type_unary_op -> mp_type_get_unary_op_slot 2021-07-12 07:03:50 -05:00
Jeff Epler ec53a674cf Rename mp_type_call -> mp_type_get_call_slot 2021-07-12 07:03:25 -05:00
Jeff Epler 9c1434014c remove redundant docs of struct _mp_obj_full_type_t 2021-07-12 07:01:14 -05:00
Jeff Epler 52540a9830 Rename EXTENDED_FIELDS -> MP_TYPE_EXTENDED_FIELDS 2021-07-12 06:57:59 -05:00
Jeff Epler 0b8b16f6ac increase comment on accuracy of the net savings estimate function
Thanks to tyomitch for suggesting the comment could be more accurate.
2021-07-11 08:57:27 -05:00
Jeff Epler 7302bc09a7 rename the type flag to EXTENDED for consistency 2021-07-09 14:59:37 -05:00
Jeff Epler 52e75c645d makeqstrdata: Don't include strings that are a net loss! 2021-07-09 14:26:43 -05:00
Jeff Epler 8836198ff1 TextSplitter: don't mutate 'words'
I was puzzled by why the dictionary words were sorted by length.
It was because TextSplitter sorted its parameter, instead of a copy.

This doesn't affect encoding size, but does affect the encoding NUMBER
of the found words.  We'll deliberately restore sorting by length next,
for other reasons, but not by spooky action.
2021-07-09 14:02:31 -05:00
Jeff Epler 99abd03b7a makeqstrdata: use an extremely accurate dictionary heuristic
Try to accurately measure the costs of including a word in the dictionary
vs the gains from using it in messages.

This saves about 160 bytes on trinket_m0 ja, the fullest translation
for that board.  Other translations on the same board all have savings,
ranging from 24 to 228 bytes.

```
Translation     Before  After   Savings
ja              1164    1324    160
de_DE           1260    1396    136
fr              1424    1652    228
zh_Latn_pinyin  1448    1520    72
pt_BR           1584    1736    152
pl              1592    1640    48
es              1724    1816    92
ko              1724    1816    92
fil             1764    1800    36
it_IT           1896    2040    144
nl              1956    2136    180
ID              2072    2180    108
cs              2124    2148    24
sv              2340    2448    108
en_x_pirate     2644    2740    96
en_GB           2652    2752    100
el              2656    2768    112
en_US           2656    2768    112
hi              2656    2768    112
```
2021-07-09 12:45:49 -05:00
Kattni Rembor 289575a811 Adding rainbow module. 2021-07-08 15:55:13 -04:00
Jeff Epler 26ae1c7705 Move & comment the field access macros 2021-07-07 08:32:59 -05:00
Jeff Epler 44a3da55e6 Fix EXTENDED_FIELDS macro to work with clang
This appears to work with clang versions at least since 3.0.
2021-07-07 08:32:33 -05:00
Jeff Epler 2997113e73 obj.h: Make mp_obj_is_type work between full & non-full types
By comparing the address of the initial 'name' field instead of the
addresses of the objects themselves, a small amount of type safety is
added back, vs just casting to void.

In the event that some other kind of object is passed in as 't',
which happens to have a 'name' field of the right type, the construct
would be (undesirably) accepted but it would almost certainly evaluate
to false at runtime.
2021-07-07 08:31:54 -05:00
Jeff Epler 0d756066e8 milestone: coverage make test_full passes 2021-07-06 10:37:32 -05:00
Jeff Epler df56ba207f WIP 2021-07-06 09:25:56 -05:00
Jeff Epler cd119ca3ec Introduce, use getters for fields which will be optional in types 2021-07-06 09:15:01 -05:00
Dan Halbert 0d9c4cb746 Merge remote-tracking branch 'adafruit/main' into restore-1970-epoch 2021-07-02 09:27:16 -04:00
Dan Halbert af13f9579c Restore default epoch to 1970 2021-07-02 09:04:42 -04:00
Dan Halbert c7ffc2c10b
Merge pull request #4957 from tannewt/ble_serial
Add serial over BLE
2021-07-01 23:05:18 -04:00
Dan Halbert 7f39779f45
Merge pull request #4931 from jepler/struct-time-construct
Allow construction of struct_time from another struct_time
2021-06-30 22:59:46 -04:00