mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 19:20:22 +01:00
stm32/uart: Add ability to have a static built-in UART object.
A static UART is useful for internal peripherals that require a UART and need to persist outside the soft-reset loop.
This commit is contained in:
@@ -161,6 +161,11 @@ STATIC mp_obj_t pyb_uart_init_helper(pyb_uart_obj_t *self, size_t n_args, const
|
||||
mp_arg_parse_all(n_args, pos_args, kw_args,
|
||||
MP_ARRAY_SIZE(allowed_args), allowed_args, (mp_arg_val_t*)&args);
|
||||
|
||||
// static UARTs are used for internal purposes and shouldn't be reconfigured
|
||||
if (self->is_static) {
|
||||
mp_raise_ValueError("UART is static and can't be init'd");
|
||||
}
|
||||
|
||||
// baudrate
|
||||
uint32_t baudrate = args.baudrate.u_int;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user