From 5d9d373a959271b498710817d08c2ea8e153aa6e Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Thu, 13 Oct 2011 20:33:30 +0200 Subject: correct firmware?? --- firmware/uart.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'firmware/uart.c') diff --git a/firmware/uart.c b/firmware/uart.c index 9ae00c9..ac856b2 100644 --- a/firmware/uart.c +++ b/firmware/uart.c @@ -39,7 +39,7 @@ void uart_parser(char *buf) break; default: answer[1] = RSP_UNKOWN_CMD; - answer[2] = 0; + answer[2] = '\0'; CommandAnswer(3); } } @@ -47,7 +47,7 @@ void uart_parser(char *buf) void uart_init_usb(char uartport) { answer[1] = (unsigned char)uart_init(uartport); - answer[2] = 0; + answer[2] = '\0'; CommandAnswer(3); } @@ -78,7 +78,7 @@ char uart_init(char uartport) void uart_deinit_usb(char uartport) { answer[1] = (unsigned char)uart_deinit(uartport); - answer[2] = 0; + answer[2] = '\0'; CommandAnswer(3); } @@ -113,7 +113,7 @@ char uart_deinit(char uartport) void uart_baudrate_usb(char uartport, char ubrrll, char ubrrlh, char ubrrhl, char ubrrhh) { answer[1] = (unsigned char)uart_baudrate(uartport, ubrrll, ubrrlh, ubrrhl, ubrrhh); - answer[2] = 0; + answer[2] = '\0'; CommandAnswer(3); } @@ -140,7 +140,7 @@ char uart_baudrate(char uartport, char ubrrll, char ubrrlh, char ubrrhl, char ub void uart_stopbits_usb(char uartport, char stopbits) { answer[1] = (unsigned char)uart_stopbits(uartport, stopbits); - answer[2] = 0; + answer[2] = '\0'; CommandAnswer(3); } @@ -174,7 +174,7 @@ char uart_stopbits(char uartport, char stopbits) void uart_databits_usb(char uartport, char databits) { answer[1] = (unsigned char)uart_databits(uartport, databits); - answer[2] = 0; + answer[2] = '\0'; CommandAnswer(3); } @@ -209,7 +209,7 @@ char uart_databits(char uartport, char databits) void uart_parity_usb(char uartport, char parity) { answer[1] = (unsigned char)uart_databits(uartport, parity); - answer[2] = 0; + answer[2] = '\0'; CommandAnswer(3); } @@ -243,7 +243,7 @@ char uart_parity(char uartport, char parity) void uart_send_usb(char uartport, char length, char *buf) { answer[1] = (unsigned char)uart_send(uartport, length, buf); - answer[2] = 0; + answer[2] = '\0'; CommandAnswer(3); } @@ -255,7 +255,9 @@ char uart_send(char uartport, unsigned int length, char *buf) return RSP_UNKOWN_PIN; while(length--) + { uart_putchar(uartport, *buf++); + } return RSP_OK; } @@ -293,8 +295,6 @@ void uart_recv_usb(char uartport, int length) for(i = 0; i < length; i++) answer[2+i] = data[i]; - answer[2+length] = 0; - CommandAnswer(3+length); } @@ -329,5 +329,3 @@ char uart_getchar(char uartport) return c; } - - -- cgit v1.2.1