Index: firmware/App/Controllers/ConcentratePumps.c =================================================================== diff -u -r6499ea25921fcf67826fa0c35bb03caf411ba542 -r0c66a3534801f2ba380e95b732e05b7cfee21772 --- firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision 6499ea25921fcf67826fa0c35bb03caf411ba542) +++ firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision 0c66a3534801f2ba380e95b732e05b7cfee21772) @@ -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 -r6499ea25921fcf67826fa0c35bb03caf411ba542 -r0c66a3534801f2ba380e95b732e05b7cfee21772 --- firmware/App/Controllers/ConductivitySensors.c (.../ConductivitySensors.c) (revision 6499ea25921fcf67826fa0c35bb03caf411ba542) +++ firmware/App/Controllers/ConductivitySensors.c (.../ConductivitySensors.c) (revision 0c66a3534801f2ba380e95b732e05b7cfee21772) @@ -57,6 +57,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. @@ -289,11 +290,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/DrainPump.h =================================================================== diff -u -r9cc5da6947aa143a10f95519eb7f366c1b095d61 -r0c66a3534801f2ba380e95b732e05b7cfee21772 --- firmware/App/Controllers/DrainPump.h (.../DrainPump.h) (revision 9cc5da6947aa143a10f95519eb7f366c1b095d61) +++ firmware/App/Controllers/DrainPump.h (.../DrainPump.h) (revision 0c66a3534801f2ba380e95b732e05b7cfee21772) @@ -1,14 +1,14 @@ /************************************************************************** * -* Copyright (c) 2020-2022 Diality Inc. - All Rights Reserved. +* Copyright (c) 2020-2023 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file DrainPump.h * * @author (last) Dara Navaei -* @date (last) 28-Oct-2022 +* @date (last) 02-Jan-2023 * * @author (original) Sean * @date (original) 08-Apr-2020 Index: firmware/App/Controllers/Heaters.c =================================================================== diff -u -r6499ea25921fcf67826fa0c35bb03caf411ba542 -r0c66a3534801f2ba380e95b732e05b7cfee21772 --- firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision 6499ea25921fcf67826fa0c35bb03caf411ba542) +++ firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision 0c66a3534801f2ba380e95b732e05b7cfee21772) @@ -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/Controllers/LoadCell.c =================================================================== diff -u -r69dcae79961be8c276ca86f65991d299aea48582 -r0c66a3534801f2ba380e95b732e05b7cfee21772 --- firmware/App/Controllers/LoadCell.c (.../LoadCell.c) (revision 69dcae79961be8c276ca86f65991d299aea48582) +++ firmware/App/Controllers/LoadCell.c (.../LoadCell.c) (revision 0c66a3534801f2ba380e95b732e05b7cfee21772) @@ -100,7 +100,7 @@ * @details Outputs: LoadCell module initialized. * @return none *************************************************************************/ - void initLoadCell( void ) +void initLoadCell( void ) { U32 i; U32 j; Index: firmware/App/Controllers/ROPump.h =================================================================== diff -u -r6499ea25921fcf67826fa0c35bb03caf411ba542 -r0c66a3534801f2ba380e95b732e05b7cfee21772 --- firmware/App/Controllers/ROPump.h (.../ROPump.h) (revision 6499ea25921fcf67826fa0c35bb03caf411ba542) +++ firmware/App/Controllers/ROPump.h (.../ROPump.h) (revision 0c66a3534801f2ba380e95b732e05b7cfee21772) @@ -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 -r53f4679556eacdd6a93dd358550b4ea7c7c34962 -r0c66a3534801f2ba380e95b732e05b7cfee21772 --- firmware/App/Controllers/Switches.c (.../Switches.c) (revision 53f4679556eacdd6a93dd358550b4ea7c7c34962) +++ firmware/App/Controllers/Switches.c (.../Switches.c) (revision 0c66a3534801f2ba380e95b732e05b7cfee21772) @@ -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/DGCommon.h =================================================================== diff -u -re021769ff5bab2086cb939b20ce134e13b26223c -r0c66a3534801f2ba380e95b732e05b7cfee21772 --- firmware/App/DGCommon.h (.../DGCommon.h) (revision e021769ff5bab2086cb939b20ce134e13b26223c) +++ firmware/App/DGCommon.h (.../DGCommon.h) (revision 0c66a3534801f2ba380e95b732e05b7cfee21772) @@ -25,7 +25,7 @@ #define DG_VERSION_MAJOR 0 #define DG_VERSION_MINOR 6 #define DG_VERSION_MICRO 0 -#define DG_VERSION_BUILD 53 +#define DG_VERSION_BUILD 273 // ********** build switches ********** Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -r6499ea25921fcf67826fa0c35bb03caf411ba542 -r0c66a3534801f2ba380e95b732e05b7cfee21772 --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 6499ea25921fcf67826fa0c35bb03caf411ba542) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 0c66a3534801f2ba380e95b732e05b7cfee21772) @@ -315,15 +315,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 -r6499ea25921fcf67826fa0c35bb03caf411ba542 -r0c66a3534801f2ba380e95b732e05b7cfee21772 --- firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 6499ea25921fcf67826fa0c35bb03caf411ba542) +++ firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 0c66a3534801f2ba380e95b732e05b7cfee21772) @@ -136,7 +136,6 @@ void execOperationModes( void ) { DG_OP_MODE_T newMode; - U32 priorSubMode = currentSubMode; priorSubMode = currentSubMode; @@ -155,7 +154,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 -r6499ea25921fcf67826fa0c35bb03caf411ba542 -r0c66a3534801f2ba380e95b732e05b7cfee21772 --- firmware/App/Services/AlarmMgmtSWFaults.h (.../AlarmMgmtSWFaults.h) (revision 6499ea25921fcf67826fa0c35bb03caf411ba542) +++ firmware/App/Services/AlarmMgmtSWFaults.h (.../AlarmMgmtSWFaults.h) (revision 0c66a3534801f2ba380e95b732e05b7cfee21772) @@ -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 -r6499ea25921fcf67826fa0c35bb03caf411ba542 -r0c66a3534801f2ba380e95b732e05b7cfee21772 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 6499ea25921fcf67826fa0c35bb03caf411ba542) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 0c66a3534801f2ba380e95b732e05b7cfee21772) @@ -897,14 +897,15 @@ handleDGSendConcentrateMixingRatios( message ); break; - case MSG_ID_HD_REQUEST_DG_USAGE_INFO: - handleHDRequestDGUsageInfo( 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_DG_SET_SERVICE_TIME: handleSetDGServiceTime( message ); break; @@ -1149,11 +1150,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: @@ -1164,10 +1165,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; @@ -1180,6 +1177,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; @@ -1224,14 +1225,14 @@ handleTestTareReservoirRequest( message ); break; - case MSG_ID_DG_DRAIN_PUMP_CURRENT_OVERRIDE: - handleTestDrainPumpMeasuredCurrentOverride( message ); - break; - case MSG_ID_DG_GEN_IDLE_PUBLISH_INTERVAL_OVERRIDE: handleTestGenIdlePublishIntervalOverride( message ); break; + case MSG_ID_DG_DRAIN_PUMP_CURRENT_OVERRIDE: + handleTestDGDrainPumpCurrentOverrideRequest( message ); + break; + case MSG_ID_DG_DRAIN_PUMP_DIRECTION_OVERRIDE: handleTestDGDrainPumpDirectionOverrideRequest( message ); break; Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r6499ea25921fcf67826fa0c35bb03caf411ba542 -r0c66a3534801f2ba380e95b732e05b7cfee21772 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 6499ea25921fcf67826fa0c35bb03caf411ba542) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 0c66a3534801f2ba380e95b732e05b7cfee21772) @@ -373,7 +373,6 @@ return result; } - // *********************************************************************** // **************** Message Handling Helper Functions ******************** // *********************************************************************** @@ -3367,37 +3366,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 @@ -3536,10 +3504,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 *************************************************************************/ @@ -3562,7 +3561,6 @@ } /*********************************************************************//** - * @brief * The handleTestUsedAcidVolumeMLOverrideRequest function handles a * request to override the acid volume. * @details Inputs: none Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -r6499ea25921fcf67826fa0c35bb03caf411ba542 -r0c66a3534801f2ba380e95b732e05b7cfee21772 --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 6499ea25921fcf67826fa0c35bb03caf411ba542) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 0c66a3534801f2ba380e95b732e05b7cfee21772) @@ -160,6 +160,12 @@ // 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_DG_SET_SERVICE_TIME void handleSetDGServiceTime( MESSAGE_T *message ); @@ -370,6 +376,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 ); @@ -388,21 +400,27 @@ // MSG_ID_DG_SET_SW_CONFIG_RECORD void handleSetDGSoftwareConfigRecord( MESSAGE_T *message ); +// MSG_ID_HD_REQUEST_DG_ALARMS +void handleResendAllAlarmsCommand( MESSAGE_T *message ); + // MSG_ID_DG_HD_COMMUNICATION_STATUS void handleTestHDCommunicationStatusOverrideRequest( MESSAGE_T *message ); // 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 );