From 481d714bd56e0173668b249760e9cea8fce9b04f Mon Sep 17 00:00:00 2001 From: Damien George Date: Sat, 11 Oct 2014 17:57:10 +0100 Subject: stmhal: Overhaul UART class to use read/write, and improve it. UART object now uses a stream-like interface: read, readall, readline, readinto, readchar, write, writechar. Timeouts are configured when the UART object is initialised, using timeout and timeout_char keyword args. The object includes optional read buffering, using interrupts. You can set the buffer size dynamically using read_buf_len keyword arg. A size of 0 disables buffering. --- stmhal/main.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'stmhal/main.c') diff --git a/stmhal/main.c b/stmhal/main.c index 74a9c4c05..097b8ca85 100644 --- a/stmhal/main.c +++ b/stmhal/main.c @@ -320,6 +320,7 @@ soft_reset: pin_init0(); extint_init0(); timer_init0(); + uart_init0(); #if MICROPY_HW_ENABLE_RNG rng_init0(); @@ -543,6 +544,7 @@ soft_reset: printf("PYB: soft reboot\n"); timer_deinit(); + uart_deinit(); first_soft_reset = false; goto soft_reset; -- cgit v1.2.3