Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge from micropython v1.22.2 #9469

Merged
merged 334 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
334 commits
Select commit Hold shift + click to select a range
d8a2634
esp32/mphalport: Add function to wake main from separate FreeRTOS task.
pi-anl Nov 1, 2023
06a7bf9
esp32/usb: Wake main thread when USB receives data.
pi-anl Nov 1, 2023
7ad84e0
lib/littlefs: Update LittleFS to v2.8.1.
DvdGiessen Jun 29, 2023
303ccca
all: Replace "black" with "ruff format".
jimmo Oct 21, 2023
bbd8760
all: Update Python formatting to ruff-format.
jimmo Oct 21, 2023
aa329d1
top: Update .git-blame-ignore-revs for latest formatting commit.
dpgeorge Nov 3, 2023
2eda513
py/mkrules.mk: Add rule for compiling auto-generated source files.
jimmo Aug 3, 2023
c3c7c60
rp2/boards/make-pins.py: Don't generate qstrs.
jimmo Aug 3, 2023
fc54d25
stm32/boards/make-pins.py: Don't generate qstrs.
jimmo Aug 3, 2023
3f99dbd
nrf/boards/make-pins.py: Don't generate qstrs.
jimmo Aug 3, 2023
df28aa1
renesas-ra/boards/make-pins.py: Don't generate qstrs.
jimmo Aug 3, 2023
cb37b7b
cc3200/boards/make-pins.py: Don't generate qstrs.
jimmo Aug 4, 2023
59f3c7f
examples/pins.py: Remove this pins printing example.
jimmo Aug 3, 2023
1ee5731
ports: Remove SRC_QSTR_AUTO_DEPS from all ports' Makefiles.
jimmo Aug 3, 2023
9cabee8
ports: Standardise arguments and output for make-pins.py script.
jimmo Aug 3, 2023
b0aec6a
esp32/machine_pin: Make irq object a sub-field of pin object.
jimmo Aug 7, 2023
4bd6ec9
tools/boardgen.py: Add initial implementation of a common make-pins.py.
jimmo Aug 7, 2023
98dff07
stm32/boards: Fix errors in pins.csv and af.csv.
jimmo Aug 10, 2023
286b1b3
stm32/boards: Format stm32 alternate function csv files.
jimmo Nov 2, 2023
b4236c7
stm32: Rename pin_obj_t to machine_pin_obj_t.
jimmo Aug 8, 2023
724ebb9
stm32/boards/make-pins.py: Update to use tools/boardgen.py.
jimmo Aug 8, 2023
ff6c2ad
stm32/boards/make-pins.py: Add initial support for H7 dual-pad pins.
jimmo Nov 2, 2023
4d568a5
samd/boards/make-pins.py: Update to use tools/boardgen.py.
jimmo Aug 14, 2023
c0b64a3
mimxrt/boards/make-pins.py: Update to use tools/boardgen.py.
jimmo Aug 16, 2023
1f804e0
renesas-ra/boards/make-pins.py: Update to use tools/boardgen.py.
jimmo Aug 24, 2023
6ef9b29
{cc3200,nrf}/boards/make-pins.py: Add a note about tools/boardgen.py.
jimmo Aug 25, 2023
9a4d4db
py/runtime: Remove declaration of function from inside function.
dpgeorge Nov 3, 2023
c85db05
py/lexer: Change token position for new lines.
MathieuNumworks Oct 24, 2023
b6a9778
py/misc: Change sizeof to offsetof for variable-length alloc.
jimmo Nov 3, 2023
e5014a4
stm32: Add configuration options for analog switches.
iabdalkader Oct 16, 2023
47ea831
stm32: Add STM32H5 support for sleep mode.
renestraub Oct 21, 2023
d95f5aa
rp2/machine_uart: Fix handling of serial break condition.
mvds00 Oct 24, 2023
b41055a
rp2/machine_adc: Refactor channel/pin validation code.
iabdalkader Oct 25, 2023
8c432ea
rp2: Remove 1ms timeout to make idle waiting tickless.
projectgus Oct 31, 2023
8414228
stm32/boards/make-pins.py: Fix H7 ADC generation.
jimmo Nov 3, 2023
c028f95
stm32/boards/stm32f4x9_af.csv: Fix DCMI_VSYNC.
jimmo Nov 3, 2023
09c9c8a
stm32/boards/stm32g474_af.csv: Fix final row ADC column.
jimmo Nov 4, 2023
ae3b1cf
mimxrt/modmachine: Fix settings for the MIMXRT1170 board.
robert-hh Nov 3, 2023
e63d718
docs/mimxrt: Change the examples which denote a Pin with a number.
robert-hh Nov 4, 2023
47ed06b
stm32/boards/make-pins.py: Only support ADC1-3.
jimmo Nov 4, 2023
6866d17
docs/samd: Fix the pinout for SAMD21 Itsy Bitsy Express M0.
robert-hh Aug 28, 2023
2c1f238
samd/mpconfigport: Set MICROPY_USE_INTERNAL_ERRNO to 1.
robert-hh Sep 7, 2023
59afeb0
samd/machine_uart: Add machine_uart_set_baudrate() function.
robert-hh Sep 18, 2023
c35cc63
samd/pin_af: Fix a typo in a conditional compile.
robert-hh Nov 4, 2023
bea6ff8
tools/tinytest-codegen.py: Externalise tests list.
agatti Nov 2, 2023
9be0623
shared/libc/string0: Don't deref args for n==0 case.
jimmo Nov 6, 2023
4212799
py/qstr: Special case qstr_find_strn for empty string.
jimmo Nov 6, 2023
03eae48
extmod/machine_adc_block: Factor esp32 ADCBlock bindings to common code.
dpgeorge Oct 25, 2023
958c6d9
windows: Use the MicroPython logo as application icon.
stinos Nov 15, 2022
dff2938
extmod/machine_i2c: Do a fast poll during I2C.scan().
dpgeorge Nov 8, 2023
4cf7410
extmod/vfs_reader: Add file ioctl to set read buffer size.
pi-anl Oct 31, 2023
bbc5a18
tools/mpremote: Add ioctl to specify large read buffer size.
pi-anl Nov 1, 2023
2d363a2
shared/tinyusb: Schedule TinyUSB task function from dcd_event_handler.
projectgus Oct 25, 2023
bcbdee2
rp2: Change to use TinyUSB dcd_event_handler hook.
projectgus Oct 25, 2023
26d5032
samd: Switch TinyUSB to run via a scheduled task.
projectgus Nov 1, 2023
4679a90
CODECONVENTIONS: Update for change from black to ruff format.
andrewleech Nov 8, 2023
f07f90f
mimxrt/boards/OLIMEX_RT1010: Adjust the UART pin assignment.
robert-hh Oct 19, 2023
fbb7c32
esp32/esp32_rmt: Change RMT.source_freq() to class method.
bulletmark Oct 24, 2023
2888c5b
esp32/esp32_rmt: Add RMT.PULSE_MAX constant.
bulletmark Oct 31, 2023
af52e1f
stm32/boards/NUCLEO_WL55: Freeze LoRa driver.
jimmo Nov 8, 2023
3b95469
extmod/modbluetooth: Initialise nlr_jump_callback_top for IRQ handlers.
DvdGiessen Oct 30, 2023
3659139
extmod/vfs_posix_file: Make standard file objects non-const.
stinos Nov 6, 2023
d46dc5e
shared/tinyusb: Expose mp_usbd_task as a public function.
dpgeorge Nov 9, 2023
a00c9d5
rp2/mphalport: Run TinyUSB stack while waiting for CDC input/output.
dpgeorge Nov 9, 2023
033361d
samd/mphalport: Run TinyUSB stack while waiting for CDC input/output.
projectgus Nov 9, 2023
5e3f0e7
samd: Switch to shared TinyUSB implementation.
projectgus Nov 7, 2023
f567a92
shared/tinyusb: Add a helper for hex string conversion.
projectgus Nov 7, 2023
8b1980a
samd: Use unique id for USB serial number.
projectgus Nov 7, 2023
37c1c5f
stm32/mpu: Enable STM32WB mpu use to support qspi flash.
pi-anl Jun 7, 2023
1879db7
extmod/extmod.mk: Allow enabling lwip loopback support.
peterzuger Nov 3, 2023
a23dbdc
stm32: Add optional lwip loopback support.
peterzuger Nov 3, 2023
36e162f
tests/net_hosted/asyncio_loopback.py: Add loopback test.
peterzuger Nov 3, 2023
70feb12
stm32/boards/NUCLEO_F446RE: Add UARTs 1, 3 and 4.
ThomHPL Nov 16, 2023
0cc100b
stm32/boards/NUCLEO_H563ZI: Add new NUCLEO-H563ZI board definition.
renestraub Aug 6, 2023
c349411
stm32/sdcard: Add SD card support for H5 MCUs.
dpgeorge Nov 16, 2023
92741a3
stm32/boards/STM32H573I_DK: Enable the SD card.
dpgeorge Nov 17, 2023
a968888
py/obj: Fix mp_obj_is_type compilation with C++.
stinos Nov 13, 2023
6f01933
ports: Fix incorrect identifiers on Arduino boards.
sebromero Nov 9, 2023
6117aa6
renesas-ra/boards/ARDUINO_PORTENTA_C33: Fix incorrect I2C pins.
sebromero Nov 15, 2023
57cce79
esp32/modsocket: Implement socket connect timeout.
projectgus Nov 8, 2023
fce8d9f
esp32/modsocket: Try garbage collection if the socket limit is reached.
projectgus Nov 8, 2023
f397a3e
py/objslice: Validate that the argument to indices() is an integer.
dpgeorge Nov 21, 2023
917b561
esp32/boards/sdkconfig.base: Fix increasing log level via esp.osdebug().
projectgus Nov 7, 2023
a800ed5
docs/library/esp: Correct the description of esp.osdebug().
projectgus Nov 7, 2023
a85c3c4
esp32/boards/ESP32_GENERIC: Reduce size of D2WD variant to fit in flash.
dpgeorge Nov 22, 2023
f72a7dd
esp32/uart: Preserve console UART clock, fix UART console with DFS.
xyzzy42 Nov 8, 2023
92f0469
esp32/uart: Make compatible with sclk type change in ESP-IDF 5.3.
xyzzy42 Nov 14, 2023
960eef7
esp32/network_wlan: Reduce RAM usage if SPIRAM fails to initialise.
projectgus Nov 14, 2023
d615492
esp32/network_wlan: Fix network.WLAN.status() to return better info.
IhorNehrutsa Nov 9, 2023
094b52b
esp32/esp32_rmt: Fix RMT looping.
bulletmark Nov 20, 2023
992cd64
py/mkrules: Add support for custom manifest variables.
jimmo Nov 9, 2023
cfcd0c4
stm32: Add missing header include for debug builds.
iabdalkader Nov 21, 2023
9c7067d
py/modbuiltins: Share vstr_add_char's implementation of utf8 encoding.
jepler Nov 23, 2023
516cc28
shared/runtime/softtimer: Generalise soft_timer to work without SysTick.
dpgeorge Nov 14, 2023
c9a9b2e
rp2: Integrate soft_timer using the alarm pool.
dpgeorge Nov 14, 2023
633c604
rp2/mpbthciport: Rework HCI polling timer to use soft_timer.
dpgeorge Nov 14, 2023
fc94399
rp2/mpnetworkport: Rework lwIP polling to use soft_timer.
dpgeorge Nov 14, 2023
12ef8a5
rp2/mphalport: Optimise exit of mp_hal_delay_ms loop.
dpgeorge Nov 14, 2023
e182f38
rp2/cyw43_configport: Implement cyw43_delay_ms as mp_hal_delay_ms.
dpgeorge Nov 14, 2023
6ba57f7
lib/uzlib: For matches of the same length, take the closest one.
dpgeorge Nov 29, 2023
c554df5
tests/extmod/deflate_compress.py: Add a test for optimal compression.
dpgeorge Nov 29, 2023
911662c
esp8266/machine_spi: Rename machine_hspi to machine_spi.
dpgeorge Nov 23, 2023
b4d288a
nrf: Use MICROPY_PY_MACHINE_SPI instead of MICROPY_PY_MACHINE_HW_SPI.
dpgeorge Nov 23, 2023
e120c00
stm32/modmachine: Only enable machine.I2C if hardware I2C is enabled.
dpgeorge Nov 24, 2023
7b2f13f
renesas-ra: Consolidate MICROPY_PY_MACHINE_I2C option.
dpgeorge Nov 24, 2023
14432b5
extmod/modmachine: Make I2C/SPI defns available when soft impl enabled.
dpgeorge Nov 24, 2023
7d39db2
extmod/modmachine: Factor ports' machine module dict to common code.
dpgeorge Nov 22, 2023
30a63a2
extmod/modmachine: Provide common Python bindings for machine.idle().
dpgeorge Nov 23, 2023
e68aa40
extmod/modmachine: Add MICROPY_PY_MACHINE_PIN_BASE option.
dpgeorge Nov 23, 2023
48b5a7b
extmod/modmachine: Provide common Python bindings for bootloader().
dpgeorge Nov 24, 2023
e1ec6af
extmod/modmachine: Provide common bindings for 6 bare-metal functions.
dpgeorge Nov 24, 2023
f523b86
extmod/modmachine: Provide common implementation of disable/enable_irq.
dpgeorge Nov 27, 2023
4bf7987
cc3200/mods/modmachine: Use common implementation of disable/enable_irq.
dpgeorge Nov 27, 2023
39d4153
esp8266/esp_mphal: Make atomic section more atomic.
dpgeorge Nov 27, 2023
cc8fc45
esp8266/modmachine: Use common implementation of disable/enable_irq.
dpgeorge Nov 27, 2023
e3c4c32
nrf: Use dupterm_objs[0] instead of board_stdio_uart.
dpgeorge Nov 29, 2023
22d9116
nrf: Convert os module to use extmod version.
dpgeorge Nov 29, 2023
1c0e464
cc3200: Convert dupterm to use common extmod implementation.
dpgeorge Nov 29, 2023
49fa3ce
cc3200: Convert os module to use extmod version.
dpgeorge Nov 30, 2023
7a6489a
cc3200: Eliminate dependency on stm32's irq.h.
dpgeorge Dec 1, 2023
7d784e5
cc3200/application.mk: Don't add stm32 to build include path.
dpgeorge Dec 1, 2023
bfdf500
py/mphal: Move configuration of ATOMIC_SECTION macros to mphal.h.
dpgeorge Dec 1, 2023
ad806df
ports: Move definitions of ATOMIC_SECTION macros to mphalport.h.
dpgeorge Dec 1, 2023
20ffbe1
unix/mbedtls: Enable mbedtls cert time validation.
Carglglz Nov 30, 2023
b5449b0
extmod/mbedtls: Enable certificate time/date validation by default.
dpgeorge Dec 1, 2023
30b0ee3
esp32: Enable mbedtls cert time validation.
Carglglz Nov 30, 2023
d422b68
nrf/mpconfigport: Enable MICROPY_PY_MACHINE_BOOTLOADER.
dpgeorge Dec 4, 2023
20af857
nrf/boards/ARDUINO_NANO_33_BLE_SENSE: Don't enable MICROPY_MBFS.
dpgeorge Dec 4, 2023
f3889db
stm32/usbd_cdc_interface: Include header to get machine_bootloader decl.
dpgeorge Dec 4, 2023
58112fc
stm32/machine_i2s: Improve accuracy of SCK frequency.
miketeachman Jan 29, 2023
9f620d2
github/workflows: Cache ESP-IDF checkout and installation.
projectgus Nov 29, 2023
b6df8f8
github/workflows: Use build matrix for esp32 port.
projectgus Nov 29, 2023
731a1f5
github/workflows: Enable build matrix for stm32 port.
projectgus Dec 5, 2023
527c4b0
github/workflows: Enable ccache for esp32 build.
projectgus Nov 29, 2023
69089a5
esp32/boards: Enable further IRAM saving opts to fit ESP32-SPIRAM fw.
dpgeorge Dec 4, 2023
d3595fe
tools/ci.sh: Build ESP32_GENERIC-SPIRAM as part of esp32 CI.
dpgeorge Dec 4, 2023
78b3fe5
esp32/machine_rtc: Preserve RTC user memory over most reset causes.
twenrich May 22, 2021
1323a71
esp32/boards/UM_TINYPICO: Fix typo in baudrate instructions.
zhaomh1998 Dec 6, 2023
3f2c423
rp2: Switch to locally provided math library.
dpgeorge Dec 5, 2023
b796f1e
tests/float/inf_nan_arith.py: Include -inf in argument combos.
dpgeorge Dec 6, 2023
d30d5c9
tests/run-tests.py: Skip Thumb2 tests if target doesn't support them.
dpgeorge Dec 6, 2023
50f31cc
extmod/modnetwork: Add deinit function to NIC protocol.
iabdalkader Nov 2, 2023
0960d64
extmod/network_ninaw10: Switch to using soft-timer for polling.
iabdalkader Nov 2, 2023
66be82d
esp8266: Avoid including ep_mphal.h directly.
projectgus Dec 7, 2023
f5be012
py: Add port-agnostic inline functions for event handling.
projectgus Nov 30, 2023
df3948d
extmod: Switch to use new event functions.
projectgus Nov 30, 2023
2852935
rp2: Switch rp2 and drivers to use new event functions.
projectgus Nov 30, 2023
393938b
rp2/main: Enable SEVONPEND CPU interrupt bit.
projectgus Nov 30, 2023
c393f5c
windows: Implement MICROPY_INTERNAL_WFE() macro.
projectgus Nov 30, 2023
7387973
esp8266: Update port to use new event functions.
projectgus Dec 6, 2023
2c828a8
unix: Update port to use the new event functions.
projectgus Dec 7, 2023
241dbac
extmod: Add lists of libm/libm_dbl source files for ports to use.
dpgeorge Dec 8, 2023
e1a7aa2
ports: Switch build to use common lib/libm list of source files.
dpgeorge Dec 8, 2023
c393cd7
esp32/boards/sdkconfig.base: Disable unused mbedtls options.
Carglglz Nov 25, 2023
88778be
esp32/machine_i2c: Use APB_CLK_FREQ instead of I2C_APB_CLK_FREQ.
Nov 12, 2023
3106ee4
esp32/modnetwork: Add WiFi AUTH_WPA3_ENT_192 authenticate mode.
Nov 12, 2023
495be71
esp32/machine_dac: Support one-shot mode of driver.
Nov 12, 2023
e423b3c
docs/esp32/quickref: Add DAC example.
IhorNehrutsa Nov 13, 2023
a427117
esp32/modmachine: Fix deprecated esp_pm_config_XXX_t.
IhorNehrutsa Nov 13, 2023
3069fee
esp32/machine_i2s: Fix deprecated fields and constants.
IhorNehrutsa Nov 13, 2023
b4b77c1
esp32/mpconfigport: Keep some funcs out of IRAM for ESP32-SPIRAM builds.
dpgeorge Dec 11, 2023
d0758d8
esp32/boards/ESP32_GENERIC: Disable network.LAN and VM-opt on D2WD.
dpgeorge Dec 11, 2023
4365edb
esp32: Change minimum supported IDF version to v5.0.4.
Nov 12, 2023
f3f215e
extmod/modssl_mbedtls: Add SSLContext certificate methods.
Carglglz Jun 27, 2023
58e7526
lib/mbedtls_errors: Update error list for latest esp32 mbedtls.
dpgeorge Dec 12, 2023
c9eb6bc
esp32: Re-enable custom mbedtls error string tables.
dpgeorge Dec 12, 2023
ef996d1
extmod/modssl_mbedtls: Make SSLSocket.getpeercert() optional.
dpgeorge Dec 12, 2023
bba8a67
tests: Update SSL network tests to use SSLContext, and work on CPython.
dpgeorge Dec 12, 2023
f33dfb9
extmod/modssl_mbedtls: Fix parsing of ciphers in set_ciphers method.
dpgeorge Dec 14, 2023
bfd6ad9
extmod/asyncio: Add ssl support with SSLContext.
Carglglz Nov 30, 2023
05d3b22
docs/library: Document SSLContext cert methods and asyncio support.
Carglglz Sep 7, 2023
85c0216
py/modsys: Implement optional sys.intern.
stinos Dec 4, 2023
0d93392
py/mkrules.mk: List hash files as byproducts.
xyzzy42 Nov 28, 2023
f22e886
py/makeqstrdefs.py: Don't skip output for stale hash file.
xyzzy42 Nov 28, 2023
d506b53
github/workflows: Bump actions/github-script from 6 to 7.
dependabot[bot] Nov 13, 2023
be64641
github/workflows: Bump actions/setup-python from 4 to 5.
dependabot[bot] Dec 6, 2023
de3e83a
github/workflows: Bump actions/upload-artifact from 3 to 4.
dependabot[bot] Dec 14, 2023
06df3b2
extmod/modonewire: Adopt Maxim recommended read timings.
xorbit Mar 18, 2021
2e101a8
extmod/modonewire: Improve write timings for better reliability.
eliaswimmer Dec 10, 2023
0e706a6
py/makeqstrdefs.py: Stop generating temporary intermediate file.
xyzzy42 Dec 15, 2023
395886c
extmod/modos: Factor os.dupterm_notify() function to common extmod code.
dpgeorge Dec 14, 2023
1f2ec45
extmod/os_dupterm: Prevent recursive execution of mp_os_dupterm_rx_chr.
dpgeorge Dec 14, 2023
a78ec4e
rp2/mpconfigport: Enable MICROPY_PY_OS_DUPTERM_NOTIFY.
dpgeorge Dec 14, 2023
fbf079d
rp2: Add new NO_DEFAULT_PINS config options for i2c, spi, and uart.
Apr 4, 2023
c51081c
rp2/boards: Add support for Pololu 3pi+ and Zumo robots.
Oct 11, 2023
3270d85
rp2/boards: Add SIL_RP2040_SHIM board by Silicognition LLC.
xorbit Jul 31, 2023
97b1313
py/gc: Improve calculation of new heap size in split-heap-auto mode.
dpgeorge Dec 18, 2023
f6d6308
esp32: Add MICROPY_GC_INITIAL_HEAP_SIZE option and tune it.
dpgeorge Dec 18, 2023
f46269a
extmod/asyncio: Remove non-working Stream __aenter__/__aexit__ methods.
dpgeorge Dec 20, 2023
7cf1118
stm32/usbdev: Optionally pass through vendor requests to Setup function.
dpgeorge Sep 20, 2023
859f219
stm32/mboot: Guard use of tx_pending with USE_USB_POLLING option.
dpgeorge Sep 20, 2023
49d0c22
stm32/mboot: Expand device descriptor to make it easier to understand.
dpgeorge Sep 20, 2023
e9bcd49
stm32/mboot: Add support for Microsoft WCID.
dpgeorge Sep 20, 2023
8b24aa3
extmod/modselect: Handle growing the pollfds allocation correctly.
jimmo Nov 6, 2023
74fd7b3
tools/ci.sh: Set `ulimit -n` for unix CI.
jimmo Nov 9, 2023
b31eef6
extmod/modhashlib: Support MD5 with mbedtls 3.x.
Dec 19, 2023
5552896
esp32/mpconfigport: Enable MICROPY_PY_HASHLIB_MD5.
Dec 19, 2023
5d28bb4
tools/manifestfile.py: Add support for external libraries.
jimmo Dec 19, 2023
91ee8ac
extmod/os_dupterm: Let mp_os_dupterm_tx_strn() return num bytes written.
mvds00 Oct 24, 2023
3bca93b
ports: Fix sys.stdout.buffer.write() return value.
mvds00 Jun 18, 2023
ce42c9e
extmod/vfs_lfs: Fix lfs cache_size calculation.
peterzuger Dec 20, 2023
d69e69a
py/mkrules.mk: Fix dependency file generation for compiler wrappers.
peterzuger Dec 20, 2023
e4d3ab3
nrf/main: Add /flash and /flash/lib to sys.path.
sebromero Dec 21, 2023
cfc212b
rp2/rp2_dma: Introduce a new rp2.DMA class for control over DMA xfers.
nickovs Sep 30, 2023
0b2676d
lib/micropython-lib: Update submodule to latest.
dpgeorge Dec 22, 2023
d014c82
extmod/nimble: Do not set GAP device name after sync.
DvdGiessen Sep 12, 2023
9feb068
all: Bump version to 1.22.0.
dpgeorge Dec 27, 2023
4b4f601
rp2/rp2_flash: Lockout second core only when doing flash erase/write.
dpgeorge Jan 1, 2024
61b8361
rp2/mutex_extra: Implement additional mutex functions.
dpgeorge Jan 2, 2024
ac5e0b9
rp2/mpthreadport: Fix race with IRQ when entering atomic section.
dpgeorge Jan 1, 2024
9b8c64c
all: Bump version to 1.22.1.
dpgeorge Jan 5, 2024
d5f3fcd
rp2/rp2_dma: Fix fetching 'write' buffers for writing not reading.
nickovs Jan 6, 2024
068aa28
rp2/machine_uart: Fix event wait in uart.flush() and uart.read().
robert-hh Jan 7, 2024
4c7d955
renesas-ra/ra: Fix SysTick clock source.
iabdalkader Jan 12, 2024
1e8cc6c
renesas-ra/boards/ARDUINO_PORTENTA_C33: Fix the RTC clock source.
iabdalkader Jan 17, 2024
a2e9ab3
extmod/asyncio: Support gather of tasks that finish early.
dpgeorge Jan 18, 2024
8b6e89a
mimxrt/modmachine: Fix deepsleep wakeup pin ifdef.
kwagyeman Jan 22, 2024
2531a15
extmod/modssl_mbedtls: Fix cipher iteration in SSLContext.get_ciphers.
dpgeorge Jan 29, 2024
f53ee9f
rp2: Change machine.I2S and rp2.DMA to use shared DMA IRQ handlers.
dpgeorge Jan 30, 2024
b979c5a
py/compile: Fix potential Py-stack overflow in try-finally with return.
dpgeorge Jan 31, 2024
cc7cfc7
renesas-ra/ra/ra_i2c: Fix 1 byte and 2 bytes read issue.
TakeoTakahashi2020 Jan 29, 2024
e7ff724
extmod/btstack: Reset pending_value_handle before calling write-done cb.
dpgeorge Feb 8, 2024
02df2b0
extmod/btstack: Reset pending_value_handle before calling read-done cb.
dpgeorge Feb 11, 2024
e72d038
esp32/mpnimbleport: Release the GIL while doing NimBLE port deinit.
dpgeorge Feb 14, 2024
ee3c9cc
esp32: Increase NimBLE task stack size and overflow detection headroom.
dpgeorge Feb 15, 2024
8cd1582
all: Bump version to 1.22.2.
dpgeorge Feb 20, 2024
69b6674
MPy v1.22 merge: initial merge; not compiled yet
dhalbert Jul 25, 2024
e16467d
clean up some include files
dhalbert Jul 26, 2024
71f17b0
wip: fixing compilation
dhalbert Jul 26, 2024
c11f2af
wip: blink works on trinket M0
dhalbert Jul 27, 2024
a6a308c
smoke tests on RP2040 and nRF52840 (BLE periph tested
dhalbert Jul 27, 2024
fef42eb
broadcom/mphalport.h: fix declaration
dhalbert Jul 27, 2024
014d5a5
mpy-cross fixes
dhalbert Jul 27, 2024
be6fa2a
merge from main
dhalbert Jul 29, 2024
2e33e00
add formatting/spelling exceptions
dhalbert Jul 29, 2024
49313f5
fix ports/unix typo
dhalbert Jul 30, 2024
37acfe3
build fixes
dhalbert Jul 30, 2024
9a7b9d7
use pip --break-system-packages for msys2 build
dhalbert Jul 30, 2024
4b0aee4
fix some tests
dhalbert Aug 6, 2024
6f721b3
fix more tests; get some tests from v1.23 or later
dhalbert Aug 7, 2024
0e4d735
update to Python 3.12 for running tests
dhalbert Aug 7, 2024
c00e155
try ubuntu-24.04 for tests
dhalbert Aug 7, 2024
4d72d6a
update asyncio library and fix tests
dhalbert Aug 16, 2024
29216d7
asyncio update; set fd max in test
dhalbert Aug 17, 2024
375ad0e
make coverage improvement
dhalbert Aug 17, 2024
342f7a9
tests/micropython/import_mpy_native_gc.py: update native .mpy
dhalbert Aug 19, 2024
b94815c
tests/extmod/select_poll_fd.py: disable fd limit test
dhalbert Aug 19, 2024
a2bdf57
pyexec.c: fix pyexec_frozen_module
dhalbert Aug 21, 2024
28887ab
shrink a couple of samd builds
dhalbert Aug 21, 2024
450cb49
address review comments
dhalbert Aug 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .codespell/exclude-file.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ USB_PRODUCT = "BLOK"
print(binascii.b2a_base64(b"fo"))
# again, neither will "there" or "wither", since they have "the"
i1Qb$TE"rl
ZEN = "the zen of python beautiful is better than ugly explicit is better than implicit simple is better than complex complex is better than complicated flat is better than nested sparse is better than dense readability counts special cases arent special enough to break the rules although practicality beats purity errors should never pass silently unless explicitly silenced in the face of ambiguity refuse the temptation to guess there should be one and preferably only one obvious way to do it although that way may not be obvious at first unless youre dutch now is better than never although never is often better than right now if the implementation is hard to explain its a bad idea if the implementation is easy to explain it may be a good idea namespaces are one honking great idea lets do more of those"
"arent",
"youre",
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# all: Update Python formatting to ruff-format.
bbd8760bd9a2302e5abee29db279102bb11d7732

# all: Fix various spelling mistakes found by codespell 2.2.6.
cf490a70917a1b2d38ba9b58e763e0837d0f7ca7

Expand Down
12 changes: 4 additions & 8 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@
*.props text eol=crlf
*.bat text eol=crlf

# CIRCUITPY-CHANGE: add some more binary types.
# These are binary so should never be modified by git.
*.a binary
*.ico binary
*.png binary
*.jpg binary
*.dxf binary
*.mpy binary
*.der binary
*.deb binary
*.zip binary
*.pdf binary
Expand All @@ -24,11 +27,4 @@
# These should also not be modified by git.
tests/basics/string_cr_conversion.py -text
tests/basics/string_crlf_conversion.py -text
ports/stm32/pybcdc.inf_template -text
ports/stm32/usbhost/** -text
ports/cc3200/hal/aes.c -text
ports/cc3200/hal/aes.h -text
ports/cc3200/hal/des.c -text
ports/cc3200/hal/i2s.c -text
ports/cc3200/hal/i2s.h -text
ports/cc3200/version.h -text
# CIRCUITPY-CHANGE: remove non-CircuitPython tests
9 changes: 6 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,13 @@ jobs:
wget --no-verbose -O gcc-arm.zip https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi.zip
unzip -q -d /tmp gcc-arm.zip
tar -C /tmp/arm-gnu-toolchain* -cf - . | tar -C /usr/local -xf -
pip install wheel
# requirements_dev.txt doesn't install on windows. (with msys2 python)
# We could use a venv instead, but that requires entering the venv on each run step
# that runs in its own shell. There are some actions that help with that, but not for msys2
# that I can find. (dhalbert)
pip install --break-system-packages wheel
# requirements-dev.txt doesn't install on windows. (with msys2 python)
# instead, pick a subset for what we want to do
pip install cascadetoml jinja2 typer click intelhex
pip install --break-system-packages cascadetoml jinja2 typer click intelhex
# check that installed packages work....?
which python; python --version; python -c "import cascadetoml"
which python3; python3 --version; python3 -c "import cascadetoml"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ on:

jobs:
run:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
test: [all, mpy, native, native_mpy]
env:
CP_VERSION: ${{ inputs.cp-version }}
MICROPY_CPYTHON3: python3.8
MICROPY_CPYTHON3: python3.12
MICROPY_MICROPYTHON: ../ports/unix/build-coverage/micropython
TEST_all:
TEST_mpy: --via-mpy -d basics float micropython
Expand All @@ -32,7 +32,7 @@ jobs:
- name: Set up python
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.12
- name: Set up submodules
uses: ./.github/actions/deps/submodules
with:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: MIT

# CIRCUITPY-CHANGES: many additions

# Compiled Sources
###################
*.o
Expand Down
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: Unlicense

# CIRCUITPY-CHANGE: CircuitPython-specific.

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
Expand Down
14 changes: 12 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,15 @@ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

--------------------------------------------------------------------------------

#CIRCUITPY-CHANGE:

Unless specified otherwise (see below), the above license and copyright applies
to all files derived from MicroPython in this repository.

Individual files may include additional copyright holders and specify other licenses.
See the comments and SPDX headers.
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ check-stubs: stubs
@(cd $(STUBDIR) && set -- */__init__.pyi && mypy "$${@%/*}")
@tools/test-stubs.sh

