Dependents:   WeatherStation

Revision:
2:64bc38078592
Parent:
1:f8c5afc27878
Child:
3:ed09123d603f
diff -r f8c5afc27878 -r 64bc38078592 ILinterpreter.cpp
--- a/ILinterpreter.cpp	Sun Jun 26 16:53:49 2011 +0000
+++ b/ILinterpreter.cpp	Tue Jun 28 15:47:31 2011 +0000
@@ -38,7 +38,6 @@
 
 ILinterpreter::ILinterpreter () {
     il_count = 0;
-    printf("<%x>\r\n", &inout);
     memset(&inout, 0, sizeof(inout));
     inout.sec = time(NULL) + (60 * 60 * 9);
     inout_old = inout;
@@ -242,10 +241,10 @@
             reg = reg && ! input(&inout, i);
             break;
         case MNE_ANDP:
-            reg = reg && (input(&inout, i) && ! input(&inout_old, i), 1);
+            reg = reg && (input(&inout, i) && ! input(&inout_old, i, 1));
             break;
         case MNE_ANDF:
-            reg = reg && (! input(&inout, i) && input(&inout_old, i), 1);
+            reg = reg && (! input(&inout, i) && input(&inout_old, i, 1));
             break;
 
         case MNE_OR:
@@ -255,10 +254,10 @@
             reg = reg || ! input(&inout, i);
             break;
         case MNE_ORP:
-            reg = reg || (input(&inout, i) && ! input(&inout_old, i), 1);
+            reg = reg || (input(&inout, i) && ! input(&inout_old, i, 1));
             break;
         case MNE_ORF:
-            reg = reg || (! input(&inout, i) && input(&inout_old, i), 1);
+            reg = reg || (! input(&inout, i) && input(&inout_old, i, 1));
             break;
 
         case MNE_ANB:
@@ -385,6 +384,9 @@
                 // "MNEMONIC" KEYnum==value
                 il[il_count].mnemonic = mne_str[j].mne;
                 load_exp(il_count, &buf[len + 1]);
+#ifdef DEBUG
+                printf("%d: M=%d [%c%d] E=%d V=%f\r\n", il_count, il[il_count].mnemonic, il[il_count].key, il[il_count].keynum, il[il_count].expression, il[il_count].value);
+#endif
                 il_count ++;
                 break;
             }
@@ -412,11 +414,6 @@
 
     fclose(fp);
 
-#ifdef DEBUG
-    for (i = 0; i < il_count; i ++) {
-        printf("M=%d [%c%d] E=%d V=%f\r\n", il[i].mnemonic, il[i].key, il[i].keynum, il[i].expression, il[i].value);
-    }
-#endif
     return 0;
 }