Index: firmware/App/Controllers/DrainPump.c =================================================================== diff -u -r61fc45d7a43557312d6abd00a6b01e6823b44f04 -r6f2991204047ccbceeb5461f7c35af6d8f5dfd0b --- firmware/App/Controllers/DrainPump.c (.../DrainPump.c) (revision 61fc45d7a43557312d6abd00a6b01e6823b44f04) +++ firmware/App/Controllers/DrainPump.c (.../DrainPump.c) (revision 6f2991204047ccbceeb5461f7c35af6d8f5dfd0b) @@ -33,6 +33,7 @@ #include "TaskGeneral.h" #include "TaskPriority.h" #include "Timers.h" +#include "Utilities.h" #include "Valves.h" /** @@ -365,7 +366,7 @@ #endif { #ifndef _RELEASE_ - if ( ( getSoftwareConfigStatus( SW_CONFIG_ENABLE_V3_SYSTEM ) != SW_CONFIG_ENABLE_VALUE ) && ( getCurrentOperationMode() != DG_MODE_INIT ) ) + if ( ( getHardwareConfigStatus() != HW_CONFIG_BETA ) && ( getCurrentOperationMode() != DG_MODE_INIT ) ) #endif { checkFPGAPersistentErrorCountAlarm( FPGA_PERS_ERROR_DRAIN_PUMP_DIR_HALL_SENSOR, dirHallSensorErrorCount ); @@ -388,7 +389,7 @@ } #ifndef _RELEASE_ - if ( ( getSoftwareConfigStatus( SW_CONFIG_ENABLE_V3_SYSTEM ) != SW_CONFIG_ENABLE_VALUE ) && ( getCurrentOperationMode() != DG_MODE_INIT ) ) + if ( ( getHardwareConfigStatus() != HW_CONFIG_BETA ) && ( getCurrentOperationMode() != DG_MODE_INIT ) ) #endif { checkPersistentAlarm( ALARM_ID_DG_DRAIN_PUMP_CURRENT_OUT_OF_RANGE, isOffCurrentOut, currentA, DRAIN_PUMP_MAX_CURRENT_WHEN_OFF_A ); @@ -409,7 +410,7 @@ checkPersistentAlarm( ALARM_ID_DRAIN_PUMP_OFF_FAULT, FALSE, getDrainPumpMeasuredRPM(), MIN_DRAIN_PUMP_RPM ); #ifndef _RELEASE_ - if ( ( getSoftwareConfigStatus( SW_CONFIG_ENABLE_V3_SYSTEM ) != SW_CONFIG_ENABLE_VALUE ) && ( getCurrentOperationMode() != DG_MODE_INIT ) ) + if ( ( getHardwareConfigStatus() != HW_CONFIG_BETA ) && ( getCurrentOperationMode() != DG_MODE_INIT ) ) #endif { checkPersistentAlarm( ALARM_ID_DG_DRAIN_PUMP_DIRECTION_INVALID, isDirInvalid, (F32)direction, DRAIN_PUMP_FORWARD_DIR ); @@ -423,7 +424,7 @@ BOOL isDirInvalid = ( direction != DRAIN_PUMP_FORWARD_DIR ? TRUE : FALSE ); #ifndef _RELEASE_ - if ( ( getSoftwareConfigStatus( SW_CONFIG_ENABLE_V3_SYSTEM ) != SW_CONFIG_ENABLE_VALUE ) && ( getCurrentOperationMode() != DG_MODE_INIT ) ) + if ( ( getHardwareConfigStatus() != HW_CONFIG_BETA ) && ( getCurrentOperationMode() != DG_MODE_INIT ) ) #endif { checkPersistentAlarm( ALARM_ID_DG_DRAIN_PUMP_DIRECTION_INVALID, isDirInvalid, (F32)direction, DRAIN_PUMP_FORWARD_DIR ); @@ -440,7 +441,7 @@ } #ifndef _RELEASE_ - if ( ( getSoftwareConfigStatus( SW_CONFIG_ENABLE_V3_SYSTEM ) != SW_CONFIG_ENABLE_VALUE ) && ( getCurrentOperationMode() != DG_MODE_INIT ) ) + if ( ( getHardwareConfigStatus() != HW_CONFIG_BETA ) && ( getCurrentOperationMode() != DG_MODE_INIT ) ) #endif { // Check the persistent alarm for the maximum drain pump current @@ -493,7 +494,7 @@ drainPumpControlModeSet = drainPumpControlMode; signalNewRPMRequest = TRUE; } - pendingDrainPumpCmdTarget = 0.0; + pendingDrainPumpCmdTarget = 0.0F; pendingDrainPumpCmd = DRAIN_PUMP_OFF_STATE; } } @@ -918,7 +919,7 @@ drainPumpMeasuredRPM.ovData = value; drainPumpMeasuredRPM.override = OVERRIDE_KEY; drainPumpMeasuredRPM.ovInitData = drainPumpMeasuredRPM.data; - status = TRUE; + status = TRUE; } } @@ -942,10 +943,106 @@ { drainPumpMeasuredRPM.ovData = drainPumpMeasuredRPM.ovInitData; drainPumpMeasuredRPM.override = OVERRIDE_RESET; - status = TRUE; + status = TRUE; } return status; } +/*********************************************************************//** + * @brief + * The testSetDrainPumpMeasuredCurrentOverride function overrides the drain pump + * measured current data. + * @details Inputs: none + * @details Outputs: drainPumpMeasuredCurrentA + * @param value override drain pump measured current data + * @return TRUE if override successful, FALSE if not + *************************************************************************/ +BOOL testSetDrainPumpMeasuredCurrentOverride( F32 value ) +{ + BOOL status = FALSE; + + // Check if the user is logged in + if ( TRUE == isTestingActivated() ) + { + drainPumpMeasuredCurrentA.ovData = value; + drainPumpMeasuredCurrentA.override = OVERRIDE_KEY; + drainPumpMeasuredCurrentA.ovInitData = drainPumpMeasuredCurrentA.data; + status = TRUE; + } + + return status; +} + +/*********************************************************************//** + * @brief + * The testResetDrainPumpMeasuredCurrentOverride function resets the drain pump + * measured current data. + * @details Inputs: none + * @details Outputs: drainPumpMeasuredCurrentA + * @return TRUE if override reset successful, FALSE if not + *************************************************************************/ +BOOL testResetDrainPumpMeasuredCurrentOverride( void ) +{ + BOOL status = FALSE; + + // Check if the user is logged in + if ( TRUE == isTestingActivated() ) + { + drainPumpMeasuredCurrentA.ovData = drainPumpMeasuredCurrentA.ovInitData; + drainPumpMeasuredCurrentA.override = OVERRIDE_RESET; + status = TRUE; + } + + return status; +} + +/*********************************************************************//** + * @brief + * The testSetDrainPumpMeasuredDirectionOverride function overrides the drain pump + * measured direction data. + * @details Inputs: none + * @details Outputs: drainPumpMeasuredDir + * @param value override drain pump measured direction data + * @return TRUE if override successful, FALSE if not + *************************************************************************/ +BOOL testSetDrainPumpMeasuredDirectionOverride( U32 value ) +{ + BOOL status = FALSE; + + // Check if the user is logged in + if ( TRUE == isTestingActivated() ) + { + drainPumpMeasuredDir.ovData = value; + drainPumpMeasuredDir.override = OVERRIDE_KEY; + drainPumpMeasuredDir.ovInitData = drainPumpMeasuredDir.data; + status = TRUE; + } + + return status; +} + +/*********************************************************************//** + * @brief + * The testResetDrainPumpMeasuredDirectionOverride function resets the drain pump + * measured direction data. + * @details Inputs: none + * @details Outputs: drainPumpMeasuredDir + * @return TRUE if override reset successful, FALSE if not + *************************************************************************/ +BOOL testResetDrainPumpMeasuredDirectionOverride( void ) +{ + BOOL status = FALSE; + + // Check if the user is logged in + if ( TRUE == isTestingActivated() ) + { + drainPumpMeasuredDir.ovData = drainPumpMeasuredDir.ovInitData; + drainPumpMeasuredDir.override = OVERRIDE_RESET; + status = TRUE; + } + + return status; +} + /**@}*/