Commit Graph

5514 Commits

Author SHA1 Message Date
Jeff Epler
60fa26022b
build fixes for persistent code 2023-09-22 10:39:41 -05:00
Jeff Epler
5c0f8f7786
fixes for circuitpython nativeglue 2023-09-22 10:39:28 -05:00
Jeff Epler
a285a33076
Restore our defines for exception chaining 2023-09-22 10:39:12 -05:00
Jeff Epler
9104654930
makeqstrdata: ensure _lt and _gt qstrs are sorted early
this fixes a build error because their numbers have to be <256
2023-09-22 10:38:52 -05:00
Dan Halbert
10b95a1998 add translate.h and linker.h includes back to runtime.h; remove linker.h refs; remove top-level lib/cyw43-driver 2023-09-20 22:00:09 -04:00
Jeff Epler
a00f2d8940
array extend/append need extern linkage & right names 2023-09-20 11:46:51 -05:00
Jeff Epler
7a386545ca
re-add translation make rules 2023-09-20 11:46:35 -05:00
Jeff Epler
a760794449
re-add objtraceback.o 2023-09-20 11:46:22 -05:00
Jeff Epler
f83a235c85
re-add mp_obj_exception_get_native 2023-09-20 11:46:14 -05:00
Jeff Epler
76ef77a620
fix exception chaining, preprocessor error 2023-09-20 11:26:57 -05:00
Jeff Epler
e068ff7234
fix compile errors, fix mp_raise prototypes 2023-09-20 11:26:41 -05:00
Jeff Epler
1ab884ab0f
fix compile errors 2023-09-20 11:26:26 -05:00
Jeff Epler
c87703512a
fix conditional nesting 2023-09-20 11:26:17 -05:00
Jeff Epler
37c8b0df9c
fix argument name 2023-09-20 11:26:03 -05:00
Jeff Epler
6b8ee2ca6f
remove old python style checking for "special accessors"
this appears to be properly handled by other (new?) code, but
tests will tell.
2023-09-20 11:25:58 -05:00
Jeff Epler
bb6d530c1d
slots & macro moved to header 2023-09-20 11:25:09 -05:00
Jeff Epler
7806044e5e
string construction changed 2023-09-20 11:25:01 -05:00
Jeff Epler
9cedfc4cbd
implemented as macro now 2023-09-20 11:24:53 -05:00
Jeff Epler
ee51968d9d
can't be static, is called from builtins 2023-09-20 11:24:45 -05:00
Jeff Epler
4ed939f26e
fix compile error 2023-09-20 11:24:26 -05:00
Jeff Epler
680b94d463
fix compile erors 2023-09-20 11:24:22 -05:00
Jeff Epler
be62395c47
fix indentation 2023-09-20 11:24:15 -05:00
Jeff Epler
f9fb567a07
fix CP vs MP differences in exception-throwing functions 2023-09-20 11:24:07 -05:00
Jeff Epler
37a881f4d3
Get the type object for the constructor call 2023-09-20 11:23:49 -05:00
Jeff Epler
082b299a0c
spelling 2023-09-20 11:23:39 -05:00
Jeff Epler
8e00c69cdf
spelling 2023-09-20 11:22:34 -05:00
Jeff Epler
cd3ca6b6a6
fix array object name 2023-09-20 11:22:25 -05:00
Jeff Epler
fb2eb6a7d9
add mp_obj_is_tuple_compatible 2023-09-20 11:22:01 -05:00
Jeff Epler
e4e58ac223
add mp_obj_get_type_qstr 2023-09-20 11:21:56 -05:00
Jeff Epler
a9d6661d5b
add and fix exception prototypes 2023-09-20 11:21:50 -05:00
Jeff Epler
b499b7fdc2
add missing type objects 2023-09-20 11:21:34 -05:00
Jeff Epler
57c3dfd579
fix missing define of NONSTANDARD_TYPECODES 2023-09-20 11:21:10 -05:00
Jeff Epler
649ea62f57
fix typo 2023-09-20 11:21:02 -05:00
Jeff Epler
73612ac119
Fix availability of MP_ERROR_TEXT in misc.h 2023-09-20 11:20:56 -05:00
Jeff Epler
aceb573c88
fix makeversionhdr 2023-09-20 11:20:45 -05:00
Jeff Epler
dc277f0aff
fix HEAP_PTR macro 2023-09-20 11:20:39 -05:00
Jeff Epler
36371fe757
fix compiling gc.c 2023-09-20 11:20:29 -05:00
Jeff Epler
0c64275cc6
Add header for PLACE_IN_ITCM 2023-09-20 11:19:57 -05:00
Dan Halbert
4d175ab41a convert to MP_DEFINED_CONST_OBJ_TYPE() 2023-09-19 21:09:29 -04:00
Dan Halbert
2c0fa0f7dc initial merge from v1.20.0; just satisifying conflicts 2023-09-19 11:10:12 -04:00
Jeff Epler
a8b81ce943
Enhance unexpected keyword argument detection
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'
```
2023-09-15 10:39:14 -05:00
Jeff Epler
4b41fdb586
Fast(ish) special purpose bitbang spi over i2c
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)
```
2023-09-14 14:42:48 -05:00
Scott Shawcroft
0928a95bb2
Merge pull request #8351 from jepler/dotclockframebuffer
Dotclockframebuffer
2023-09-07 13:21:29 -07:00
Jeff Epler
ed9cacf41d
Add DotClockFramebuffer 2023-08-30 10:30:15 -05:00
Jeff Epler
4d8b354c13
Use qstrs to improve compression
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
2023-08-23 15:16:53 -05:00
Dan Halbert
88c22d5052 remove last uses of 'u' prefix 2023-08-22 12:57:47 -04:00
Jeff Epler
0cab3359df
ignore some cast-align diagnostics 2023-08-20 14:26:48 -05:00
Jeff Epler
1399d0f25b
guard mp_type_native_gen_wrap declaration with MICROPY_EMIT_NATIVE 2023-08-20 14:26:27 -05:00
Jeff Epler
f9e99bd3c3
Fix picow build 2023-08-20 11:30:36 -05:00
Jeff Epler
d5d566dc65
Don't assume __ICACHE_PRESENT is defined
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".
2023-08-20 10:15:56 -05:00
Jeff Epler
d277294a14
Alias m_new_ll to m_new
this saves changing uses of it in ports/ and if we re-add ll later, it'll
make it easier to find the places that needed long-lived allocation.
2023-08-20 10:15:55 -05:00
Jeff Epler
7e38b79e21
Add mp_type_native_coro_wrap 2023-08-20 10:15:55 -05:00
Jeff Epler
b0bf36ef3b
Fix building with !MICROPY_PY_ASYNC_AWAIT 2023-08-19 17:17:50 -05:00
Jeff Epler
a94301122a
Make natmods work again.
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.
2023-08-19 16:59:13 -05:00
Dan Halbert
bfccb77ec1 asyncio test fixes and asyncio library updates 2023-08-18 13:16:16 -04:00
Jeff Epler
8d5e844b00
Implement traceback length limit 2023-08-15 13:10:31 -05:00
Jeff Epler
df1dd6ad3c
make 'import uerrno' work again in unix port
this fixes tests that 'import uerrno'.
2023-08-15 11:50:13 -05:00
Dan Halbert
3d48e87e60 jepler: fix 18 tests (redo commit to be correct) 2023-08-14 18:34:32 -04:00
Dan Halbert
b73f05fe64 turn off viper tests; thanks jepler 2023-08-14 16:43:07 -04:00
Dan Halbert
8cf5b6e707 fixes to unix port support; thanks @jepler 2023-08-14 09:51:52 -04:00
Dan Halbert
d582407b06 pre-commit fixes 2023-08-14 00:59:22 -04:00
Dan Halbert
2171e67c1b merge latest adafruit/main 2023-08-13 19:43:54 -04:00
Dan Halbert
27c7807693 silabs build needs work; other builds are working 2023-08-13 19:05:16 -04:00
Dan Halbert
850877a85f wip; fix generators; typos 2023-08-13 00:30:59 -04:00
Dan Halbert
433059023d fix -j1 builds, particularly CPX 2023-08-12 16:49:03 -04:00
Dan Halbert
48e404ab90 wip; fix frozen; still need to fix -j1 for frozen 2023-08-12 15:44:27 -04:00
Dan Halbert
1b19ed4c39 change compilation verbosity options; fix mpy-cross 2023-08-12 13:38:17 -04:00
Dan Halbert
8a89a3d425 sort TRANSLATION()'s 2023-08-11 13:36:03 -04:00
Dan Halbert
10b94796c0 wip; fix more m_malloc and gc_alloc 2023-08-11 00:30:34 -04:00
Dan Halbert
fe0e2f13bc wip; fix qstr processing 2023-08-10 20:06:32 -04:00
Dan Halbert
0dca530b70 wip; Trinket M0 compiles 2023-08-09 15:20:10 -04:00
Dan Halbert
2ff8667e75 wip; remove long-lived functionality; remove PR#2614
Trinket M0 compile has no compilation errors, but has link errors to fix.
2023-08-08 20:41:17 -04:00
Dan Halbert
0d2c3c3f08 wip: continuing compilation fixes; mp_obj_alloc everywhere 2023-08-07 20:45:57 -04:00
Jeff Epler
46db0366b8
OrderedDict.move_to_end: alternate implementation of #8234
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.
2023-08-04 09:26:26 -05:00
Dan Halbert
465d1c673e wip 2023-08-03 23:29:00 -04:00
Dan Halbert
0d4bc8c163 initial v1.19.1 merge; not compiled yet 2023-08-01 13:50:05 -04:00
Jeff Epler
272a2dcdb0
Merge pull request #8218 from jepler/esp32-camera
Update the camera board to use ESP32-S3 microcontroller
2023-07-31 14:48:50 -05:00
Jeff Epler
cd181eb5b4
expand on the 0/1 requirement 2023-07-31 10:44:06 -05:00
Jeff Epler
e8307a4c02
enable-if-any/all deserve some commentary. 2023-07-31 10:21:53 -05:00
Dan Halbert
f466a4373e
Merge pull request #8222 from tannewt/fat_window_align
Align fatfs window buffer for tinyusb
2023-07-27 20:35:23 -04:00
Scott Shawcroft
e45a61f57e
Align fatfs window buffer for tinyusb
Also, update tinyusb.
2023-07-27 09:15:58 -07:00
Dan Halbert
5cc42d5041
Merge pull request #8126 from jepler/update-ulab-6.3.2
update ulab to 6.3.2
2023-07-26 11:54:42 -04:00
Jeff Epler
c026704fd2
gifio does require displayio 2023-07-26 08:54:02 -05:00
Jeff Epler
d83b8db678
restore fontio define 2023-07-25 21:34:57 -05:00
Jeff Epler
9a18524c30
simplify circuitpy_mpconfig with enable-if-any, -all
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.
2023-07-25 19:56:08 -05:00
Jeff Epler
fd60cccb06
Re-enable ulab at the expense of some other modules
.. and gate audiomixer based on audiocore (should be no net change)