.PHONY: update-frozen-libraries
update-frozen-libraries:
@echo "Updating all frozen libraries to latest tagged version."
cd frozen; for library in *; do cd $$library; ../../tools/git-checkout-latest-tag.sh; cd ..; done
Expand Down Expand Up @@ -350,3 +351,16 @@ remove-all-submodules:
.PHONY: fetch-tags
fetch-tags:
git fetch --tags --recurse-submodules=no --shallow-since="2023-02-01" https://github.com/adafruit/circuitpython HEAD

.PHONY: coverage
coverage:
make -j -C ports/unix VARIANT=coverage

.PHONY: coverage-clean
coverage-fresh:
make -C ports/unix VARIANT=coverage clean
make -j -C ports/unix VARIANT=coverage

.PHONY: run-tests
run-tests:
cd tests; MICROPY_MICROPYTHON=../ports/unix/build-coverage/micropython ./run-tests.py
2 changes: 1 addition & 1 deletion docs/library/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Constants
.. data:: maxsize

Maximum value which a native integer type can hold on the current platform,
or maximum value representable by CircuitPython integer type, if it's smaller
or maximum value representable by the CircuitPython integer type, if it's smaller
than platform max value (that is the case for CircuitPython ports without
long int support).

Expand Down
7 changes: 4 additions & 3 deletions docs/readthedocs/settings/local_settings.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import os

