| Commit message (Collapse) | Author | Age |
|
|
|
|
|
| |
Soft float now works on these ARM targets thanks to the parent commit.
Signed-off-by: Damien George <damien@micropython.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit provides the appropriate external symbol addresses to let
the "btree" example natmod build for the Xtensa platform.
On the ESP8266, unsigned integer division code isn't provided as part of
libgcc.a, libm.a, or libc.a, but it is instead provided by the ROM.
Regular builds inject the appropriate symbol addresses as part of the
linking process (see eagle.rom.addr.v6.ld), but natmods need this
information brought in from somewhere else.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit provides the appropriate external symbol addresses to let
the "deflate" example natmod build for the Xtensa platform.
Unlike other natmods that require an external symbol list to build
without bringing in the whole runtime libraries set, this natmod is
referencing the `__modsi3` symbol which was removed from the ESP8266's
SDK but not present in ROM. The latter only has a `__umodsi3`
implementation that only operates on unsigned values, and thus unable to
handle this natmod. Thus, the extended library resolution process is
enabled for this natmod as a `__modsi3` implementation is made available
that way (still using ROM symbols whenever possible). This also means
that symbols that appear in both ROM and external libraries sort of
co-exist in the final MPY file, with ROM symbols being used by natmod
code but the implementation from the library still exists in the final
MPY file, unused.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit provides the appropriate external symbol addresses to let
the "framebuf" example natmod build for the Xtensa platform.
On the ESP8266, integer division code isn't provided as part of
libgcc.a, libm.a, or libc.a, but it is instead provided by the ROM.
Regular builds inject the appropriate symbol addresses as part of the
linking process (see eagle.rom.addr.v6.ld), but natmods need this
information brought in from somewhere else.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit provides the appropriate external symbol addresses to let
the "random" example natmod build for the Xtensa platform.
On the ESP8266, signed integer division code isn't provided as part of
libgcc.a, libm.a, or libc.a, but it is instead provided by the ROM.
Regular builds inject the appropriate symbol addresses as part of the
linking process (see eagle.rom.addr.v6.ld), but natmods need this
information brought in from somewhere else.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently the `FrameBuffer.blit(buf, x, y)` method requires the `buf`
argument to be another `FrameBuffer`, which is quite restrictive because it
doesn't allow blit'ing read-only memory/data.
This commit extends `blit()` to allow the `buf` argument to be a tuple or
list of the form:
(buffer, width, height, format[, stride])
where `buffer` can be anything with the buffer protocol and may be
read-only, eg `bytes`.
Also, the palette argument to `blit()` may be of the same form.
The form of this tuple/list was chosen to be the same as the signature of
the `FrameBuffer` constructor (that saves quite a bit of code size doing it
that way).
Signed-off-by: Damien George <damien@micropython.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit introduces an additional symbol resolution mechanism to the
natmod linking process. This allows the build scripts to look for required
symbols into selected libraries that are provided by the compiler
installation (libgcc and libm at the moment).
For example, using soft-float code in natmods, whilst technically possible,
was not an easy process and required some additional work to pull it off.
With this addition all the manual (and error-prone) operations have been
automated and folded into `tools/mpy_ld.py`.
Both newlib and picolibc toolchains are supported, albeit the latter may
require a bit of extra configuration depending on the environment the build
process runs on. Picolibc's soft-float functions aren't in libm - in fact
the shipped libm is nothing but a stub - but they are inside libc. This is
usually not a problem as these changes cater for that configuration quirk,
but on certain compilers the include paths used to find libraries in may
not be updated to take Picolibc's library directory into account. The bare
metal RISC-V compiler shipped with the CI OS image (GCC 10.2.0 on Ubuntu
22.04LTS) happens to exhibit this very problem.
To work around that for CI builds, the Picolibc libraries' path is
hardcoded in the Makefile directives used by the linker, but this can be
changed by setting the PICOLIBC_ROOT environment library when building
natmods.
Signed-off-by: Volodymyr Shymanskyy <vshymanskyi@gmail.com>
Co-authored-by: Alessandro Gatti <a.gatti@frob.it>
|
|
|
|
|
|
|
| |
This commit upgrades from codespell==2.2.6 to the current codespell==2.4.1,
adding emac to the ignore-words-list.
Signed-off-by: Christian Clauss <cclauss@me.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes compilation of the `re` natmod example when built with Picolibc
in the CI environment. Ubuntu 22.04's combination of its bare metal RISC-V
toolchain and its version of Picolibc makes the `alloca` symbol more
elusive than it should be.
This commit makes the `re` natmod try harder to get an `alloca`
implementation.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
|
|
|
|
|
|
|
| |
This commit adds support for RV32IMC native modules, as in embedding native
code into a self-contained MPY module and and make its exported functions
available to the MicroPython environment.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
|
|
|
|
| |
Signed-off-by: Matt Trentini <matt.trentini@gmail.com>
|
|
|
|
|
|
|
| |
Not just the domain name. This gives better HTTP 1.0 examples if someone
wants to copy them.
Signed-off-by: Damien George <damien@micropython.org>
|
|
|
|
|
|
|
| |
`ssl.wrap_socket()` is deprecated in CPython, so use `SSLContext` instead,
so the example is a good example to copy.
Signed-off-by: Damien George <damien@micropython.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The main changes here are to pass the address family and socket type to
`getaddrinfo()`, and then use the result of the address lookup when
creating the socket, so it has the correct address family.
This allows both IPv4 and IPv6 to work, because the socket is created with
the correct AF_INETx type for the address.
Also add some more comments to the examples to explain what's going on.
Fixes issue #15580.
Signed-off-by: Damien George <damien@micropython.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently the stack limit margin is hard-coded in each port's call to
`mp_stack_set_limit()`, but on threaded ports it's fiddlier and can lead to
bugs (such as incorrect thread stack margin on esp32).
This commit provides a new API to initialise the C Stack in one function
call, with a config macro to set the margin. Where possible the new call
is inlined to reduce code size in thread-free ports.
Intended replacement for `MP_TASK_STACK_LIMIT_MARGIN` on esp32.
The previous `stackctrl.h` API is still present and unmodified apart from a
deprecation comment. However it's not available when the
`MICROPY_PREVIEW_VERSION_2` macro is set.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
|
|
|
|
|
|
| |
This adds a separate `AdvancedTimer` class that demonstrates a few more
advanced concepts usch as custom handlers for printing and attributes.
Signed-off-by: Laurens Valk <laurens@pybricks.com>
|
|
|
|
|
|
|
| |
Python code is no longer needed to implement keyword arguments in
`btree.open()`, it can now be done in C.
Signed-off-by: Damien George <damien@micropython.org>
|
|
|
|
| |
Signed-off-by: Damien George <damien@micropython.org>
|
|
|
|
|
|
|
| |
If someone starts from this directory then they won't know they exist,
otherwise.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
|
|
|
|
|
|
| |
Non-blocking SSL streams can be difficult to get right, so provide a
working example, of a HTTPS client.
Signed-off-by: Damien George <damien@micropython.org>
|
|
|
|
|
|
|
| |
It's better for discoverability to have these examples named `https_xxx.py`
rather than `http_xxx_ssl.py`.
Signed-off-by: Damien George <damien@micropython.org>
|
|
|
|
| |
Signed-off-by: Damien George <damien@micropython.org>
|
|
|
|
| |
Signed-off-by: Damien George <damien@micropython.org>
|
|
|
|
| |
Signed-off-by: Damien George <damien@micropython.org>
|
|
|
|
|
|
|
|
|
|
| |
This provides a MicroPython-specific berkeley-db configuration in
extmod/berkeley-db/berkeley_db_config_port.h, and cleans up the include
path for this library.
Fixes issue #13092.
Signed-off-by: Damien George <damien@micropython.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The STATIC macro was introduced a very long time ago in commit
d5df6cd44a433d6253a61cb0f987835fbc06b2de. The original reason for this was
to have the option to define it to nothing so that all static functions
become global functions and therefore visible to certain debug tools, so
one could do function size comparison and other things.
This STATIC feature is rarely (if ever) used. And with the use of LTO and
heavy inline optimisation, analysing the size of individual functions when
they are not static is not a good representation of the size of code when
fully optimised.
So the macro does not have much use and it's simpler to just remove it.
Then you know exactly what it's doing. For example, newcomers don't have
to learn what the STATIC macro is and why it exists. Reading the code is
also less "loud" with a lowercase static.
One other minor point in favour of removing it, is that it stops bugs with
`STATIC inline`, which should always be `static inline`.
Methodology for this commit was:
1) git ls-files | egrep '\.[ch]$' | \
xargs sed -Ei "s/(^| )STATIC($| )/\1static\2/"
2) Do some manual cleanup in the diff by searching for the word STATIC in
comments and changing those back.
3) "git-grep STATIC docs/", manually fixed those cases.
4) "rg -t python STATIC", manually fixed codegen lines that used STATIC.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
|
|
|
|
|
|
|
|
|
| |
Obtaining the stack-top via a few function calls may yield a pointer which
is too deep within the stack. So require the user to obtain it from a
higher level (or via some other means).
Fixes issue #11781.
Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes no difference when files are linked directly into a target
application, but on macOS additional steps are needed to index common
symbols in static libraries. See https://stackoverflow.com/a/26581710
By not creating any common symbols, this problem is bypassed.
This will also trigger linker errors if there are cases where the same
symbol is defined in the host application.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
|
|
|
|
|
| |
Fixes issue #12951.
Signed-off-by: stijn <stijn@ignitron.net>
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's not supported on all ports, adds complexity to the build to generate
pins_af.py, and can mostly be replicated just by printing the pin objects.
Remove support for generating pins_af.py from all ports (nrf, stm32,
renesas-ra, mimxrt, rp2).
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@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>
|
|
|
|
| |
Signed-off-by: Thomas <th.acker.0302@gmail.com>
|
|
|
|
|
|
|
|
| |
Also provide a basic README.md for dynamic native modules.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
|
|
|
|
| |
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
|
|
|
|
| |
Signed-off-by: Alexander Wilde <alexander.wilde87@gmail.com>
|
|
|
|
|
|
| |
Found by Ruff checking F821.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
|
|
|
|
|
| |
Found by Ruff checking F821.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
This replaces the previous zlib version.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This will be replaced with a new deflate module providing the same
functionality, with an optional frozen Python wrapper providing a
replacement zlib module.
binascii.crc32 is temporarily disabled.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
|
|
|
|
|
|
| |
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
|
|
|
|
|
|
|
|
| |
Applies to drivers/examples/extmod/port-modules/tools.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
|
|
|
|
|
|
| |
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Updates any includes, and references from Makefiles/CMake.
This essentially reverts what was done long ago in commit
136b5cbd7669e8318f8455fc2706da97a5b7994c
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
|
|
|
|
|
|
| |
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
|
|
|
|
|
|
| |
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
|
|
|
|
|
|
|
|
|
| |
This renames the builtin-modules, such that help('modules') and printing
the module object will show "module" rather than "umodule".
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This demonstrates how to add a sub-package in a user c module, as well
as how to define the necessary qstrs and enable the feature in the build.
This is used by the unix coverage build to test this feature.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
|
|
|
|
| |
This fixes ruff rule F841.
|