SmartCharge / Mbed 2 deprecated 2017charger_16ampONLY

Dependencies:   Watchdog mbed

Revision:
4:41573ae73f98
Parent:
3:bd056c7b3498
Child:
5:3298063f12fe
--- a/main.cpp	Wed Feb 01 13:30:36 2017 +0000
+++ b/main.cpp	Mon Feb 06 12:16:17 2017 +0000
@@ -228,12 +228,9 @@
     
     // If the measured cp voltage is within a range of +/- ACCEPTABLE_VOLTAGE_RANGE around the 
     // value (12V, 9V, 6V) then we change the flag state to true.
-    if (cp_voltage < (v + ACCEPTABLE_VOLTAGE_RANGE) && cp_voltage > (v - ACCEPTABLE_VOLTAGE_RANGE))
-    {
-        voltage_in_range = true;
-        return voltage_in_range;
-    }
-    else{ return PILOT_NOK;}                                    // The function then returns the value of the flag state.
+    if (cp_voltage < (v + ACCEPTABLE_VOLTAGE_RANGE) && cp_voltage > (v - ACCEPTABLE_VOLTAGE_RANGE)) voltage_in_range = true;
+    
+    return voltage_in_range;                                    // The function then returns the value of the flag state.
 }
 
 
@@ -288,7 +285,7 @@
             if (cp_check_voltage(9) == true) control_pilot = PILOT_9V;
             if (cp_check_voltage(6) == true) control_pilot = PILOT_6V;
             if (reset_charger == true) control_pilot = PILOT_RESET;
-            //if (cp_check_voltage(9) == false && cp_check_voltage(6) == false && cp_check_voltage(12) == false && reset_charger == false )control_pilot = PILOT_NOK;   // voltage not at expected values, error accured
+//            if (out of range) control_pilot = PILOT_NOK;        // voltage not at expected values, error accured
         }
        
 // ************************************************************
@@ -369,8 +366,7 @@
                 pc.printf("PWM duty cycle is at: ------------------------------------------- %.1f  %% \r\n", 100-pwm_duty_cycle*100);
                 pc.printf("Charger in STATE:------------------------------------------------ C. \r\n");
                 pc.printf("PILOT_6V - Pilot at 6 V. \r\n");
-//              TESTCOUNTER+=1;
-//              * TESTCOUNTER switched of
+//              TESTCOUNTER+=1;                                 //              * TESTCOUNTER switched of
                 pc.printf("TESTCOUNTER timer:----------------------------------- %u seconds  \r\n", TESTCOUNTER);
                 stateB_COUNTER = 0;
                 pc.printf("stateB_COUNTER timer:-------------------------------- %u seconds  \r\n", stateB_COUNTER);