CIS441 Controller

Dependencies:   TextLCD mbed-rtos mbed

Fork of PacemakerController by Chad Nachiappan

Revision:
28:5c5552cd472b
Parent:
26:64e2bc7d544a
diff -r 2c5aefcf3000 -r 5c5552cd472b PMTest.cpp
--- a/PMTest.cpp	Wed Dec 02 00:37:37 2015 +0000
+++ b/PMTest.cpp	Wed Dec 02 00:39:54 2015 +0000
@@ -9,10 +9,10 @@
 DigitalIn apace(p22);
 DigitalIn vpace(p21);
 
-Serial pc(USBTX, USBRX);
+Serial serial_in(USBTX, USBRX);
 
 
-int timer_count;
+int test_time_count;
 int curr_test;
 int minwaitV;
 int minwaitA;
@@ -20,7 +20,7 @@
 int needs_num_input = 0;
 
 enum mode{RANDOM,MANUAL,TEST};
-mode curr_mode = RANDOM;
+mode test_curr_mode = RANDOM;
 Timer t;
 
 
@@ -31,7 +31,7 @@
     t.reset();
     t.start();
 
-    while(curr_mode == RANDOM){
+    while(test_curr_mode == RANDOM){
         int r = rand();
 
         if(r%2 == 0){
@@ -56,7 +56,7 @@
 
 
 void kbd_intrp(){
-    char a = pc.getc();
+    char a = serial_in.getc();
 
     if(needs_num_input){
         // DO O handling
@@ -65,20 +65,20 @@
     }
 
     if(a == 'R'){
-        curr_mode = RANDOM;
+        test_curr_mode = RANDOM;
     }else if(a == 'T'){
-        curr_mode = TEST;
+        test_curr_mode = TEST;
     }else if(a == 'M'){
-        curr_mode = MANUAL;
+        test_curr_mode = MANUAL;
     }
     
-    if(a == 'A' && curr_mode == MANUAL){
+    if(a == 'A' && test_curr_mode == MANUAL){
         asense = 1;
         Thread::wait(10);
         asense = 0;
     }
     
-    if(a == 'V' && curr_mode == MANUAL){
+    if(a == 'V' && test_curr_mode == MANUAL){
         vsense = 1;
         Thread::wait(10);
         vsense = 0;