Skip to content
Snippets Groups Projects
Commit 62ce1539 authored by fortissBot's avatar fortissBot
Browse files

LRF: printf

refs 7956
parent 5105407b
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@ int timeout;
/** Initialize the laser range finder. */
void lrf_init() {
timeout = 0;
/*
char port[] = "/dev/????????";
FILE* fp = popen("dmesg | grep -A 3 \"Arduino Uno\" | grep -o \"ttyACM.\" | tail -n 1","r");
......@@ -41,6 +41,7 @@ GEN_TYPE_int lrf_read() {
if (uart_filestream == -1) {
timeout++;
printf("-1: no filestream\n");
return -1;
}
......@@ -67,8 +68,9 @@ GEN_TYPE_int lrf_read() {
while (1) {
n_read = uart_receive(bytes, sizeof(bytes) / sizeof(bytes[0]), 0);
if(n_read < 0) {
if(n_read <= 0) {
timeout++;
printf("-1: n_read=%d\n",n_read);
return -1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment