micropython/ports
Damien George 7ed480fc6f Revert "stm32/machine_uart: Allow changing only the baudrate."
This reverts commit c94a3205b0.

The idea behind this reverted commit was that it allowed to reconfigure the
UART to change only the baudrate, which is important in the context of a
PPP connection where the baudrate may be changed as part of the protocol.
Also, other ports like the rp2 port have this behaviour, where individual
parameters of the UART can be changed with the `.init()` method.

But this commit was no good for a few reasons:

1. It's a subtle breaking change to the UART API, because existing code
   that constructs or initialises a UART with just the baudrate would
   expect all other parameters to be reset to their defaults.  But with
   this commit those parameters would remain unchanged.

2. Constructing a UART like `UART(1, 9600)` also hits this code path of
   only changing the baudrate and does not reset other parameters, which is
   unexpected.

3. It doesn't support setting the baudrate via keyword, eg
   `UART.init(baudrate=9600)`.

4. The `timeout_char` field is not updated when changing only the baudrate,
   which can lead to unexpected timeouts when reading/writing.

Due to point (4), this commit broke the `tests/ports/stm32/uart.py` test,
the `uart.writechar(1)` has a timeout because the `uart.init(2400)` does
not set the `timeout_char` for the new baudrate.

Points (2)-(4) could be fixed, but point (1) (being a breaking change)
would remain as an issue.  So the commit is reverted.

Signed-off-by: Damien George <damien@micropython.org>
2024-10-22 11:50:05 +11:00
..
bare-arm shared/libc/string0: Don't deref args for n==0 case. 2023-11-07 16:01:50 +11:00
cc3200 cc3200/mods/pybuart: Add the UART.IRQ_RX class constant. 2024-08-29 16:27:43 +10:00
embed all: Prune trailing whitespace. 2024-03-07 16:25:17 +11:00
esp32 esp32/mphalport: Always poll stdin ring-buffer to include UART use. 2024-10-16 14:50:11 +11:00
esp8266 esp32,esp8266: Use new mp_obj_new_str_from_cstr() function. 2024-07-05 11:27:25 +10:00
mimxrt ports: Include py/mphal.h instead of mphalport.h. 2024-10-09 14:39:34 +11:00
minimal minimal: Use printf instead of echo -e. 2024-02-15 16:36:22 +11:00
nrf ports: Include py/mphal.h instead of mphalport.h. 2024-10-09 14:39:34 +11:00
pic16bit all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
powerpc py/mpconfig: Disable qstr hashing at minimum feature level. 2024-01-25 16:38:17 +11:00
qemu qemu: Rename qemu-arm port to qemu. 2024-09-06 11:08:39 +10:00
renesas-ra renesas-ra/pendsv: Remove preemptive keyboard interrupt via PendSV. 2024-10-15 10:32:24 +11:00
rp2 rp2/machine_uart: Make it so TX is done only when no longer busy. 2024-10-22 10:17:05 +11:00
samd ports: Include py/mphal.h instead of mphalport.h. 2024-10-09 14:39:34 +11:00
stm32 Revert "stm32/machine_uart: Allow changing only the baudrate." 2024-10-22 11:50:05 +11:00
unix unix/main: Add --version command-line option. 2024-10-15 14:44:10 +11:00
webassembly ports: Include py/mphal.h instead of mphalport.h. 2024-10-09 14:39:34 +11:00
windows github/workflows: Improve MSYS2-based CI builds. 2024-07-25 16:22:21 +10:00
zephyr zephyr/boards: Add support for BeagleConnect Freedom. 2024-10-15 11:44:42 +11:00