Before, incorrect use when calling a core function would just say
"extra keyword arguments given"; now, it will name the argument:
```python
>>> Synthesizer(bad_kwarg="boo")
TypeError: unexpected keyword argument 'bad_kwarg'
```
with the i2c bus operating at 400kHz this achieves a 4.8kHz SPI clock
rate which could be worse.
It accepts the same style of init sequence as displayio.
tested by scoping the pins on the espressif lcd dev kit with a dummy init sequence:
```python
dotclockframebuffer.ioexpander_send_init_sequence(
bus=bus,
i2c_address=expander_addr,
gpio_address=1,
gpio_data_len=1,
gpio_data=0xff,
cs_bit=1,
mosi_bit=3,
clk_bit=2,
init_sequence=init_sequence)
```
any qstr of >= 3 chars long is a candidate for use; the input byte value
(1) is used to indicate a fixed-length qstr number follows.
Before accounting for the code size changes, this saves ~100 bytes
on trinket m0, but it may end up being a wash due to added code.
A cutoff of length>2 is slightly better for ja and ru and worse for others.
This has to do with the relative frequency of latin characters vs non-latin
characters, is my guess.
lang after before change (- = more free space)
en_US 3132 2996 -134
fr 2136 2060 -76
ja 1916 1724 -232
ru 2196 2000 -196
This seems to only be defined in cmsis files for M7 family MCUs, so
it's not for e.g., makerdiary_m60_keyboard which enables loading of native
code. Lower MCUs don't ever have icache, so the default is "off".
And put back our magic number, because our bytecode format differs
from upstream
drop btree & framebuf natmods, they had additional problems I didn't
want to fix right now.
this implementation is hoped to be smaller. (feather_m4_express/fr fits
unlike the other PR; approximate savings ~600 bytes)
Minor difference to standard Python: A `dict` object has a
`move_to_end` method. However, calling this method always results in
TypeError.
Implementing it this way means that the method table can still be shared
between OrderedDict and builtin dict.
Closes#4408.
and make corresponding simplifications in shared-bindings-matrix,
but directly using the final defines from CFLAGS instead of the
status quo.
The net changes are to disable audiocore & audiomixer on some espressif
devices that have no audio output at all. Other than that, the
shared-bindings-matrix seems to be identical.
On my i5-1235U laptop this speeds LTO "partition=balanced" builds
substantially, because each "partition" can be run on a separate
CPU thread. I used "pygamer" as my test build with a parallelism of
`-j4`, and took the best elapsed time reported over 4 builds.
The improvement was from 34.6s to 24.0s (-30%).
A link-only build (rm build-pygamer/firmware.elf; make -j...) improved
from1 17.4s to 5.1s (-70%)
The size of the resulting firmware is unchanged.
Boards that are nearly full use "-flto-partition=one" to improve code
size optimization. When LTO partition is "one", this feature doesn't help
but it doesn't seem to negatively affect anything either (tested
building trinket_m0)
and re-organize so that esp32 s2/s3 don't do as much at reset
.. it's not necessary (because most data is in esp-idf managed memory)
and doing this saves me from having to debug why reconstruct isn't working
properly on that platform.
This needs to be tested on other platforms again before being merged!
This reduces the stack frame size of mp_builtin___import__ by
limiting the support path length of files from 256 to 96. This
function can be called recursively for nested imports so it adds up.
Also reduce mp_execute_bytecode (vm.c) from 206 a bc call to 124.
This too is recursive and adds up. It is reduced by preventing
some inlining. It may decrease performance slightly when importing
and unpacking.
Adds two new scripts for debugging. One is used from gdb to print
frame sizes in a backtrace. The other prints what pcs use a
particular stack offset. This helps find infrequently used stack
space.
Fixes#8053.