Index: firmware/App/Controllers/DialInFlow.c =================================================================== diff -u -rb61c8330905634762e69ed10fb6614a77552fd54 -r7593a04d1121869dffb536f31c20c57cf571611b --- firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision b61c8330905634762e69ed10fb6614a77552fd54) +++ firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision 7593a04d1121869dffb536f31c20c57cf571611b) @@ -22,6 +22,7 @@ #include "mibspi.h" #include "Battery.h" +#include "CPLD.h" #include "DialInFlow.h" #include "FPGA.h" #include "InternalADC.h" @@ -1441,53 +1442,49 @@ { F32 dipCurr; - // only check current when we have A/C power - if ( getCPLDACPowerLossDetected() != TRUE ) + // DialIn pump should be off + if ( DIAL_IN_PUMP_OFF_STATE == dialInPumpState ) { - // DialIn pump should be off - if ( DIAL_IN_PUMP_OFF_STATE == dialInPumpState ) + dipCurr = fabs( getMeasuredDialInPumpMCCurrent() ); + if ( dipCurr > DIP_MAX_CURR_WHEN_STOPPED_MA ) { - dipCurr = fabs( getMeasuredDialInPumpMCCurrent() ); - if ( dipCurr > DIP_MAX_CURR_WHEN_STOPPED_MA ) + dipCurrErrorDurationCtr += TASK_PRIORITY_INTERVAL; + if ( dipCurrErrorDurationCtr > DIP_MAX_CURR_ERROR_DURATION_MS ) { - dipCurrErrorDurationCtr += TASK_PRIORITY_INTERVAL; - if ( dipCurrErrorDurationCtr > DIP_MAX_CURR_ERROR_DURATION_MS ) - { #ifndef _RELEASE_ - if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_MOTOR_CURRNT_CHECKS ) != SW_CONFIG_ENABLE_VALUE ) + if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_MOTOR_CURRNT_CHECKS ) != SW_CONFIG_ENABLE_VALUE ) #endif - { - SET_ALARM_WITH_1_F32_DATA( ALARM_ID_HD_DIAL_IN_PUMP_MC_CURRENT_CHECK, getMeasuredDialInPumpMCCurrent() ); - } + { + SET_ALARM_WITH_1_F32_DATA( ALARM_ID_HD_DIAL_IN_PUMP_MC_CURRENT_CHECK, getMeasuredDialInPumpMCCurrent() ); } } - else - { - dipCurrErrorDurationCtr = 0; - } } - // DialIn pump should be running else { - dipCurr = fabs( getMeasuredDialInPumpMCCurrent() ); - if ( dipCurr > DIP_MAX_CURR_WHEN_RUNNING_MA ) + dipCurrErrorDurationCtr = 0; + } + } + // DialIn pump should be running + else + { + dipCurr = fabs( getMeasuredDialInPumpMCCurrent() ); + if ( dipCurr > DIP_MAX_CURR_WHEN_RUNNING_MA ) + { + dipCurrErrorDurationCtr += TASK_PRIORITY_INTERVAL; + if ( dipCurrErrorDurationCtr > DIP_MAX_CURR_ERROR_DURATION_MS ) { - dipCurrErrorDurationCtr += TASK_PRIORITY_INTERVAL; - if ( dipCurrErrorDurationCtr > DIP_MAX_CURR_ERROR_DURATION_MS ) +#ifndef _RELEASE_ + if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_MOTOR_CURRNT_CHECKS ) != SW_CONFIG_ENABLE_VALUE ) +#endif { - #ifndef _RELEASE_ - if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_MOTOR_CURRNT_CHECKS ) != SW_CONFIG_ENABLE_VALUE ) - #endif - { - SET_ALARM_WITH_1_F32_DATA( ALARM_ID_HD_DIAL_IN_PUMP_MC_CURRENT_CHECK, getMeasuredDialInPumpMCCurrent() ); - } + SET_ALARM_WITH_1_F32_DATA( ALARM_ID_HD_DIAL_IN_PUMP_MC_CURRENT_CHECK, getMeasuredDialInPumpMCCurrent() ); } } - else - { - dipCurrErrorDurationCtr = 0; - } } + else + { + dipCurrErrorDurationCtr = 0; + } } }