Monitor für das Tasterprogramm

Dependents:   19_Taster_BSW_oo 19_Taster_a

Fork of monitor by Temp27

Revision:
3:254f7ffb9b32
Parent:
2:e330478fb0b6
Child:
4:83dbae473d1f
diff -r e330478fb0b6 -r 254f7ffb9b32 monitor.cpp
--- a/monitor.cpp	Sun Aug 03 08:11:49 2014 +0000
+++ b/monitor.cpp	Sun Aug 03 18:24:11 2014 +0000
@@ -20,7 +20,7 @@
 #define COMMAND_MAX    13
 #define COMMAND_LEN    7
 
-const char command[COMMAND_MAX][COMMAND_LEN] = {"DATE","DEL","DIR","DROPS","DUMP","FILL","GO","HELP","LIST","SET","SOLL","STOP","TIME"};
+const char command[COMMAND_MAX][COMMAND_LEN] = {"DATE","DEL","DIR","DROPS","DUMP","FILL","GO","HELP","LIST","SET","SOLL","STOPP","TIME"};
 
 char buffer[100]; 
 
@@ -301,7 +301,7 @@
               
               break;
      } // end switch
-    
+    pc.printf("\n");
 }
 
 //-----------------------------------------------------------------------------
@@ -333,7 +333,7 @@
                 break;
                 
      } // end switch
-    
+    pc.printf("\n");
 }
 
 
@@ -366,7 +366,7 @@
                 break;
                 
      } // end switch
-    
+    pc.printf("\n");
 }
 //-----------------------------------------------------------------------------
 // monitor Aufruf go
@@ -375,12 +375,12 @@
 void go(void)
 {
     
-    int n;
+    
     char ch;
 
-    n = sscanf(&com_line[ComLinePtr],"%c",&ch);
+    sscanf(&com_line[ComLinePtr],"%c",&ch);
     
-    switch (n)
+    switch (ch)
     {
 
       case '?':
@@ -416,7 +416,7 @@
                  break;
                                
      } // end switch
-    
+    pc.printf("\n");
 }
 
 
@@ -427,12 +427,12 @@
 void stop(void)
 {
     
-    int n;
+    
     char ch;
 
-    n = sscanf(&com_line[ComLinePtr],"%c",&ch);
+    sscanf(&com_line[ComLinePtr],"%c",&ch);
     
-    switch (n)
+    switch (ch)
     {
 
       case '?':
@@ -448,7 +448,7 @@
                 cfg.setValue("t_flag", "0");
                 cfg.write("/sd/input.cfg");
                 
-                t_flag = true;
+                t_flag = false;
                 pc.printf("\nTemperatursteuerung ist deaktiviert");
                 
                 break;
@@ -458,17 +458,17 @@
                 cfg.setValue("f_flag", "0");
                 cfg.write("/sd/input.cfg");
                 
-                f_flag = true;
+                f_flag = false;
                 com.putc('9');
                 pc.printf("\nTropfen gesperrt");
                 
                 break;
                       
-       default:  pc.printf("\nBefehl stop kennt nur die Zeichen ?,t,T,f,F");
+       default:  pc.printf("\nBefehl stop kennt nur die Zeichen ?,t,T,f,F '%c' %x", ch, ch);
                  break;
                                
      } // end switch
-    
+    pc.printf("\n");
 }
 //-----------------------------------------------------------------------------
 // monitor Aufruf