# Directory that the project lives in, aka ../..
SITE_ROOT = '/'.join(os.path.dirname(__file__).split('/')[0:-2])
SITE_ROOT = "/".join(os.path.dirname(__file__).split("/")[0:-2])

TEMPLATE_DIRS = (
"%s/templates/" % SITE_ROOT, # Your custom template directory, before the RTD one to override it.
"%s/readthedocs/templates/" % SITE_ROOT, # Default RTD template dir
"%s/templates/"
% SITE_ROOT, # Your custom template directory, before the RTD one to override it.
"%s/readthedocs/templates/" % SITE_ROOT, # Default RTD template dir
)
7 changes: 7 additions & 0 deletions examples/usercmodule/cppexample/example.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
extern "C" {
#include <examplemodule.h>
#include <py/objstr.h>

// Here we implement the function using C++ code, but since it's
// declaration has to be compatible with C everything goes in extern "C" scope.
mp_obj_t cppfunc(mp_obj_t a_obj, mp_obj_t b_obj) {
// The following no-ops are just here to verify the static assertions used in
// the public API all compile with C++.
MP_STATIC_ASSERT_STR_ARRAY_COMPATIBLE;
if (mp_obj_is_type(a_obj, &mp_type_BaseException)) {
}

// Prove we have (at least) C++11 features.
const auto a = mp_obj_get_int(a_obj);
const auto b = mp_obj_get_int(b_obj);
Expand Down
95 changes: 95 additions & 0 deletions extmod/extmod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# and provides rules to build 3rd-party components for extmod modules.

# CIRCUITPY-CHANGE: many extmod modules removed
# CIRCUITPY-CHANGE: modzlib.c still used
SRC_EXTMOD_C += \
extmod/modasyncio.c \
extmod/modbinascii.c \
Expand Down Expand Up @@ -37,6 +38,96 @@ SRC_QSTR += $(SRC_EXTMOD_C)
CFLAGS += $(CFLAGS_EXTMOD) $(CFLAGS_THIRDPARTY)
LDFLAGS += $(LDFLAGS_EXTMOD) $(LDFLAGS_THIRDPARTY)

################################################################################
# libm/libm_dbl math library

# Single-precision math library.
SRC_LIB_LIBM_C += $(addprefix lib/libm/,\
acoshf.c \
asinfacosf.c \
asinhf.c \
atan2f.c \
atanf.c \
atanhf.c \
ef_rem_pio2.c \
erf_lgamma.c \
fmodf.c \
kf_cos.c \
kf_rem_pio2.c \
kf_sin.c \
kf_tan.c \
log1pf.c \
math.c \
nearbyintf.c \
roundf.c \
sf_cos.c \
sf_erf.c \
sf_frexp.c \
sf_ldexp.c \
sf_modf.c \
sf_sin.c \
sf_tan.c \
wf_lgamma.c \
wf_tgamma.c \
)

# Choose only one of these sqrt implementations, software or hardware.
SRC_LIB_LIBM_SQRT_SW_C += lib/libm/ef_sqrt.c
SRC_LIB_LIBM_SQRT_HW_C += lib/libm/thumb_vfp_sqrtf.c

# Double-precision math library.
SRC_LIB_LIBM_DBL_C += $(addprefix lib/libm_dbl/,\
__cos.c \
__expo2.c \
__fpclassify.c \
__rem_pio2.c \
__rem_pio2_large.c \
__signbit.c \
__sin.c \
__tan.c \
acos.c \
acosh.c \
asin.c \
asinh.c \
atan.c \
atan2.c \
atanh.c \
ceil.c \
cos.c \
cosh.c \
copysign.c \
erf.c \
exp.c \
expm1.c \
floor.c \
fmod.c \
frexp.c \
ldexp.c \
lgamma.c \
log.c \
log10.c \
log1p.c \
modf.c \
nearbyint.c \
pow.c \
rint.c \
round.c \
scalbn.c \
sin.c \
sinh.c \
tan.c \
tanh.c \
tgamma.c \
trunc.c \
)

# Choose only one of these sqrt implementations, software or hardware.
SRC_LIB_LIBM_DBL_SQRT_SW_C += lib/libm_dbl/sqrt.c
SRC_LIB_LIBM_DBL_SQRT_HW_C += lib/libm_dbl/thumb_vfp_sqrt.c

# Too many warnings in libm_dbl, disable for now.
$(BUILD)/lib/libm_dbl/%.o: CFLAGS += -Wno-double-promotion -Wno-float-conversion

################################################################################
# VFS FAT FS

Expand Down Expand Up @@ -75,6 +166,7 @@ SRC_THIRDPARTY_C += $(addprefix $(LITTLEFS_DIR)/,\
lfs2_util.c \
)

# CIRCUITPY-CHANGE: -Wno-missing-field-initializers instead of -Wno-shadow
$(BUILD)/$(LITTLEFS_DIR)/lfs2.o: CFLAGS += -Wno-missing-field-initializers
endif

Expand Down Expand Up @@ -235,6 +327,9 @@ SRC_THIRDPARTY_C += $(addprefix $(LWIP_DIR)/,\
core/ipv6/nd6.c \
netif/ethernet.c \
)
ifeq ($(MICROPY_PY_LWIP_LOOPBACK),1)
CFLAGS_EXTMOD += -DLWIP_NETIF_LOOPBACK=1
endif
ifeq ($(MICROPY_PY_LWIP_SLIP),1)
CFLAGS_EXTMOD += -DMICROPY_PY_LWIP_SLIP=1
SRC_THIRDPARTY_C += $(LWIP_DIR)/netif/slipif.c
Expand Down
1 change: 1 addition & 0 deletions extmod/lwip-include/lwipopts.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ typedef uint32_t sys_prot_t;
#define LWIP_NETCONN 0
#define LWIP_SOCKET 0

// CIRCUITPY-CHANGE: #if instead of #ifdef
#if MICROPY_PY_LWIP_SLIP
#define LWIP_HAVE_SLIPIF 1
#endif
Expand Down
6 changes: 4 additions & 2 deletions extmod/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ bool mp_os_dupterm_is_builtin_stream(mp_const_obj_t stream);
void mp_os_dupterm_stream_detached_attached(mp_obj_t stream_detached, mp_obj_t stream_attached);
uintptr_t mp_os_dupterm_poll(uintptr_t poll_flags);
int mp_os_dupterm_rx_chr(void);
void mp_os_dupterm_tx_strn(const char *str, size_t len);
int mp_os_dupterm_tx_strn(const char *str, size_t len);
void mp_os_deactivate(size_t dupterm_idx, const char *msg, mp_obj_t exc);
#else
#define mp_os_dupterm_tx_strn(s, l)
static inline int mp_os_dupterm_tx_strn(const char *s, size_t l) {
return -1;
}
#endif

#endif // MICROPY_INCLUDED_EXTMOD_MISC_H
2 changes: 2 additions & 0 deletions extmod/modasyncio.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#if MICROPY_PY_ASYNCIO

// CIRCUITPY-CHANGE
#if CIRCUITPY && !(defined(__unix__) || defined(__APPLE__))
#include "shared-bindings/supervisor/__init__.h"
#endif
Expand Down Expand Up @@ -308,6 +309,7 @@ STATIC mp_obj_t task_getiter(mp_obj_t self_in, mp_obj_iter_buf_t *iter_buf) {
STATIC mp_obj_t task_iternext(mp_obj_t self_in) {
mp_obj_task_t *self = MP_OBJ_TO_PTR(self_in);
if (TASK_IS_DONE(self)) {
// CIRCUITPY-CHANGE
if (self->data == mp_const_none) {
// Task finished but has already been sent to the loop's exception handler.
mp_raise_StopIteration(MP_OBJ_NULL);
Expand Down
1 change: 1 addition & 0 deletions extmod/modbinascii.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

#if MICROPY_PY_BINASCII

// CIRCUITPY-CHANGE: added
static void check_not_unicode(const mp_obj_t arg) {
#if MICROPY_CPYTHON_COMPAT
if (mp_obj_is_str(arg)) {
Expand Down
4 changes: 3 additions & 1 deletion extmod/modhashlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ STATIC mp_obj_t hashlib_sha256_digest(mp_obj_t self_in) {

#else

// CIRCUITPY-CHANGE
static void check_not_unicode(const mp_obj_t arg) {
#if MICROPY_CPYTHON_COMPAT
if (mp_obj_is_str(arg)) {
Expand All @@ -136,6 +137,7 @@ STATIC mp_obj_t hashlib_sha256_make_new(const mp_obj_type_t *type, size_t n_args
}

STATIC mp_obj_t hashlib_sha256_update(mp_obj_t self_in, mp_obj_t arg) {
// CIRCUITPY-CHANGE
check_not_unicode(arg);
mp_obj_hash_t *self = MP_OBJ_TO_PTR(self_in);
hashlib_ensure_not_final(self);
Expand Down Expand Up @@ -306,7 +308,7 @@ STATIC mp_obj_t hashlib_md5_digest(mp_obj_t self_in) {

#if MICROPY_SSL_MBEDTLS

#if MBEDTLS_VERSION_NUMBER < 0x02070000
#if MBEDTLS_VERSION_NUMBER < 0x02070000 || MBEDTLS_VERSION_NUMBER >= 0x03000000
#define mbedtls_md5_starts_ret mbedtls_md5_starts
#define mbedtls_md5_update_ret mbedtls_md5_update
#define mbedtls_md5_finish_ret mbedtls_md5_finish
Expand Down
Loading