- 26 Jun, 2024 4 commits
-
-
tharuka authored
The word "Select" could be confusing in this context, eg it could be misunderstood as the `select` module. Signed-off-by: tharuka <78165134+tharuka-pavith@users.noreply.github.com>
-
Yoctopuce authored
If `array.append()` fails with an exception due to heap exhaustion, the next attempt to grow the buffer will cause a buffer overflow because the free slot count is increased before performing the allocation, and will stay as if the allocation succeeded. Signed-off-by: Yoctopuce <dev@yoctopuce.com>
-
Peter Harper authored
Addresses build warning "comparison of distinct pointer types lacks a cast". Fixes issue #15276. Signed-off-by: Peter Harper <peter.harper@raspberrypi.com>
-
Peter Harper authored
Fixes issue #15276. Signed-off-by: Peter Harper <peter.harper@raspberrypi.com>
-
- 25 Jun, 2024 4 commits
-
-
Angus Gratton authored
In this mode, XOSC is stopped so can't really keep the USB PLL enabled. Signed-off-by: Angus Gratton <angus@redyak.com.au>
-
Angus Gratton authored
Follow-up to a84c7a0e, this commit works most of the time but has an intermittent bug where USB doesn't resume as expected after waking from light sleep. Turns out waking calls clocks_init() which will re-initialise the USB PLL. Most of the time this is OK but occasionally it seems like the clock glitches the USB peripheral and it stops working until the next hard reset. Adds a machine.lightsleep() test that consistently hangs in the first two dozen iterations on rp2 without this fix. Passed over 100 times in a row with this fix. The test is currently rp2-only as it seems similar lightsleep USB issues exist on other ports (both pyboard and ESP32-S3 native USB don't send any data to the host after waking, until they receive something from the host first.) This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
-
Angus Gratton authored
Adapts pico-sdk clocks_init() into clocks_init_optional_usb() which takes an argument to initialise USB clocks or not. To avoid a code size increase the SDK clocks_init() function is linker wrapped to become clocks_init_optional_usb(true). This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
-
Angus Gratton authored
mp_thread_begin_atomic_section() is expected to be recursive (i.e. for nested machine.disable_irq() calls, or if Python code calls disable_irq() and then the Python runtime calls mp_handle_pending() which also enters an atomic section to check the scheduler state). On rp2 when not using core1 the atomic sections are recursive. However when core1 was active (i.e. _thread) then there was a bug that caused the core to live-lock if an atomic section recursed. Adds a test case specifically for mutual exclusion and recursive atomic sections when using two threads. Without this fix the test immediately hangs on rp2. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
-
- 24 Jun, 2024 2 commits
-
-
Angus Gratton authored
Fixes and improvements to `int.to_bytes()` are: - No longer overflows if byte size is 0 (closes #13041). - Raises OverflowError in any case where number won't fit into byte length (now matches CPython, previously MicroPython would return a truncated bytes object). - Document that `micropython int.to_bytes()` doesn't implement the optional signed kwarg, but will behave as if `signed=True` when the integer is negative (this is the current behaviour). Add tests for this also. Requires changes for small ints, MPZ large ints, and "long long" large ints. Adds a new set of unit tests for ints between 32 and 64 bits to increase coverage of "long long" large ints, which are otherwise untested. Tested on unix port (64 bit small ints, MPZ long ints) and Zephyr STM32WB board (32 bit small ints, long long large ints). This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
-
Angus Gratton authored
Signed-off-by: Angus Gratton <angus@redyak.com.au>
-
- 21 Jun, 2024 13 commits
-
-
Damien George authored
Prior to this fix the current working path in the remote VFS would always be prepended to the requested path to get the full path, even if the requested path was already absolute, ie starting with "/". So `os.chdir("/remote/dir1")` would set the working path to "/dir1/", and a subsequent call with an absolute path like `os.listdir("/remote/dir2")` would try to list the directory "/dir1/dir2/". Fixes issue #15308. Signed-off-by: Damien George <damien@micropython.org>
-
Damien George authored
Signed-off-by: Damien George <damien@micropython.org>
-
Damien George authored
The code generating the entry to the finally handler of an async-with statement was simply wrong for the case of the native emitter. Among other things the layout of the stack was incorrect. This is fixed by this commit. The setup of the async-with finally handler is now put in a dedicated emit function, for both the bytecode and native emitters to implement in their own way (the bytecode emitter is unchanged, just factored to a function). With this fix all of the async-with tests now work when using the native emitter. Signed-off-by: Damien George <damien@micropython.org>
-
Damien George authored
A value thrown/injected into a native generator needs to be stored in a dedicated variable outside `nlr_buf_t`, following the `inject_exc` variable in `py/vm.c`. Signed-off-by: Damien George <damien@micropython.org>
-
Damien George authored
This emitter prints out pseudo-machine instructions, instead of the usual output of the native emitter. It can be enabled on any port via `MICROPY_EMIT_NATIVE_DEBUG` (make sure other native emitters are disabled) but the easiest way to use it is with mpy-cross: $ mpy-cross -march=debug file.py Signed-off-by: Damien George <damien@micropython.org>
-
Damien George authored
Signed-off-by: Damien George <damien@micropython.org>
-
Alessandro Gatti authored
This turns on the native RV32IMC code generator for the QEMU-based RISC-V port, and removes tests that relies on native code generation from the exclusion list (ie enables these tests). Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
-
Alessandro Gatti authored
Selected load/store code sequences have been optimised for RV32IMC when the chance to use fewer and smaller opcodes was possible. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
-
Alessandro Gatti authored
MPY files can now hold generated RV32IMC native code. This can be accomplished by passing the `-march=rv32imc` flag to mpy-cross. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
-
Alessandro Gatti authored
This adds a native code generation backend for RISC-V RV32I CPUs, currently limited to the I, M, and C instruction sets. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
-
Angus Gratton authored
Otherwise GC stays disabled (not re-enabled by soft reset) and later test runs fail with MemoryError. Signed-off-by: Angus Gratton <angus@redyak.com.au>
-
Damien George authored
Because `collections.deque` is now a built-in type in MicroPython. Signed-off-by: Damien George <damien@micropython.org>
-
Dan Halbert authored
This fixes a minor issue in the changes made by 7dff38fd: the type flags for deque were meant to be conditionalized based on MICROPY_PY_COLLECTIONS_DEQUE_ITER, but the computed conditionalized value wasn't used. Signed-off-by: Dan Halbert <halbert@halwitz.org>
-
- 19 Jun, 2024 3 commits
-
-
Damien George authored
This allows increasing the Python recursion depth if needed. Also increase the default to 2k words. There is enough RAM in the browser/node context for this to be increased, and having a larger pystack allows more complex code to run without hitting the limit. Signed-off-by: Damien George <damien@micropython.org>
-
Damien George authored
In the webassembly port there is no asyncio run loop running at the top level. Instead the Python asyncio run loop is scheduled through setTimeout and run by the outer JavaScript event loop. Because tasks can become runable from an external (to Python) event (eg a JavaScript callback), the run loop must be scheduled whenever a task is pushed to the asyncio task queue, otherwise tasks may be waiting forever on the queue. Signed-off-by: Damien George <damien@micropython.org>
-
Damien George authored
Allows passing in a callback to `TaskQueue()` that is called when something is pushed on to the queue. Signed-off-by: Damien George <damien@micropython.org>
-
- 18 Jun, 2024 5 commits
-
-
Damien George authored
This change allows doing a top-level await on an asyncio primitive like Task and Event. This feature enables a better interaction and synchronisation between JavaScript and Python, because `api.runPythonAsync` can now be used (called from JavaScript) to await on the completion of asyncio primitives. Signed-off-by: Damien George <damien@micropython.org>
-
Damien George authored
This allows Python to iterate over JavaScript objects that provide Symbol.iterator. Signed-off-by: Damien George <damien@micropython.org>
-
Maureen Helm authored
Unlike most other Zephyr libraries, libkernel.a is not built as a whole-archive. This change also fixes a linker error observed on nucleo_wb55rg while preparing an upgrade to Zephyr v3.5.0, caused by an undefined reference to `z_impl_k_busy_wait`. Signed-off-by: Maureen Helm <maureen.helm@analog.com>
-
Jason Kridner authored
Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
-
Jason Kridner authored
Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
-
- 17 Jun, 2024 3 commits
-
-
Alessandro Gatti authored
This adds picolibc to the list of the recognised libc options. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
-
Alessandro Gatti authored
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
-
Alessandro Gatti authored
This adds a QEMU-based bare metal RISC-V 32 bits port. For the time being only QEMU's "virt" 32 bits board is supported, using the ilp32 ABI and the RV32IMC architecture. The top-level README and the run-tests.py files are updated for this new port. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
-
- 11 Jun, 2024 2 commits
-
-
Damien George authored
Signed-off-by: Damien George <damien@micropython.org>
-
Damien George authored
All of these files are first-party code written from scratch as part of this repository, and were added when the top-level MIT license was active, so they have an MIT license by default. Tracing back the git history show the original authors/source/copyright as follows: - main.c, mpconfigport.h: copied from the bare-arm port [1]. - test_main.c: added in [2]. - mphalport.h: added in [3] then updated in [4]. - mps2.ld, nrf51.ld, stm32.ld, uart.h: added in [4]. - imx6.ld, uart.c, startup.c: added in [4] and updated in [5]. [1] Commit c5572158 in 2014, the initial bare-arm port; see related ee857853. [2] Commit c1c32d65 in 2014, initial qemu-arm CI tests. [3] Commit b0a15aa7 in 2016, enabling extmods and their tests. [4] Commit e7332b05 in 2018, big refactor. [5] Commit b84406f3 in 2021, adding Cortex-A9 support. Signed-off-by: Damien George <damien@micropython.org>
-
- 07 Jun, 2024 3 commits
-
-
Damien George authored
This makes the code a bit simpler to understand for the three cases of timeout behaviour (-1, 0, non-zero), and eliminates a dependency on the (slow) `mp_hal_delay_ms(100)` call. Signed-off-by: Damien George <damien@micropython.org>
-
Damien George authored
If the socket timeout is 0 then a failed socket.connect() raises EINPROGRESS (which is what the lwIP bindings already did), but if the socket timeout is non-zero then a failed socket.connect() should raise ETIMEDOUT. The latter is fixed in this commit. A test is added for these timeout cases. Signed-off-by: Damien George <damien@micropython.org>
-
Damien George authored
Currently, `cyw43_delay_ms()` calls `mp_hal_delay_ms()` which uses PendSV to set up a timer and wait for an interrupt, using wfe. But in the cyw43 initialisation stage PendSV is disabled and so this delay suspends on the wfe instruction for an indefinite amount of time. Work around this by changing the implementation of `cyw43_delay_ms()` to a busy loop. Fixes issue #15220. Signed-off-by: Damien George <damien@micropython.org>
-
- 06 Jun, 2024 1 commit
-
-
Damien George authored
Support for raw str/bytes already exists, and extending that to raw f-strings is easy. It also reduces code size because it eliminates an error message. Signed-off-by: Damien George <damien@micropython.org>
-