forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
V1.21 merge from MicroPython #8508
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Damien George <damien@micropython.org>
Ruff version 283 expanded E721 to fail when making direct comparison against a built-in type. Change the code to use isinstance() as suggested, these usages appear to have equivalent functionality. Signed-off-by: Angus Gratton <angus@redyak.com.au>
Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
Otherwise `mpremote soft-reset` will implicitly run the repl command. Fixes issue micropython#10871. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit: - Finds a common set of board feature tags and maps existing features to that reduced set. - Removes some less-useful board feature tags. - Ensures all MCUs are specified correctly. - Ensures all boards have a vendor (and fixes some vendor names). This is to make the downloads page show a less intimidating set of filters. Work done in conjunction with Matt Trentini <matt.trentini@gmail.com>. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Signed-off-by: Damien George <damien@micropython.org>
Increase allowed range of dt_ms, and print it in case of failure. Signed-off-by: Damien George <damien@micropython.org>
This commit: - Breaks up some long lines for readability. - Fixes a potential macro argument expansion issue. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
When set, the split heap is automatically extended with new areas on demand, and shrunk if a heap area becomes empty during a GC pass or soft reset. To save code size the size allocation for a new heap block (including metadata) is estimated at 103% of the failed allocation, rather than working from the more complex algorithm in gc_try_add_heap(). This appears to work well except in the extreme limit case when almost all RAM is exhausted (~last few hundred bytes). However in this case some allocation is likely to fail soon anyhow. Currently there is no API to manually add a block of a given size to the heap, although that could easily be added if necessary. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
Also shrinks the "prefer internal" threshold to 8KB, any allocation larger than this will try PSRAM first. Change the mbedTLS config to use regular malloc() as well, instead of internal only. The default is set to internal-only due to to potential physical security issue of readout via PSRAM on the original ESP32. However, as MicroPython runs from plaintext flash and all other context is in the MP heap of PSRAM then it's hard to see how worsens physical security for MP. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
Via MICROPY_GC_SPLIT_HEAP_AUTO feature flag added in previous commit. Tested on ESP32 GENERIC_SPIRAM and GENERIC_S3 configurations, with some worst-case allocation patterns and the standard test suite. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
Otherwise the compiler may inline the gc_collect_inner() function and/or remove the recursion, which is necessary to spill all the windowed registers to the C stack. Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This is difficult to implement on cmake-based ports, and having the list of variants in mpconfigboard.{cmake,mk} duplicates information that's already in board.json. This removes the existing query-variants make target from stm32 & rp2 and the definition of BOARD_VARIANTS from the various board files. Also renames the cmake variable to MICROPY_BOARD_VARIANT to match other variables such as MICROPY_BOARD. The make variable stays as BOARD_VARIANT. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
These are now variants of the GENERIC board. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
As the IDF no longer supports earlier revisions of the C3 by default, we now just explicitly support rev 3+ and enable USB (which wasn't supported in earlier revisions). This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Unsure of the history of the ESP32_S2_WROVER board (and why it wasn't named GENERIC_S2_...) but now it's a variant of the generic S2 board. Also removes the non-existent CONFIG_USB_AND_UART from all S2 boards. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
These are now variants of the GENERIC_S3 board. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
To be consistent with the other partitions files (which have the "- {2,8,16,32}MiB" suffix). Also renames partitions-ota.csv. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Removes the special-case for stm32. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
When called without a handler, the IRQ data was not cleared. That caused a crash at the second soft reset in a row. Signed-off-by: robert-hh <robert@hammelrath.com>
It should be that: - duty_u16=0: output low, no pulse - duty_u16=65536: output high, no pulse That previously did not apply to all of the three PWM mechanisms of this port. This commit fixes it. Signed-off-by: robert-hh <robert@hammelrath.com>
The call to machine_uart_deinit_all() is needed to avoid a crash after soft reset, if a UART had been used and data arrives before it is instantiated again. Signed-off-by: robert-hh <robert@hammelrath.com>
Signed-off-by: "Kwabena W. Agyeman" <kwagyeman@live.com>
Signed-off-by: "Kwabena W. Agyeman" <kwagyeman@live.com>
Signed-off-by: "Kwabena W. Agyeman" <kwagyeman@live.com>
These files all use decorators (@asm_thumb, @asm_pio) that add names to the function scope, that the linter cannot see. It's useful to clear them in the file not in pyproject.toml as example code will be copied and adapted elsewhere, and those developers may also use Ruff (we hope!) Signed-off-by: Angus Gratton <angus@redyak.com.au>
Found by Ruff with F821. Signed-off-by: Angus Gratton <angus@redyak.com.au>
subprocess.CalledProcessError() constructor arguments aren't documented, but these are them. Even if they change, it's an improvement over a non-existent exception name! Found by Ruff checking F821. Signed-off-by: Angus Gratton <angus@redyak.com.au>
This was referenced Oct 24, 2023
tannewt
approved these changes
Oct 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing three merges in a row! Great work!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This merges changes from MicroPython v1.21.0. Thanks to @tannewt for a bunch of intermediate fixes.
There are some remaining things that will need to be fixed or looked at. I will open issues for those.