From d1c4cff04680ff449b44ed4a960b0c20b3a1f3bb Mon Sep 17 00:00:00 2001 From: niclasthobaben Date: Sun, 20 Dec 2020 14:42:13 +0100 Subject: [PATCH] FIX usart_tx cannot write values len>1 --- core/src/usart.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/core/src/usart.c b/core/src/usart.c index 2a6bcb3..baac6f7 100644 --- a/core/src/usart.c +++ b/core/src/usart.c @@ -79,16 +79,21 @@ int usart_write (uint8_t _usart,int ch){ }; int usart_tx (uint8_t usart,char *b,int size){ - int n,r; + int n,r, tries; + tries = 10; for (n=0;n= 0){ - return ESUCCESS; + for (r=0;r= 0){ + b++; + break; }; + if(r == tries - 1) { + return -EFAIL; + } wait_ms(1); }; }; - return -EFAIL; + return ESUCCESS; };