Commit d0ffda91 authored by mux's avatar mux
Browse files

Fix usart_obj_tx_char

parent f3494770
...@@ -205,8 +205,10 @@ static mp_obj_t usart_obj_rx_char(mp_obj_t self_in) { ...@@ -205,8 +205,10 @@ static mp_obj_t usart_obj_rx_char(mp_obj_t self_in) {
static mp_obj_t usart_obj_tx_char(mp_obj_t self_in, mp_obj_t c) { static mp_obj_t usart_obj_tx_char(mp_obj_t self_in, mp_obj_t c) {
pyb_usart_obj_t *self = self_in; pyb_usart_obj_t *self = self_in;
if (self->is_enabled) { uint len;
usart_tx_char(self->usart_id, mp_obj_get_int(c)); const char *str = mp_obj_str_get_data(c, &len);
if (len == 1 && self->is_enabled) {
usart_tx_char(self->usart_id, str[0]);
} }
return mp_const_none; return mp_const_none;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment