Index: firmware/App/Controllers/ConductivitySensors.c =================================================================== diff -u -r0c296cef29037819be204c45a23d4d38a52b2718 -rd19c1bf780832d5c4617a9038bd87ec8f49136ee --- firmware/App/Controllers/ConductivitySensors.c (.../ConductivitySensors.c) (revision 0c296cef29037819be204c45a23d4d38a52b2718) +++ firmware/App/Controllers/ConductivitySensors.c (.../ConductivitySensors.c) (revision d19c1bf780832d5c4617a9038bd87ec8f49136ee) @@ -56,6 +56,7 @@ #define MAX_CONDUCTIVITY_SENSOR_FAILURE_WINDOW_MS ( 60 * MS_PER_SECOND ) ///< Conductivity sensor error window. #define RO_REJECTION_RATIO_OUT_OF_RANGE_VALUE 1.0F ///< Out of range value for RO rejection ratio when CPi conductivity is zero. + #define MAX_RO_REJECTION_RATIO_ALLOW 0.10F ///< Maximum RO rejection ratio. #define MAX_CPO_CONDUCTIVITY_ALLOW 30.0F ///< Maximum CPo sensor conductivity value. @@ -277,11 +278,9 @@ /*********************************************************************//** * @brief * The checkInletWaterConductivity function checks inlet water conductivity value - * and triggers an alarm when conductivity value is not within the specified - * values. + * and triggers an alarm when conductivity value is out of allowed range. * @details Inputs: CPi sensor conductivity - * @details Outputs: Trigger warning alarm if conductivity is in the warning - * range. Trigger alarm if conductivity is below minimum conductivity. + * @details Outputs: Trigger alarms when conductivity is out of allowed range * @return none *************************************************************************/ void checkInletWaterConductivity( void ) Index: firmware/App/Controllers/Heaters.c =================================================================== diff -u -r0c296cef29037819be204c45a23d4d38a52b2718 -rd19c1bf780832d5c4617a9038bd87ec8f49136ee --- firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision 0c296cef29037819be204c45a23d4d38a52b2718) +++ firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision d19c1bf780832d5c4617a9038bd87ec8f49136ee) @@ -31,7 +31,6 @@ #include "OperationModes.h" #include "PersistentAlarm.h" #include "Reservoirs.h" -#include "ROPump.h" #include "SafetyShutdown.h" #include "SystemCommMessages.h" #include "TaskGeneral.h" @@ -177,6 +176,7 @@ if( heater < NUM_OF_DG_HEATERS ) { +#ifndef DISABLE_HEATERS_AND_TEMPS // Assume the target temperature has not changed heatersStatus[ heater ].hasTargetTempChanged = FALSE; @@ -187,6 +187,7 @@ heatersStatus[ heater ].hasTargetTempChanged = TRUE; result = TRUE; } +#endif } else { @@ -220,6 +221,7 @@ { BOOL status = FALSE; + if( heater < NUM_OF_DG_HEATERS ) { if ( HEATER_EXEC_STATE_OFF == heatersStatus[ heater ].state ) Index: firmware/App/Controllers/LoadCell.c =================================================================== diff -u -r0c296cef29037819be204c45a23d4d38a52b2718 -rd19c1bf780832d5c4617a9038bd87ec8f49136ee --- firmware/App/Controllers/LoadCell.c (.../LoadCell.c) (revision 0c296cef29037819be204c45a23d4d38a52b2718) +++ firmware/App/Controllers/LoadCell.c (.../LoadCell.c) (revision d19c1bf780832d5c4617a9038bd87ec8f49136ee) @@ -97,7 +97,7 @@ * @details Outputs: LoadCell module initialized. * @return none *************************************************************************/ - void initLoadCell( void ) +void initLoadCell( void ) { U32 i; U32 j; Index: firmware/App/Controllers/Pressures.c =================================================================== diff -u -r0c296cef29037819be204c45a23d4d38a52b2718 -rd19c1bf780832d5c4617a9038bd87ec8f49136ee --- firmware/App/Controllers/Pressures.c (.../Pressures.c) (revision 0c296cef29037819be204c45a23d4d38a52b2718) +++ firmware/App/Controllers/Pressures.c (.../Pressures.c) (revision d19c1bf780832d5c4617a9038bd87ec8f49136ee) @@ -37,8 +37,8 @@ // ********** private definitions ********** -#define PUMP_PRESSURE_ZERO 777 ///< ADC counts equivalent to 0 PSI for pump in/out pressure sensors. -#define PUMP_PRESSURE_PSIA_PER_COUNT 0.06434F ///< PSIA per ADC count conversion factor for pump in/out pressure sensors. +#define PUMP_PRESSURE_ZERO 759 ///< ADC counts equivalent to 0 PSI for pump in/out pressure sensors. +#define PUMP_PRESSURE_PSIA_PER_COUNT 0.06583F ///< PSIA per ADC count conversion factor for pump in/out pressure sensors. #define PUMP_PRESSURE_PSIA_TO_PSI_OFFSET 14.7F ///< Subtract this offset to convert PSIA to PSI. #define ONE_BAR_TO_PSI_CONVERSION 14.5F ///< 1 bar to PSI conversion. #define ONE_BAR_TO_MILLI_BAR 1000 ///< 1 bar to milli bar conversion. Index: firmware/App/Controllers/ROPump.h =================================================================== diff -u -r0c296cef29037819be204c45a23d4d38a52b2718 -rd19c1bf780832d5c4617a9038bd87ec8f49136ee --- firmware/App/Controllers/ROPump.h (.../ROPump.h) (revision 0c296cef29037819be204c45a23d4d38a52b2718) +++ firmware/App/Controllers/ROPump.h (.../ROPump.h) (revision d19c1bf780832d5c4617a9038bd87ec8f49136ee) @@ -22,7 +22,7 @@ /** * @defgroup ROPump ROPump - * @brief RO Pump monitor and controller module. Controls and monitors the RO pump. + * @brief RO Pump monitor and controller module. Controls and monitors the RO pump and the flow meter. * The flow meter is manufactured by SwissFlow, PN: 82015311. * The diaphragm (RO) pump is manufactured by Aquatec, PN: 5889-2MM1-V724DY. * Index: firmware/App/Controllers/Switches.c =================================================================== diff -u -r0c296cef29037819be204c45a23d4d38a52b2718 -rd19c1bf780832d5c4617a9038bd87ec8f49136ee --- firmware/App/Controllers/Switches.c (.../Switches.c) (revision 0c296cef29037819be204c45a23d4d38a52b2718) +++ firmware/App/Controllers/Switches.c (.../Switches.c) (revision d19c1bf780832d5c4617a9038bd87ec8f49136ee) @@ -93,11 +93,11 @@ switch ( i ) { case CONCENTRATE_CAP: - currentSwitchStatus = ( getFPGAConcentrateCapStatus() != 0 ? STATE_OPEN : STATE_CLOSED ); + currentSwitchStatus = getFPGAConcentrateCapStatus(); break; case DIALYSATE_CAP: - currentSwitchStatus = ( getFPGADialysateCapStatus() != 0 ? STATE_OPEN : STATE_CLOSED ); + currentSwitchStatus = getFPGADialysateCapStatus(); break; #ifndef _VECTORCAST_ Index: firmware/App/Controllers/TemperatureSensors.c =================================================================== diff -u -r0c296cef29037819be204c45a23d4d38a52b2718 -rd19c1bf780832d5c4617a9038bd87ec8f49136ee --- firmware/App/Controllers/TemperatureSensors.c (.../TemperatureSensors.c) (revision 0c296cef29037819be204c45a23d4d38a52b2718) +++ firmware/App/Controllers/TemperatureSensors.c (.../TemperatureSensors.c) (revision d19c1bf780832d5c4617a9038bd87ec8f49136ee) @@ -466,14 +466,33 @@ // the electrical connection of THd sensor. if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_ENABLE_V3_SYSTEM ) ) { - if ( ( TEMPSENSORS_HEAT_DISINFECT == sensorIndex ) || ( TEMPSENSORS_INTERNAL_THD_RTD == sensorIndex ) ) + if ( TEMPSENSORS_HEAT_DISINFECT == sensorIndex ) { - temperature = getF32OverrideValue( &tempSensors[ TEMPSENSORS_OUTLET_REDUNDANT ].temperatureValues ); + if ( OVERRIDE_KEY == tempSensors[ TEMPSENSORS_HEAT_DISINFECT ].temperatureValues.override ) + { + temperature = getF32OverrideValue( &tempSensors[ TEMPSENSORS_HEAT_DISINFECT ].temperatureValues ); + } + else + { + temperature = getF32OverrideValue( &tempSensors[ TEMPSENSORS_OUTLET_REDUNDANT ].temperatureValues ); + } } + if ( TEMPSENSORS_INTERNAL_THD_RTD == sensorIndex ) + { + temperature = 40.0F; + } + if ( TEMPSENSORS_OUTLET_REDUNDANT == sensorIndex ) { - temperature = getF32OverrideValue( &tempSensors[ TEMPSENSORS_INLET_DIALYSATE ].temperatureValues ); + if ( OVERRIDE_KEY == tempSensors[ TEMPSENSORS_OUTLET_REDUNDANT ].temperatureValues.override ) + { + temperature = getF32OverrideValue( &tempSensors[ TEMPSENSORS_OUTLET_REDUNDANT ].temperatureValues ); + } + else + { + temperature = getF32OverrideValue( &tempSensors[ TEMPSENSORS_INLET_DIALYSATE ].temperatureValues ); + } } } #endif Index: firmware/App/DGCommon.h =================================================================== diff -u -r0475bfb3ff0ec63ed8edabd3e6672a88acea7edd -rd19c1bf780832d5c4617a9038bd87ec8f49136ee --- firmware/App/DGCommon.h (.../DGCommon.h) (revision 0475bfb3ff0ec63ed8edabd3e6672a88acea7edd) +++ firmware/App/DGCommon.h (.../DGCommon.h) (revision d19c1bf780832d5c4617a9038bd87ec8f49136ee) @@ -25,7 +25,7 @@ #define DG_VERSION_MAJOR 0 #define DG_VERSION_MINOR 6 #define DG_VERSION_MICRO 0 -#define DG_VERSION_BUILD 35 +#define DG_VERSION_BUILD 249 // ********** build switches ********** Index: firmware/App/Modes/ModeHeatDisinfect.c =================================================================== diff -u -r0c296cef29037819be204c45a23d4d38a52b2718 -rd19c1bf780832d5c4617a9038bd87ec8f49136ee --- firmware/App/Modes/ModeHeatDisinfect.c (.../ModeHeatDisinfect.c) (revision 0c296cef29037819be204c45a23d4d38a52b2718) +++ firmware/App/Modes/ModeHeatDisinfect.c (.../ModeHeatDisinfect.c) (revision d19c1bf780832d5c4617a9038bd87ec8f49136ee) @@ -62,7 +62,7 @@ // Flush drain path state defines #define FLUSH_DRAIN_WAIT_TIME_MS ( SEC_PER_MIN * MS_PER_SECOND ) ///< Flush Drain path wait time in milliseconds. -#define MIN_INLET_TEMPERATURE_C 15.0F ///< Minimum water inlet temperature in C. TODO original temperature was 25 C +#define MIN_INLET_TEMPERATURE_C 25.0F ///< Minimum water inlet temperature in C. #define MAX_INLET_CONDUCTIVITY_US_PER_CM 2000.0F ///< Maximum water inlet conductivity in us/cm // Flush circulation path state defines @@ -80,7 +80,7 @@ #define RSRVRS_PARTIAL_FILL_VOL_ML 500.0F ///< Reservoirs 1 & 2 partial volume in mL. #define RSRVRS_FULL_STABLE_TIME_COUNT ( ( 4 * MS_PER_SECOND ) / TASK_GENERAL_INTERVAL ) ///< Reservoirs 1 & 2 full stable time in counts. #define RSRVRS_FILL_UP_TIMEOUT_MS ( 5 * SEC_PER_MIN * MS_PER_SECOND ) ///< Reservoirs 1 & 2 full fill up timeout in ms. TODO original value was 5 mins -#define RSRVRS_500ML_FILL_UP_TIMEOUT_MS ( 4 * SEC_PER_MIN * MS_PER_SECOND ) ///< Reservoirs 1 & 2 partial fill up timeout in ms. TODO original value was 2 mins +#define RSRVRS_500ML_FILL_UP_TIMEOUT_MS ( 2 * SEC_PER_MIN * MS_PER_SECOND ) ///< Reservoirs 1 & 2 partial fill up timeout in ms. #define RSRVRS_DRAIN_TIMEOUT_MS ( 2 * SEC_PER_MIN * MS_PER_SECOND ) ///< Reservoirs 1 & 2 drain timeout in ms. // Fill and heat water @@ -93,7 +93,7 @@ #define HEAT_DISINFECT_TARGET_DRAIN_PRES_PSI 12.0F ///< Heat disinfect target drain outlet pressure in psi. #define HEAT_DISINFECT_TIME_MS ( 10 * SEC_PER_MIN * MS_PER_SECOND ) ///< Heat disinfect time for each section in milliseconds. #define HEAT_DISINFECT_START_TEMP_TIMOUT_MS ( 4 * MIN_PER_HOUR * SEC_PER_MIN * MS_PER_SECOND ) ///< Heat disinfect reaching to minimum temperature timeout in milliseconds. -#define RSRVRS_TARGET_VOL_OUT_TIMEOUT_MS ( 0.5F * SEC_PER_MIN * MS_PER_SECOND ) ///< Reservoirs 1 & 2 maximum volume out of range timeout during heat disinfect. TODO change this to 5 seconds +#define RSRVRS_TARGET_VOL_OUT_TIMEOUT_MS ( 10 * MS_PER_SECOND ) ///< Reservoirs 1 & 2 maximum volume out of range timeout during heat disinfect. #define RSRVRS_MAX_TARGET_VOL_CHANGE_ML 100.0F ///< Reservoirs 1 & 2 maximum allowed volume change when full during heat disinfect. #define POST_HEAT_DISINFECT_WAIT_TIME_MS ( 3 * SEC_PER_MIN * MS_PER_SECOND ) ///< Heat disinfect final wait time before flushing the system in milliseconds. #define HEAT_DISINFECT_MAX_TEMP_GRADIENT_C 15.0F ///< Heat disinfect maximum allowed temperature gradient in between hottest and coldest sensors. @@ -637,7 +637,7 @@ BOOL hasConductivityPassed = FALSE; // If the inlet temperature and conductivity are in range, move onto the next state - if ( ( getTemperatureValue( TEMPSENSORS_INLET_PRIMARY_HEATER ) > MIN_INLET_TEMPERATURE_C ) && + if ( ( getTemperatureValue( TEMPSENSORS_INLET_PRIMARY_HEATER ) >= MIN_INLET_TEMPERATURE_C ) && ( getConductivityValue( CONDUCTIVITYSENSORS_CPI_SENSOR ) <= MAX_INLET_CONDUCTIVITY_US_PER_CM ) ) { hasConductivityPassed = TRUE; @@ -1860,10 +1860,20 @@ { if ( ++rsrvrFillStableTimeCounter >= RSRVRS_FULL_STABLE_TIME_COUNT ) { - status = DG_RESERVOIR_REACHED_TARGET; + status = DG_RESERVOIR_REACHED_TARGET; rsrvrFillStableTimeCounter = 0; // Set the state timer in case it needs to be used for another timeout check - stateTimer = getMSTimerCount(); + if ( ( DG_HEAT_DISINFECT_STATE_FLUSH_R2_AND_DRAIN_R1 == heatDisinfectState) && ( DG_RESERVOIR_2 == reservoir ) ) + { + if ( rsrvr1Status == DG_RESERVOIR_REACHED_TARGET ) + { + stateTimer = getMSTimerCount(); + } + } + else + { + stateTimer = getMSTimerCount(); + } } } else if ( TRUE == didTimeout( stateTimer, timeout ) ) @@ -1906,8 +1916,18 @@ if ( TRUE == isDrainComplete ) { - // Set the state timer in case it needs to be used for another timeout check - stateTimer = getMSTimerCount(); + if ( ( DG_HEAT_DISINFECT_STATE_FLUSH_R2_AND_DRAIN_R1 == heatDisinfectState) && ( DG_RESERVOIR_1 == r) ) + { + if ( ( DG_RESERVOIR_REACHED_TARGET == rsrvr2Status) && ( 0 == getDrainPumpTargetRPM() ) ) + { + stateTimer = getMSTimerCount(); + } + } + else + { + stateTimer = getMSTimerCount(); + } + haveDrainParamsBeenInit[ r ] = FALSE; status = DG_RESERVOIR_REACHED_TARGET; } @@ -1948,11 +1968,11 @@ // Check if the temperature gradient in between the coldest and the hottest spot is more than the specified temperature and // the timer has not started yet, start it - if ( ( TPoTemp - ThdTemp > HEAT_DISINFECT_MAX_TEMP_GRADIENT_C ) && ( 0 == tempGradOutOfRangeTimer ) ) + if ( ( fabs( TPoTemp - ThdTemp ) > HEAT_DISINFECT_MAX_TEMP_GRADIENT_C ) && ( 0 == tempGradOutOfRangeTimer ) ) { tempGradOutOfRangeTimer = getMSTimerCount(); } - else if ( ( TPoTemp - ThdTemp > HEAT_DISINFECT_MAX_TEMP_GRADIENT_C ) && + else if ( ( fabs( TPoTemp - ThdTemp ) > HEAT_DISINFECT_MAX_TEMP_GRADIENT_C ) && ( TRUE == didTimeout( tempGradOutOfRangeTimer, HEAT_DISINFECT_TEMP_GRAD_OUT_RANGE_TIME_MS ) ) ) { alarmDetectedPendingTrigger = ALARM_ID_DG_HEAT_DISINFECT_TEMP_GRAD_OUT_OF_RANAGE; Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -r0c296cef29037819be204c45a23d4d38a52b2718 -rd19c1bf780832d5c4617a9038bd87ec8f49136ee --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 0c296cef29037819be204c45a23d4d38a52b2718) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision d19c1bf780832d5c4617a9038bd87ec8f49136ee) @@ -312,15 +312,15 @@ { DG_POST_STATE_T result = postState; - if ( ( SELF_TEST_STATUS_PASSED == testStatus ) || ( SELF_TEST_STATUS_FAILED == testStatus ) ) + if ( ( testStatus == SELF_TEST_STATUS_PASSED ) || ( testStatus == SELF_TEST_STATUS_FAILED ) ) { - BOOL passed = ( SELF_TEST_STATUS_PASSED == testStatus ? TRUE : FALSE ); + BOOL passed = ( testStatus == SELF_TEST_STATUS_PASSED ? TRUE : FALSE ); // Broadcast passed POST result sendPOSTTestResult( (DG_POST_STATE_T)((int)postState), passed ); // Move on to next POST test result = (DG_POST_STATE_T)((int)postState + 1); - if ( SELF_TEST_STATUS_FAILED == testStatus ) + if ( testStatus == SELF_TEST_STATUS_FAILED ) { tempPOSTPassed = FALSE; } Index: firmware/App/Modes/OperationModes.c =================================================================== diff -u -r0c296cef29037819be204c45a23d4d38a52b2718 -rd19c1bf780832d5c4617a9038bd87ec8f49136ee --- firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 0c296cef29037819be204c45a23d4d38a52b2718) +++ firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision d19c1bf780832d5c4617a9038bd87ec8f49136ee) @@ -131,7 +131,6 @@ void execOperationModes( void ) { DG_OP_MODE_T newMode; - U32 priorSubMode = currentSubMode; priorSubMode = currentSubMode; @@ -150,7 +149,6 @@ if ( currentMode != newMode ) { // handle transition to new mode - priorSubMode = 0; lastMode = currentMode; transitionToNewOperationMode( newMode ); currentMode = newMode; Index: firmware/App/Services/AlarmMgmtSWFaults.h =================================================================== diff -u -r0c296cef29037819be204c45a23d4d38a52b2718 -rd19c1bf780832d5c4617a9038bd87ec8f49136ee --- firmware/App/Services/AlarmMgmtSWFaults.h (.../AlarmMgmtSWFaults.h) (revision 0c296cef29037819be204c45a23d4d38a52b2718) +++ firmware/App/Services/AlarmMgmtSWFaults.h (.../AlarmMgmtSWFaults.h) (revision d19c1bf780832d5c4617a9038bd87ec8f49136ee) @@ -85,8 +85,8 @@ SW_FAULT_ID_PERSISTENT_ALARM_INVALID_INDEX, SW_FAULT_ID_CONCENTRATE_PUMP_EXEC_INVALID_STATE, // 55 SW_FAULT_ID_CONCENTRATE_PUMP_INVALID_PUMP_ID, - SW_FAULT_ID_SEMAPHORE_IN_USE_TIMEOUT, SW_FAULT_ID_SERVICE_MODE_INVALID_EXEC_STATE, + SW_FAULT_ID_SEMAPHORE_IN_USE_TIMEOUT, SW_FAULT_ID_UV_REACTORS_INVALID_EXEC_STATE, SW_FAULT_ID_UV_REACTORS_INVALID_SELF_TEST_STATE, SW_FAULT_ID_THERMISTORS_INVALID_EXEC_STATE, // 60 Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -r7eb83ebaf0db7cfef5d055ae0277b50e474ab016 -rd19c1bf780832d5c4617a9038bd87ec8f49136ee --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 7eb83ebaf0db7cfef5d055ae0277b50e474ab016) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision d19c1bf780832d5c4617a9038bd87ec8f49136ee) @@ -893,12 +893,17 @@ handleDGSendConcentrateMixingRatios( message ); break; + + case MSG_ID_HD_REQUEST_DG_SERVICE_MODE: + handleServiceModeRequest( message ); + break; + case MSG_ID_HD_REQUEST_DG_USAGE_INFO: handleHDRequestDGUsageInfo( message ); break; - case MSG_ID_HD_REQUEST_DG_SERVICE_MODE: - handleServiceModeRequest( message ); + case MSG_ID_DG_CPLD_STATUS: + handleCpldStatusRequest( message ); break; // NOTE: This case must be last @@ -1125,11 +1130,11 @@ break; case MSG_ID_FILTER_FLUSH_TIME_PERIOD_OVERRIDE: - handleFilterFlushTimePeriodOverride( message ); + handleFilterFlushTimePeriodOverride(message); break; - case MSG_ID_DG_FANS_RPM_OVERRIDE: - handleFansRPMOverride( message ); + case MSG_ID_DG_BLOCK_MESSAGE_TRANSMISSION: + handleTestBlockMessagesRequest( message ); break; case MSG_ID_DG_STOP_RTC_CLOCK: @@ -1140,10 +1145,6 @@ handleSetDrainPumpMeasuredRPMOverrideRequest( message ); break; - case MSG_ID_DG_BLOCK_MESSAGE_TRANSMISSION: - handleTestBlockMessagesRequest( message ); - break; - case MSG_ID_DG_SUPER_CLEAR_ALARMS_CMD: handleTestSuperClearAlarmsRequest( message ); break; @@ -1156,6 +1157,10 @@ handleTestFansRPMAlarmStartTimeOffsetRequest( message ); break; + case MSG_ID_DG_FANS_RPM_OVERRIDE: + handleFansRPMOverride( message ); + break; + case MSG_ID_DG_USED_ACID_VOLUME_ML_OVERRIDE: handleTestUsedAcidVolumeMLOverrideRequest( message ); break; @@ -1192,18 +1197,19 @@ handleSetDGUsageInfoRecord( message ); break; - case MSG_ID_HD_REQUEST_DG_ALARMS: - handleResendAllAlarmsCommand( message ); - break; - case MSG_ID_DG_SET_OP_MODE_REQUEST: handleTestSetOpModeRequest( message ); break; case MSG_ID_DG_RESERVOIR_TARE_REQUEST: handleTestTareReservoirRequest( message ); + break; + case MSG_ID_HD_REQUEST_DG_ALARMS: + handleResendAllAlarmsCommand( message ); + break; + default: // TODO - unrecognized message ID received - ignore break; Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r7eb83ebaf0db7cfef5d055ae0277b50e474ab016 -rd19c1bf780832d5c4617a9038bd87ec8f49136ee --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 7eb83ebaf0db7cfef5d055ae0277b50e474ab016) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision d19c1bf780832d5c4617a9038bd87ec8f49136ee) @@ -23,6 +23,7 @@ #include "Compatible.h" #include "ConcentratePumps.h" #include "ConductivitySensors.h" +#include "CPLD.h" #include "Fans.h" #include "FlowSensors.h" #include "FPGA.h" @@ -368,7 +369,6 @@ return result; } - // *********************************************************************** // **************** Message Handling Helper Functions ******************** // *********************************************************************** @@ -3147,37 +3147,6 @@ } /*********************************************************************//** - * @brief - * The handleFansRPMOverride function handles a request to override a fans RPM value. - * @details Inputs: none - * @details Outputs: message handled - * @param message a pointer to the message to handle - * @return none - *************************************************************************/ -void handleFansRPMOverride( MESSAGE_T *message ) -{ - TEST_OVERRIDE_ARRAY_PAYLOAD_T payload; - BOOL result = FALSE; - - // verify payload length - if ( sizeof(TEST_OVERRIDE_ARRAY_PAYLOAD_T) == message->hdr.payloadLen ) - { - memcpy( &payload, message->payload, sizeof(TEST_OVERRIDE_ARRAY_PAYLOAD_T) ); - if ( FALSE == payload.reset ) - { - result = testSetFanRPMOverride( payload.index, payload.state.f32 ); - } - else - { - result = testResetFanRPMOverride( payload.index ); - } - } - - // respond to request - sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); -} - -/*********************************************************************//** * @brief * The handleStopDGRTCClock function handles a request to stop the RTC clock. * @details Inputs: none @@ -3316,10 +3285,41 @@ /*********************************************************************//** * @brief - * The handleTestFansRPMAlarmStartTimeOffsetRequest function handles a - * request to set the fans RPM alarm start time offset. + * The handleFansRPMOverride function handles a request to override a fans RPM value. * @details Inputs: none * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleFansRPMOverride( MESSAGE_T *message ) +{ + TEST_OVERRIDE_ARRAY_PAYLOAD_T payload; + BOOL result = FALSE; + + // verify payload length + if ( sizeof(TEST_OVERRIDE_ARRAY_PAYLOAD_T) == message->hdr.payloadLen ) + { + memcpy( &payload, message->payload, sizeof(TEST_OVERRIDE_ARRAY_PAYLOAD_T) ); + if ( FALSE == payload.reset ) + { + result = testSetFanRPMOverride( payload.index, payload.state.f32 ); + } + else + { + result = testResetFanRPMOverride( payload.index ); + } + } + + // respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** + * @brief + * The handleTestFansRPMAlarmStartTimeOverrideRequest function handles a + * request to override the fan RPM alarm start time. + * @details Inputs: none + * @details Outputs: message handled * @param message : a pointer to the message to handle * @return none *************************************************************************/ @@ -3342,7 +3342,6 @@ } /*********************************************************************//** - * @brief * The handleTestUsedAcidVolumeMLOverrideRequest function handles a * request to override the acid volume. * @details Inputs: none @@ -3668,30 +3667,6 @@ /*********************************************************************//** * @brief -* The handleResendAllAlarmsCommand function handles a request to re-send -* all active DG alarms. -* @details Inputs: none -* @details Outputs: message handled -* @param message a pointer to the message to handle -* @return none -*************************************************************************/ -void handleResendAllAlarmsCommand( MESSAGE_T *message ) -{ - BOOL result = FALSE; - - // verify payload length - if ( 0 == message->hdr.payloadLen ) - { - handleResendActiveAlarmsRequest(); - result = TRUE; - } - - // respond to request - sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); -} - -/*********************************************************************//** -* @brief * The handleServiceModeRequest function handles a request to enter service * mode. * @details Inputs: none @@ -3759,4 +3734,59 @@ return result; } +/*********************************************************************//** + * @brief + * The handleResendAllAlarmsCommand function handles a request to re-send + * all active DG alarms. + * The sendUIServiceModeResponse function sends out the DG response to a + * UI request to go to service mode. + * @details Inputs: none + * @details Outputs: Service mode request response msg constructed and queued + * @param accepted TRUE if request was accepted, FALSE if not + * @param rejCode Reject reason code explaining why request was rejected + * @return none + *************************************************************************/ +void handleResendAllAlarmsCommand( MESSAGE_T *message ) +{ + BOOL result = FALSE; + + // verify payload length + if ( 0 == message->hdr.payloadLen ) + { + handleResendActiveAlarmsRequest(); + result = TRUE; + } + + // respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** + * @brief + * The handleCpldStatusRequest function handles a CPLD Status request message. + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleCpldStatusRequest( MESSAGE_T *message ) +{ + MESSAGE_T msg; + CPLD_STATUS_T payload; + U08 *payloadPtr = msg.payload; + + // populate payload + getCPLDStatus( &payload ); + // create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_DG_CPLD_STATUS; + msg.hdr.payloadLen = sizeof( CPLD_STATUS_T ); + + // fill message payload + memcpy( payloadPtr, &payload, sizeof( CPLD_STATUS_T ) ); + + // serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer + serializeMessage( msg, COMM_BUFFER_OUT_CAN_DG_BROADCAST, ACK_NOT_REQUIRED ); +} + /**@}*/ Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -r7eb83ebaf0db7cfef5d055ae0277b50e474ab016 -rd19c1bf780832d5c4617a9038bd87ec8f49136ee --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 7eb83ebaf0db7cfef5d055ae0277b50e474ab016) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision d19c1bf780832d5c4617a9038bd87ec8f49136ee) @@ -163,6 +163,15 @@ // MSG_ID_DG_RESPONSE_SERVICE_MODE_REQUEST BOOL sendServiceModeResponse( BOOL accepted, U32 rejCode ); +// MSG_ID_HD_OP_MODE +BOOL handleSetHDOperationMode( MESSAGE_T *message ); + +// MSG_ID_HD_REQUEST_DG_USAGE_INFO +void handleHDRequestDGUsageInfo( MESSAGE_T * message ); + +// MSG_ID_REQUEST_CPLD_STATUS +void handleCpldStatusRequest( MESSAGE_T *message ); + // *********** public test support message functions ********** // MSG_TESTER_LOG_IN @@ -361,6 +370,12 @@ // MSG_ID_DG_DRAIN_PUMP_MEASURED_RPM_OVERRIDE void handleSetDrainPumpMeasuredRPMOverrideRequest( MESSAGE_T *message ); +// MSG_ID_DG_ALARM_INFO_SEND_INTERVAL_OVERRIDE +void handleTestAlarmInfoSendIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_DG_SUPER_CLEAR_ALARMS_CMD +void handleTestSuperClearAlarmsRequest( MESSAGE_T *message ); + // MSG_ID_DG_SET_FANS_RPM_ALARM_START_TIME_OFFSET void handleTestFansRPMAlarmStartTimeOffsetRequest( MESSAGE_T *message ); @@ -385,15 +400,18 @@ // MSG_ID_DG_SET_PRIMARY_AND_TRIMMER_HEATERS_TARGET_TEMP void handleSetPrimaryAndTrimmerHeatersTargetTemperature( MESSAGE_T *message ); +// MSG_ID_DG_USED_ACID_VOLUME_ML_OVERRIDE +void handleTestUsedAcidVolumeMLOverrideRequest(MESSAGE_T *message); + +// MSG_ID_DG_USED_BICARB_VOLUME_ML_OVERRIDE +void handleTestUsedBicarbVolumeMLOverrideRequest(MESSAGE_T *message); + // MSG_ID_DG_GET_USAGE_INFO_RECORD void handleGetDGUsageInfoRecord( MESSAGE_T *message ); // MSG_ID_DG_SET_USAGE_INFO_RECORD void handleSetDGUsageInfoRecord( MESSAGE_T *message ); -// MSG_ID_HD_REQUEST_DG_ALARMS -void handleResendAllAlarmsCommand( MESSAGE_T *message ); - // MSG_ID_DG_SET_OP_MODE_REQUEST void handleTestSetOpModeRequest( MESSAGE_T *message ); @@ -403,6 +421,9 @@ // MSG_ID_HD_OP_MODE BOOL handleSetHDOperationMode( MESSAGE_T *message ); +// MSG_ID_HD_REQUEST_DG_ALARMS +void handleResendAllAlarmsCommand( MESSAGE_T *message ); + /**@}*/ #endif