summaryrefslogtreecommitdiff
path: root/firmware/uart.c
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2011-10-13 20:33:30 +0200
committerYves Fischer <yvesf-git@xapek.org>2011-10-13 20:33:30 +0200
commit5d9d373a959271b498710817d08c2ea8e153aa6e (patch)
tree6867e887454a850b4e15616000ef342a1c661c7e /firmware/uart.c
parent35a36b0a6c69ce136fd6ea2a203d34e48e1291e8 (diff)
downloadmini-octopus-5d9d373a959271b498710817d08c2ea8e153aa6e.tar.gz
mini-octopus-5d9d373a959271b498710817d08c2ea8e153aa6e.zip
correct firmware??
Diffstat (limited to 'firmware/uart.c')
-rw-r--r--firmware/uart.c22
1 files changed, 10 insertions, 12 deletions
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;
}
-
-