Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of 02_LAB_serial_protocol by
Diff: main.cpp
- Revision:
- 8:cd9b52716920
- Parent:
- 7:fab201aa45b7
- Child:
- 9:3a8624147a4c
--- a/main.cpp Sat Sep 23 14:44:47 2017 +0000 +++ b/main.cpp Sat Sep 30 14:29:33 2017 +0000 @@ -24,7 +24,7 @@ // COMANDOS #define LED_NC 0 -#define DOT_NC 1 +#define DOT_NC 31 #define LINE_NC 2 #define RECTANGLE_NC 3 #define CICLE_NC 4 @@ -71,19 +71,8 @@ uint8_t check_command() { - if (buffer_command[BUFF_SIZE-1]== '>'){ - - #if DEBUG - command.printf("\nComando:"); - print_bin2hex(buffer_command[COMM_N]); - command.printf(" -> "); - #endif - return 1; - } - #if DEBUG - command.printf("\n ERROR COMANDO -> "); - echo_command(); - #endif + if (buffer_command[BUFF_SIZE-1]== '>') + return 1; return 0; @@ -151,10 +140,17 @@ Read_command(); if (check_command()){ command_exe(); + }else{ #if DEBUG - echo_command(); + command.printf("\n ERROR COMANDO -> "); + echo_command(); #endif - } + } + }else{ + #if DEBUG + command.printf("error de inicio de trama: "); + command.putc(val); + #endif } }