- 11 Apr, 2023 1 commit
-
-
Alex Riesen authored
The GreenHills preprocessor produces #line directives without a file name, which the regular expression used to distiguish between "# <number> file..." (GCC and similar) and "#line <number> file..." (Microsoft C and similar) does not match, aborting processing. Besides, the regular expression was unnecessarily wide, matching lines containing a "#", followed by any number of 'l','i','n', and 'e' characters. Signed-off-by: Alex Riesen <alexander.riesen@cetitec.com>
-
- 07 Apr, 2023 1 commit
-
-
Jim Mussared authored
This adds a new MODE_PYPROJECT, which gives basic support to allow packaging a small subset of micropython-lib packages to PyPI. This change allows a package in micropython-lib to: - Add a "pypi" name to its metadata indicating that it's based on a PyPI package. - Add "stdlib" to its metadata indicating that it's a micropython version of a stdlib package. - Add a "pypi_publish" name to its metadata to indicate that it can be published to PyPI (this can be different to the package name, e.g. "foo" might want to be published as "micropython-foo"). When a package requires() another one, if it's in MODE_PYPROJECT then if the package is from pypi then it will record that as a pypi dependency instead (or no dependency at all if it's from stdlib). Also allows require() to explicitly specify the pypi name. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
-
- 05 Apr, 2023 4 commits
-
-
David Grayson authored
Helps prevent the filesystem from getting formatted by mistake, among other things. For example, on a Pico board, entering Ctrl+D and Ctrl+C fast many times will eventually wipe the filesystem (without warning or notice). Further rationale: Ctrl+C is used a lot by automation scripts (eg mpremote) and UI's (eg Mu, Thonny) to get the board into a known state. If the board is not responding for a short time then it's not possible to know if it's just a slow start up (eg in _boot.py), or an infinite loop in the main application. The former should not be interrupted, but the latter should. The only way to distinguish these two cases would be to wait "long enough", and if there's nothing on the serial after "long enough" then assume it's running the application and Ctrl+C should break out of it. But defining "long enough" is impossible for all the different boards and their possible behaviour. The solution in this commit is to make it so that frozen start-up code cannot be interrupted by Ctrl+C. That code then effectively acts like normal C start-up code, which also cannot be interrupted. Note: on the stm32 port this was never seen as an issue because all start-up code is in C. But now other ports start to put more things in _boot.py and so this problem crops up. Signed-off-by: David Grayson <davidegrayson@gmail.com>
-
iabdalkader authored
The dispatch active flag is only set once and never reset, so it will always call the dispatch handler (once enabled), and it's not really needed because it doesn't make things more efficient. Also remove unused included headers.
-
robert-hh authored
Like frame error, overrun, etc. Fix is provided by @ricksorensen.
-
robert-hh authored
It was incomplete.
-
- 04 Apr, 2023 9 commits
-
-
robert-hh authored
Changes in this commit: - Move the pwm_seq array to the p_config data structure. That prevents potential resource collisions between PWM devices. - Rename the keyword argument 'id' to 'device'. That's consistent with the SAMD port as the other port allowing to specify it.
-
iabdalkader authored
This regression was introduced by 3d46fe67.
-
Oliver Joos authored
This enables the use of WLAN(0).status('rssi') to get current RSSI of the AP that the STA is connected to. Signed-off-by: Damien George <damien@micropython.org>
-
Oliver Joos authored
This bug is probably a typo. args[0] is the cyw43 object itself. While the value of a kwargs is in e->value.
-
iabdalkader authored
The NINA socket types have the same values as modnetwork, but that may change in the future. So check the socket types passed to socket() and convert them (if needed) to their respective Nina socket types. Also remove the unnecessary socket type check code from bind(), as pointed out by @robert-hh.
-
iabdalkader authored
ESP32 pins 34, 35, 36 and 39 are input only, and should not be configured as output.
-
Jan Hrudka authored
STM32H750 has only 1 flash bank so function get_bank should always return FLASH_BANK_1.
-
Jos Verlinde authored
This is a follow up to d263438a, which solved one problem (reset on disconnect) but introduced a second one (hang in bootloader). To solve both probles, False/False is needed for DTR/RTS for ESPxx, but that would then block stm32 and others. Any unconditional combination of DTR/RTS ends up blocking normal operation on some type of board or another. A simple overview (for windows only): DTR CTS ESP8266/ESP32 STM32/SAMD51/RP2040 unspecified unspecified Reset on disconnect OK True False Hang in bootloader OK False False OK No Repl True True Reset on disconnect No Repl False True Reset on disconnect No Repl serial.manufacturer: wch.cn/Silicon Labs Microsoft serial.description: USB-SERIAL CH340 / USB Serial Device CP210x USB to UART Bridge The updated logic will only set the DTR/RTS signals for boards that do not use standard Microsoft drivers (based on the manufacturer). It would also be possible to check against a list of known driver manufactures (like wch.cn or Silicon Labs) but this would require a list of known drivers for all ports. Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
-
Damien George authored
Signed-off-by: Damien George <damien@micropython.org>
-
- 31 Mar, 2023 1 commit
-
-
Sebastian Romero authored
-
- 29 Mar, 2023 1 commit
-
-
Damien George authored
Following other vfs_fat tests, so the test works on ports like stm32 that only support 512-byte block size. Signed-off-by: Damien George <damien@micropython.org>
-
- 28 Mar, 2023 1 commit
-
-
David Lechner authored
Signed-off-by: David Lechner <david@pybricks.com>
-
- 23 Mar, 2023 3 commits
-
-
Damien George authored
This is a best-effort implementation of write polling. It's difficult to do correctly because if there are multiple output streams (eg UART and USB CDC) then some may not be writeable while others are. A full solution should also have a return value from mp_hal_stdout_tx_strn(), returning the number of bytes written to the stream(s). That's also hard to define. The renesas-ra and stm32 ports already implement a similar best-effort mechanism for write polling. Fixes issue #11026. Signed-off-by: Damien George <damien@micropython.org>
-
Damien George authored
Signed-off-by: Damien George <damien@micropython.org>
-
Damien George authored
If a multitest calls `multitest.output_metric(...)` then that output will be collected separately, not considered as part of the test verification output, and instead be printed at the end. This is useful for tests that want to output performance/timing metrics that may change from one run to the next. Signed-off-by: Damien George <damien@micropython.org>
-
- 22 Mar, 2023 5 commits
-
-
Damien George authored
But leave these disabled. 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>
-
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 6 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.
-