Huseyin Berkay Berabi / GA-Final

Dependencies:   mbed-dev

Fork of GA-Berkay_Alex by Alejandro Ungria Hirte

Revision:
3:8bee1711d186
Parent:
1:346279def7ac
Child:
4:120ff05a7c27
--- a/PC/PC.cpp	Wed Jan 10 16:14:49 2018 +0000
+++ b/PC/PC.cpp	Wed Feb 28 16:10:21 2018 +0000
@@ -25,28 +25,34 @@
 void PC::readcommand(void (*executer)(char*))
 {
     
-
-    /*char input = getc();             // get the character from serial bus
+    //printf("Reads");
+    //while(1){
+    char input = getc();  
+    //printf("%c", input);           // get the character from serial bus
     //printf("\x1B[1K");
     //printf("-");
-    if(input == 'r') {                 // if return was pressed, the command must be executed
-        command[command_char_count] = '\0';
+    
+     if(input == '\r') {  
+                   // if return was pressed, the command must be executed
+        this->command[command_char_count] = '\0';
         executer(&command[0]);
-        command_char_count = 0;                 // reset command
-        command[command_char_count] = '\0';
+        this->command_char_count = 0;                // reset command
+        this->command[command_char_count] = '\0';
+    //    break;
     } else if (command_char_count < COMMAND_MAX_LENGHT) {
        // printf("Debug Point 4");
-        command[command_char_count] = input;
+        this->command[command_char_count] = input;
         //printf(command);
-        command_char_count++;
+        this->command_char_count++;
+      
     }
+//}
 
-*/
 
 
     
    
-   while (1)
+/*   while (1)
     {
        
         if (readable())
@@ -61,7 +67,7 @@
     executer(&command[0]);
     command_char_count = 0;                 // reset command
     
-    
+   */