.. and get rid of now-redundant enables in the espressif mpconfigport
2023-07-25 16:01:11 -05:00
Jeff Epler
8579766ede
Optimize ulab for size on samd51/same51 2023-07-25 09:35:49 -05:00
Scott Shawcroft
525dad71c3
Add RuntimeError_varg and fix imx capitalization 2023-07-20 16:00:43 -07:00
Scott Shawcroft
d7fa7380b8
Move some find_qstr wrappers to tcm next to it 2023-07-20 11:20:32 -07:00
KB Sriram
03e93f8e6c py/objdict: Fix fromkeys to return the right type.
Fixes https://github.com/adafruit/circuitpython/issues/8173

It looks like a small fix, and mostly independent of upstream
plans around https://github.com/micropython/micropython/pull/6173

I also filed an issue upstream
https://github.com/micropython/micropython/issues/12011
2023-07-14 22:03:06 -07:00
Scott Shawcroft
2686beab36
Basic USB host support and keyboard workflow
Connects up read, write and ctrl_transfer to TinyUSB. USB Host
support is available on iMX RT and RP2040.

Fixes #6527 (imx) and fixes #5986 (rp2).
2023-07-10 14:22:21 -07:00
Dan Halbert
4c55dc2445
Merge pull request #8096 from jepler/lto-parallel
Speed LTO builds by using multiple threads
2023-06-20 13:32:47 -04:00
Jeff Epler
cae02f1cdf
Speed LTO builds by using multiple threads
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)
2023-06-20 11:01:46 -05:00
Jeff Epler
666fb94ca3
Merge pull request #8056 from jepler/matrixportal-s3
Add Adafruit MatrixPortal S3 board def & update protomatter
2023-06-13 19:34:08 -05:00
Jeff Epler
d4913b04e0 rgbmatrix: update protomatter
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!
2023-06-08 10:43:32 -05:00
Jeff Epler
c408193ffe
Merge pull request #8048 from jepler/synthio-biquad
Synthio: switch to per-note biquad filtering
2023-06-07 14:48:31 -05:00
Scott Shawcroft
b71f394127
Merge pull request #8071 from tannewt/cpx_stack_size
Slim down stack frames
2023-06-07 09:25:28 -07:00
Scott Shawcroft
dd71ae10b9
Slim down stack frames
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.
2023-06-06 16:20:47 -07:00
Dan Halbert
46c5be07ff remove debugging print 2023-06-06 11:04:27 -04:00
Dan Halbert
b576ec21b3 add tools to common submodules to fetch 2023-06-05 19:04:32 -04:00