FIX usart_tx cannot write values len>1
parent
892abe9ad4
commit
90e989ae1c
|
@ -79,16 +79,21 @@ int usart_write (uint8_t _usart,int ch){
|
||||||
};
|
};
|
||||||
|
|
||||||
int usart_tx (uint8_t usart,char *b,int size){
|
int usart_tx (uint8_t usart,char *b,int size){
|
||||||
int n,r;
|
int n,r, tries;
|
||||||
|
tries = 10;
|
||||||
for (n=0;n<size;n++){
|
for (n=0;n<size;n++){
|
||||||
for (r=0;r<10;r++){
|
for (r=0;r<tries;r++){
|
||||||
if (usart_write( usart, *(b++)) >= 0){
|
if (usart_write( usart, *b) >= 0){
|
||||||
return ESUCCESS;
|
b++;
|
||||||
|
break;
|
||||||
};
|
};
|
||||||
|
if(r == tries - 1) {
|
||||||
|
return -EFAIL;
|
||||||
|
}
|
||||||
wait_ms(1);
|
wait_ms(1);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
return -EFAIL;
|
return ESUCCESS;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue