mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-28 07:51:19 +01:00
The UART API has not spelled out what happens when `uart_init()` is called twice. This adds precise language that states that acquire/release semantic is to be expected from the caller. Hence, a caller needs to call `uart_poweroff()` before reconfiguring the UART with a second call `uart_init()` for the same UART interface. In practise, few apps will ever reconfigure the symbol rate. So the impact is rather low. However: This API now allows drivers to implement sharing of a serial peripheral that can provide multiple interfaces (e.g. UART, SPI, I2C, etc.). It would require some cooperation from the code that does use the UART to actually release the UART again after each transaction; something that will only work when RX data is only expected at known points in time (e.g. in response to a request, or never in case of TX only stdio). But still, this can mean the difference between a use case becoming feasible on an MCU with a low number of serial peripherals or not.