Index: firmware/App/Controllers/ConcentratePumps.c =================================================================== diff -u -r6f2991204047ccbceeb5461f7c35af6d8f5dfd0b -r470f647e29c8c4451b3576afcf21b896badc5f8f --- firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision 6f2991204047ccbceeb5461f7c35af6d8f5dfd0b) +++ firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision 470f647e29c8c4451b3576afcf21b896badc5f8f) @@ -56,6 +56,7 @@ #define CONCENTRATE_PUMP_VOLUME_PER_PULSE ( CONCENTRATE_PUMP_VOLUME_PER_REV / CONCENTRATE_PUMP_PULSE_PER_REV ) #define CONCENTRATE_PUMP_DATA_PUBLISH_INTERVAL ( 500 / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the concentrate pump is monitored. + #define CONCENTRATE_PUMP_CONTROL_INTERVAL ( 1 * MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the concentrate pump is controlled. #define CONCENTRATE_PUMP_SPEED_CONTROL_PERSISTENCE_PERIOD ( 5 * MS_PER_SECOND ) ///< Persistence period for concentrate pump speed control error. Index: firmware/App/Controllers/ConductivitySensors.c =================================================================== diff -u -r6f2991204047ccbceeb5461f7c35af6d8f5dfd0b -r470f647e29c8c4451b3576afcf21b896badc5f8f --- firmware/App/Controllers/ConductivitySensors.c (.../ConductivitySensors.c) (revision 6f2991204047ccbceeb5461f7c35af6d8f5dfd0b) +++ firmware/App/Controllers/ConductivitySensors.c (.../ConductivitySensors.c) (revision 470f647e29c8c4451b3576afcf21b896badc5f8f) @@ -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. @@ -286,11 +287,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 -r8e0041d52daf1dc3596ecef18b4ab58b9b4818a6 -r470f647e29c8c4451b3576afcf21b896badc5f8f --- firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision 8e0041d52daf1dc3596ecef18b4ab58b9b4818a6) +++ firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision 470f647e29c8c4451b3576afcf21b896badc5f8f) @@ -180,6 +180,7 @@ if( heater < NUM_OF_DG_HEATERS ) { +#ifndef DISABLE_HEATERS_AND_TEMPS // Assume the target temperature has not changed heatersStatus[ heater ].hasTargetTempChanged = FALSE; @@ -190,6 +191,7 @@ heatersStatus[ heater ].hasTargetTempChanged = TRUE; result = TRUE; } +#endif } else { @@ -223,6 +225,7 @@ { BOOL status = FALSE; + if( heater < NUM_OF_DG_HEATERS ) { if ( HEATER_EXEC_STATE_OFF == heatersStatus[ heater ].state ) Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r6f2991204047ccbceeb5461f7c35af6d8f5dfd0b -r470f647e29c8c4451b3576afcf21b896badc5f8f --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 6f2991204047ccbceeb5461f7c35af6d8f5dfd0b) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 470f647e29c8c4451b3576afcf21b896badc5f8f) @@ -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 ******************** // *********************************************************************** @@ -3146,37 +3146,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 @@ -3315,10 +3284,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 *************************************************************************/ @@ -3341,7 +3341,6 @@ } /*********************************************************************//** - * @brief * The handleTestUsedAcidVolumeMLOverrideRequest function handles a * request to override the acid volume. * @details Inputs: none @@ -3763,30 +3762,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 @@ -3854,4 +3829,123 @@ 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 ); +} + +/*********************************************************************//** + * @brief + * The handleTestDrainPumpMeasuredCurrentOverride function handles a request + * to override the drain pump measured current + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleTestDrainPumpMeasuredCurrentOverride( MESSAGE_T *message ) +{ + TEST_OVERRIDE_PAYLOAD_T payload; + BOOL result = FALSE; + + // verify payload length + if ( sizeof( TEST_OVERRIDE_PAYLOAD_T ) == message->hdr.payloadLen ) + { + memcpy( &payload, message->payload, sizeof( TEST_OVERRIDE_PAYLOAD_T ) ); + if ( FALSE == payload.reset ) + { + result = testSetDrainPumpMeasuredCurrentOverride( payload.state.f32 ); + } + else + { + result = testResetDrainPumpMeasuredCurrentOverride(); + } + } + + // respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** + * @brief + * The handleTestGenIdlePublishIntervalOverride function handles a request + * to override the gen idle state publish interval + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleTestGenIdlePublishIntervalOverride( MESSAGE_T * message ) +{ + TEST_OVERRIDE_PAYLOAD_T payload; + BOOL result = FALSE; + + // verify payload length + if ( sizeof( TEST_OVERRIDE_PAYLOAD_T ) == message->hdr.payloadLen ) + { + memcpy( &payload, message->payload, sizeof( TEST_OVERRIDE_PAYLOAD_T ) ); + if ( FALSE == payload.reset ) + { + result = testSetGenIdleSubstatesPublishIntervalOverride( payload.state.u32 ); + } + else + { + result = testResetGenIdleSubstatesPublishIntervalOverride(); + } + } + + // respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + /**@}*/