Compare commits
No commits in common. "master" and "master" have entirely different histories.
|
@ -79,21 +79,16 @@ int usart_write (uint8_t _usart,int ch){
|
|||
};
|
||||
|
||||
int usart_tx (uint8_t usart,char *b,int size){
|
||||
int n,r, tries;
|
||||
tries = 10;
|
||||
int n,r;
|
||||
for (n=0;n<size;n++){
|
||||
for (r=0;r<tries;r++){
|
||||
if (usart_write( usart, *b) >= 0){
|
||||
b++;
|
||||
break;
|
||||
for (r=0;r<10;r++){
|
||||
if (usart_write( usart, *(b++)) >= 0){
|
||||
return ESUCCESS;
|
||||
};
|
||||
if(r == tries - 1) {
|
||||
return -EFAIL;
|
||||
}
|
||||
wait_ms(1);
|
||||
};
|
||||
};
|
||||
return ESUCCESS;
|
||||
return -EFAIL;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue