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 GA-Test_copy by
Diff: PC/PC.cpp
- Revision:
- 1:346279def7ac
- Parent:
- 0:a3b83d366423
--- a/PC/PC.cpp Wed Dec 06 21:35:45 2017 +0000
+++ b/PC/PC.cpp Sat Dec 09 16:02:58 2017 +0000
@@ -25,29 +25,30 @@
void PC::readcommand(void (*executer)(char*))
{
-/*
- char input = getc(); // get the character from serial bus
+
+ /*char input = getc(); // get the character from serial bus
//printf("\x1B[1K");
//printf("-");
- if(input == '\r') { // if return was pressed, the command must be executed
+ if(input == 'r') { // if return was pressed, the command must be executed
command[command_char_count] = '\0';
executer(&command[0]);
- printf("Debug Point 5");
- //printf("1");
command_char_count = 0; // reset command
command[command_char_count] = '\0';
- // printf("2");
} else if (command_char_count < COMMAND_MAX_LENGHT) {
- printf("Debug Point 4");
+ // printf("Debug Point 4");
command[command_char_count] = input;
+ //printf(command);
command_char_count++;
}
+
*/
-
- while (1)
+
+
+ while (1)
{
+
if (readable())
{
scanf( "%s" , command );
@@ -58,6 +59,10 @@
executer(&command[0]);
+ command_char_count = 0; // reset command
+
+
+
}
