Revision 252
made some more changes to uart
test7.c | ||
---|---|---|
34 | 34 |
int stringc, char *strings[]) { |
35 | 35 |
int ret = SUCCESS; |
36 | 36 |
if((ret = ser_test_set(base_addr, bits, stop, parity, rate))) return ret; |
37 |
if((ret = uart_disable_int_rx(base_addr))) return ret; |
|
38 |
if((ret = uart_disable_int_tx(base_addr))) return ret; |
|
37 | 39 |
if(tx == 0){ |
38 | 40 |
uint8_t c; |
39 | 41 |
if((ret = uart_get_char_poll(base_addr, &c))) return ret; |
... | ... | |
44 | 46 |
printf("%c\n", (char)c); |
45 | 47 |
}else{ |
46 | 48 |
for(int i = 0; i < stringc; ++i){ |
47 |
size_t sz = strlen(strings[i]); |
|
48 |
if((ret = uart_send_memory_poll(base_addr, strings[i], sz))) return ret; |
|
49 |
if(i+1 != stringc) if((ret = uart_send_memory_poll(base_addr, " ", 1))) return ret; |
|
49 |
for(int j = 0; strings[i][j] != 0; ++j) |
|
50 |
if((ret = uart_send_char_poll(base_addr, strings[i][j]))) |
|
51 |
return ret; |
|
52 |
if(i+1 != stringc) |
|
53 |
if((ret = uart_send_char_poll(base_addr, ' '))) return ret; |
|
50 | 54 |
} |
51 |
if((ret = uart_send_memory_poll(base_addr, ".", 1))) return ret;
|
|
55 |
if((ret = uart_send_char_poll(base_addr, '.'))) return ret;
|
|
52 | 56 |
} |
53 | 57 |
return SUCCESS; |
54 | 58 |
} |
Also available in: Unified diff