diff options
| author | Ayke van Laethem <aykevanlaethem@gmail.com> | 2018-08-02 21:45:11 +0200 |
|---|---|---|
| committer | Ayke van Laethem <aykevanlaethem@gmail.com> | 2018-08-02 22:21:24 +0200 |
| commit | e755bd4932dc5dd8cb6ace92e8f7ca18f90e7956 (patch) | |
| tree | 22d58ae4d1625c4db3986644e97bc4f4ca99fb7a | |
| parent | 60a05485cbc20bd5ccb9ea5e4c90989117f2a427 (diff) | |
nrf/uart: Fix UART.writechar() to write just 1 byte.
| -rw-r--r-- | ports/nrf/modules/machine/uart.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/ports/nrf/modules/machine/uart.c b/ports/nrf/modules/machine/uart.c index 9e07d86c6..c3f8ea984 100644 --- a/ports/nrf/modules/machine/uart.c +++ b/ports/nrf/modules/machine/uart.c @@ -245,13 +245,9 @@ STATIC mp_obj_t machine_hard_uart_writechar(mp_obj_t self_in, mp_obj_t char_in) machine_hard_uart_obj_t *self = self_in; // get the character to write (might be 9 bits) - uint16_t data = mp_obj_get_int(char_in); - - nrfx_err_t err = NRFX_SUCCESS; - for (int i = 0; i < 2; i++) { - err = uart_tx_char(self, (int)(&data)[i]); - } + int data = mp_obj_get_int(char_in); + nrfx_err_t err = uart_tx_char(self, data); if (err != NRFX_SUCCESS) { mp_hal_raise(err); } |
