Kart+xxxxx // Radar_RTOS
Dependencies: Radar_RTOS mbed
Fork of Radar_RTOS by
Diff: UART_Radar.cpp
- Revision:
- 3:422918db0559
- Parent:
- 2:97cbf2a5ec78
diff -r 97cbf2a5ec78 -r 422918db0559 UART_Radar.cpp --- a/UART_Radar.cpp Wed Dec 02 16:09:22 2015 +0000 +++ b/UART_Radar.cpp Fri Jan 15 08:44:59 2016 +0000 @@ -2,7 +2,7 @@ #include "mbed.h" #include <string.h> Serial carte(PA_9, PA_10); //emission --- tx, rx -Serial pc(USBTX, USBRX); //reception --- tx, rx + void USART1_puts(char *text){ while(*text != '\0'){ @@ -20,7 +20,7 @@ int somme=5; int i=0; msg_formated[0]=2; - printf("\n\r"); + //pc.printf("\n\r"); while(msg[i]!=0){ somme= somme + msg[i]; msg_formated[i+1]=msg[i]; @@ -35,11 +35,11 @@ msg_formated[i+3]=0; //A supprimer - i=0; + /*i=0; while(msg_formated[i]!=0){ printf("[%d] ", msg_formated[i]); i++; - } + }*/ } @@ -56,7 +56,7 @@ Timer timeout; timeout.start(); while(1){ - if(timeout.read_ms() > 100) return 1; + if(timeout.read_ms() > 100) return 2; if(carte.readable()){ r = carte.getc(); @@ -80,7 +80,6 @@ frame[I-1]=0; return 0; }else{ //Message invalidé par la somme - frame[0]=0; return 1; } @@ -95,6 +94,6 @@ } int controle(char *frame){ - if (*frame!=6) return 0; + if (*frame == 6) return 0; else return 1; } \ No newline at end of file