summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/main.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-10-11 17:57:10 +0100
committerDamien George <damien.p.george@gmail.com>2014-10-21 22:15:20 +0100
commit481d714bd56e0173668b249760e9cea8fce9b04f (patch)
tree4a1e9458676177d05b18e7d50966469bf44e1ec1 /stmhal/main.c
parent20f59e182e1ca5874a94ce939f8a81af6c3dd71a (diff)
downloadmicropython-481d714bd56e0173668b249760e9cea8fce9b04f.tar.gz
micropython-481d714bd56e0173668b249760e9cea8fce9b04f.zip
stmhal: Overhaul UART class to use read/write, and improve it.v1.3.4
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.
Diffstat (limited to 'stmhal/main.c')
-rw-r--r--stmhal/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/stmhal/main.c b/stmhal/main.c
index 74a9c4c053..097b8ca853 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;