- 22 Mar, 2023 4 commits
-
-
Damien George authored
Signed-off-by: Damien George <damien@micropython.org>
-
Damien George authored
Signed-off-by: Damien George <damien@micropython.org>
-
robert-hh authored
Prior to this change, setting of UART parameters like parity, stop bits or data bits did not work correctly. As suggested by @iabdalkader, adding __DSB() fixes the problem, making sure that changes to the UART LCR_H register are seen by the peripheral. Note: the FIFO is already enabled in the call to uart_init(), so the call to uart_set_fifo_enabled() is not required, but kept for visibility. Fixes issue #10976.
-
Damien George authored
This was broken by 5327cd10Signed-off-by: Damien George <damien@micropython.org>
-
- 21 Mar, 2023 8 commits
-
-
Damien George authored
This is intended to be used by the very outer caller of the VM/runtime. It allows setting a top-level NLR handler that can be jumped to directly, in order to forcefully abort the VM/runtime. Enable using: #define MICROPY_ENABLE_VM_ABORT (1) Set up the handler at the top level using: nlr_buf_t nlr; nlr.ret_val = NULL; if (nlr_push(&nlr) == 0) { nlr_set_abort(&nlr); // call into the VM/runtime ... nlr_pop(); } else { if (nlr.ret_val == NULL) { // handle abort ... } else { // handle other exception that propagated to the top level ... } } nlr_set_abort(NULL); Schedule an abort, eg from an interrupt handler, using: mp_sched_vm_abort(); Signed-off-by: Damien George <damien@micropython.org>
-
Damien George authored
Signed-off-by: Damien George <damien@micropython.org>
-
Jeremy Rand authored
When iterating over os.ilistdir(), the special directories '.' and '..' are filtered from the results. But the code inadvertently also filtered any file/directory which happened to match '..*'. This change fixes the filter. Fixes issue #11032. Signed-off-by: Jeremy Rand <jeremy@rand-family.com>
-
Damien George authored
The following have been tested and are working: - 550MHz CPU frequency - UART REPL via ST-Link - USB REPL and mass storage - 3x LEDs and 1x user button - Ethernet Signed-off-by: Damien George <damien@micropython.org>
-
Damien George authored
Signed-off-by: Damien George <damien@micropython.org>
-
Damien George authored
Signed-off-by: Damien George <damien@micropython.org>
-
Damien George authored
Signed-off-by: Damien George <damien@micropython.org>
-
Damien George authored
Signed-off-by: Damien George <damien@micropython.org>
-
- 20 Mar, 2023 9 commits
-
-
robert-hh authored
For builds with DEBUG=1 and MICROPY_HW_ENABLE_UART_REPL=1, calling stdio_init_all() in main() detaches the UART input from REPL. This change suppresses calling stdio_init_all() then.
-
robert-hh authored
Previously, setting MICROPY_HW_ENABLE_USBDEV to 0 caused build errors. The change affects the nrf and samd ports as well, so MICROPY_HW_ENABLE_USBDEV had to be explicitly enabled there. The configuration options MICROPY_HW_ENABLE_USBDEV and MICROPY_HW_ENABLE_UART_REPL are independent, and can be enabled or disabled by a board. Signed-off-by: Damien George <damien@micropython.org>
-
robert-hh authored
Mostly for compatibility. Effective values are 100000, 250000 and 400000. The supplied values are mapped to these.
-
robert-hh authored
Calling MICROPY_EVENT_POLL_HOOK. That allows Ctrl-C to break loops with idle().
-
robert-hh authored
Suggested by @ricksorensen after testing. These match better the hardware of the NRF52xx.
-
robert-hh authored
Changes in this commit: - Add the timeout and timeout_char keyword options. - Make uart.read() non-blocking. - Add uart.any(). - Add ioctl MP_STREAM_POLL handling. - Change uart.write() into non-busy waiting. uart.write() still waits until all data has been sent, but calls MICROPY_EVENT_POLL_HOOK while waiting. uart.write() uses DMA for transfer. One option would be to add a small local buffer, such that transfers up to the size of the buffer could be done without waiting. - As a side effect to the change of uart.write(), uart.txdone() and ioctl flush now report/wait correctly for the end of transmission. - Change machine_hard_uart_buf_t in machine_hard_uart_obj_t to an instance of that struct, rather than a pointer to one.
-
Damien George authored
Signed-off-by: Damien George <damien@micropython.org>
-
iabdalkader authored
-
David Lechner authored
Example code should use mp_obj_malloc() as well since people will likely copy this code. Signed-off-by: David Lechner <david@pybricks.com>
-
- 17 Mar, 2023 1 commit
-
-
David Lechner authored
As the comment in py/obj.h says: > Implementing this as a call rather than inline saves 8 bytes per usage. So in order to get this savings, we need to tell the compiler to never inline the function. Signed-off-by: David Lechner <david@pybricks.com>
-
- 13 Mar, 2023 3 commits
-
-
robert-hh authored
Even if boards do not have a clock crystal. In that case, the clock quality will be very poor. Always having machine.RTC means that the date/time can be set in a way that is consistent with other ports. This commit also removes the special code in modutime.c for devices without the RTC class. Signed-off-by: Damien George <damien@micropython.org>
-
pmendham authored
Update arguments to mp_raw_code_load_mem so that the embed port can build when MICROPY_PERSISTENT_CODE_LOAD is enabled.
-
IhorNehrutsa authored
-
- 10 Mar, 2023 4 commits
-
-
Damien George authored
Moving forward, tags in this repository will always have three components. Signed-off-by: Damien George <damien@micropython.org>
-
Christian Clauss authored
These are basic PEP8 recommendations.
-
Laurens Valk authored
Without this, building the unix port variants gives: ports/unix/main.c:667: undefined reference to `mp_obj_is_package', when MICROPY_ENABLE_EXTERNAL_IMPORT is 0. Signed-off-by: Laurens Valk <laurens@pybricks.com>
-
Damien George authored
The C-level printf is usually used for internal debugging prints, and a port/board may want to redirect this somewhere other than stdout. Signed-off-by: Damien George <damien@micropython.org>
-
- 09 Mar, 2023 11 commits
-
-
Damien George authored
So that callers can redirect the output if needed. Signed-off-by: Damien George <damien@micropython.org>
-
Damien George authored
Signed-off-by: Damien George <damien@micropython.org>
-
robert-hh authored
These have the same frequency, but can have different duty cycle and polarity. pwm.deinit() stops all channels of a module, but does not release the module. pwm.init() without arguments restarts all outputs.
-
robert-hh authored
Using extmod/machine_pwm.c for the Python bindings and the existing softpwm.c driver, by just adding the interface. Properties: - Frequency range 1-3906 Hz. - All PWM outputs run at the same frequency but can have different duty cycles. - Limited to the P0.x pins. Since it uses the existing softpwm.c mechanism, it will be affected by playing music with the music class.
-
robert-hh authored
This is a breaking change, making the hardware PWM on the nrf port compatible with the other ports providing machine.PWM. Frequency range 4Hz - ~5.4 MHz. The base clock range is 125kHz to 16 MHz, and the divider range is 3 - 32767. The hardware supports up to four outputs per PWM device with different duty cycles, but only one output is (and was) supported.
-
robert-hh authored
-
Damien George authored
Signed-off-by: Damien George <damien@micropython.org>
-
Damien George authored
Signed-off-by: Damien George <damien@micropython.org>
-
Damien George authored
Signed-off-by: Damien George <damien@micropython.org>
-
Damien George authored
Signed-off-by: Damien George <damien@micropython.org>
-
Damien George authored
Signed-off-by: Damien George <damien@micropython.org>
-