Index: firmware/App/Controllers/DGInterface.c =================================================================== diff -u -rc429cf7f50851acbaca6e800957ef44cc1fa2162 -r9dda32df52314738f8ef9a4753304d27cd27f878 --- firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision c429cf7f50851acbaca6e800957ef44cc1fa2162) +++ firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 9dda32df52314738f8ef9a4753304d27cd27f878) @@ -8,7 +8,7 @@ * @file DGInterface.c * * @author (last) Dara Navaei -* @date (last) 07-Nov-2022 +* @date (last) 02-Dec-2022 * * @author (original) Sean * @date (original) 08-Apr-2020 @@ -37,18 +37,18 @@ // ********** private definitions ********** -#define START_DG_CMD TRUE ///< Parameter for DG start/stop command function. True = start. -#define STOP_DG_CMD FALSE ///< Parameter for DG start/stop command function. False = stop. +#define START_DG_CMD TRUE ///< Parameter for DG start/stop command function. True = start. +#define STOP_DG_CMD FALSE ///< Parameter for DG start/stop command function. False = stop. -#define SIZE_OF_LARGE_LOAD_CELL_AVG 32 ///< Large load cell moving average has 32 samples. +#define SIZE_OF_LARGE_LOAD_CELL_AVG 32 ///< Large load cell moving average has 32 samples. -#define DIALYSATE_TEMP_OUT_OF_TARGET_TOL_C 2.0F ///< Dialysate temperature out of target tolerance C. -#define DIALYSATE_TEMP_OUT_OF_TARGET_TIMEOUT_MS ( 300 * MS_PER_SECOND ) ///< Dialysate temperature out of target timeout in milliseconds. -#define DIALYSATE_TEMP_HIGH_SAFETY_LIMIT_C 46.0F ///< Dialysate high safety temperature limit in C. -#define DIALYSATE_TEMP_HIGH_SAFETY_TIMEOUT_MS ( 1 * MS_PER_SECOND ) ///< Dialysate temperature high safety timeout in milliseconds. -#define DIALYSATE_TEMP_LOW_SAFETY_LIMIT_C 42.0F ///< Dialysate low safety temperature limit in C. -#define DIALYSATE_TEMP_LOW_SAFETY_TIMEOUT_MS ( 10 * MS_PER_SECOND ) ///< Dialysate temperature low safety timeout in milliseconds. -#define DG_DATA_FRESHNESS_TIMEOUT_MS ( 3 * MS_PER_SECOND ) ///< DG data freshness timeout (in ms). +#define DIALYSATE_TEMP_OUT_OF_TARGET_TOL_C 2.0F ///< Dialysate temperature out of target tolerance C. +#define DIALYSATE_TEMP_OUT_OF_TARGET_TIMEOUT_MS ( 300 * MS_PER_SECOND ) ///< Dialysate temperature out of target timeout in milliseconds. +#define DIALYSATE_TEMP_HIGH_SAFETY_LIMIT_C 46.0F ///< Dialysate high safety temperature limit in C. +#define DIALYSATE_TEMP_HIGH_SAFETY_TIMEOUT_MS ( 1 * MS_PER_SECOND ) ///< Dialysate temperature high safety timeout in milliseconds. +#define DIALYSATE_TEMP_LOW_SAFETY_LIMIT_C 42.0F ///< Dialysate low safety temperature limit in C. +#define DIALYSATE_TEMP_LOW_SAFETY_TIMEOUT_MS ( 10 * MS_PER_SECOND ) ///< Dialysate temperature low safety timeout in milliseconds. +#define DG_DATA_FRESHNESS_TIMEOUT_MS ( 3 * MS_PER_SECOND ) ///< DG data freshness timeout (in ms). // ********** private data ********** @@ -235,7 +235,7 @@ void execDGInterfaceMonitor( void ) { // Trigger alarm if not receiving new load cell data message in timely manner - checkDGDataFreshness( ALARM_ID_HD_NEW_LOAD_CELL_DATA_MESSAGE_NOT_RECEIVE, &dgLoadCellDataFreshFlag ); + /*checkDGDataFreshness( ALARM_ID_HD_NEW_LOAD_CELL_DATA_MESSAGE_NOT_RECEIVE, &dgLoadCellDataFreshFlag ); // Trigger alarm if not receiving new dialysate temperature data message in timely manner checkDGDataFreshness( ALARM_ID_HD_NEW_DIALYSATE_TEMPERATURE_DATA_MESSAGE_NOT_RECEIVE, &dgDialysateTemperatureDataFreshFlag ); @@ -246,7 +246,7 @@ // Trigger alarm if not receiving new DG op mode message in timely manner checkDGDataFreshness( ALARM_ID_HD_NEW_DG_OPERATION_MODE_MESSAGE_NOT_RECEIVE, &dgOpModeDataFreshFlag ); - // Check to see if DG has restarted + // Check to see if DG has restarted*/ checkDGRestart(); // Check the status of the trimmer heater @@ -452,26 +452,26 @@ /*********************************************************************//** * @brief - * The getDialysateTemperature function gets the latest dialysate temperature. - * @details Inputs: dgDialysateTemp + * The getDGDisinfectsStates function returns the DG disinfects readings. + * @details Inputs: none * @details Outputs: none - * @return the current dialysate temperature + * @return the current DG disinfects readings *************************************************************************/ -F32 getDialysateTemperature( void ) +DG_DISINFECT_UI_STATES_T getDGDisinfectsStates( void ) { - return dgDialysateTemp; + return disinfectsStatus; } /*********************************************************************//** * @brief - * The getDGDisinfectsStates function returns the DG disinfects readings. - * @details Inputs: none + * The getDialysateTemperature function gets the latest dialysate temperature. + * @details Inputs: dgDialysateTemp * @details Outputs: none - * @return the current DG disinfects readings + * @return the current dialysate temperature *************************************************************************/ -DG_DISINFECT_UI_STATES_T getDGDisinfectsStates( void ) +F32 getDialysateTemperature( void ) { - return disinfectsStatus; + return dgDialysateTemp; } /*********************************************************************//** @@ -1091,7 +1091,6 @@ { hasCommandResp = TRUE; memcpy( cmdRespPtr, &dgCmdResp[ commandID ], sizeof( DG_CMD_RESPONSE_T ) ); - dgCmdResp[ commandID ].commandID = DG_CMD_NONE; } return hasCommandResp; Index: firmware/App/Controllers/DGInterface.h =================================================================== diff -u -rc429cf7f50851acbaca6e800957ef44cc1fa2162 -r9dda32df52314738f8ef9a4753304d27cd27f878 --- firmware/App/Controllers/DGInterface.h (.../DGInterface.h) (revision c429cf7f50851acbaca6e800957ef44cc1fa2162) +++ firmware/App/Controllers/DGInterface.h (.../DGInterface.h) (revision 9dda32df52314738f8ef9a4753304d27cd27f878) @@ -130,6 +130,7 @@ F32 getReservoirBackupWeightLargeFilter( DG_RESERVOIR_ID_T resID ); F32 getDialysateTemperature( void ); DG_DISINFECT_UI_STATES_T getDGDisinfectsStates( void ); +F32 getDialysateTemperature( void ); DG_MIXING_RATIOS_T getDGMixingRatios( void ); void getHDVersionDGServiceAndUsageData( DG_SERVICE_AND_USAGE_DATA_T* data ); Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -re781d3b87509e75ae6a2bde6da3d5819b7b5a2da -r9dda32df52314738f8ef9a4753304d27cd27f878 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision e781d3b87509e75ae6a2bde6da3d5819b7b5a2da) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 9dda32df52314738f8ef9a4753304d27cd27f878) @@ -7,8 +7,8 @@ * * @file ModeStandby.c * -* @author (last) Dara Navaei -* @date (last) 24-Oct-2022 +* @author (last) Sean Nash +* @date (last) 01-Dec-2022 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -67,6 +67,7 @@ static OVERRIDE_U32_T standbyModePublishInterval = { DISINFECTS_DATA_PUB_INTERVAL, DISINFECTS_DATA_PUB_INTERVAL, DISINFECTS_DATA_PUB_INTERVAL, 0 }; static const U32 SERVICE_TIME_INTERVAL_S = (U32)( 365 * 0.5 * SECONDS_IN_A_DAY ); ///< HD/DG 6-month service interval in seconds. +static BOOL homingInitiated; ///< Flag indicates actuator homing has been initiated from standby mode. // ********** private function prototypes ********** @@ -110,6 +111,7 @@ heatDisinfectStartReqReceived = FALSE; chemDisinfectStartReqReceived = FALSE; disinfectCancelReqID = GENERIC_CONFIRM_ID_NONE; + homingInitiated = FALSE; dgDisinfectState = DG_DISINFECT_NOT_RUNNING_STATE; homingInitiated = FALSE; } @@ -130,6 +132,8 @@ initStandbyMode(); initDGInterface(); resetAirTrap(); + resetBloodPumpRotorCount(); + resetDialInPumpRotorCount(); doorClosedRequired( FALSE, FALSE ); syringeDetectionRequired( FALSE ); @@ -612,26 +616,35 @@ homingInitiated = TRUE; } + else + { + // If homing has been initiated, wait for syringe pump to home and the verify force sensor calibration +#ifndef _RELEASE_ + if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_DISABLE_SYRINGE_PUMP ) ) + { + state = STANDBY_WAIT_FOR_TREATMENT_STATE; // Go to wait for treatment state after above check + } + else +#endif + { + if ( ( TRUE == homingInitiated ) && ( TRUE == isSyringePumpHome() ) && ( TRUE == isSyringePumpStopped() ) ) + { + syringePumpVerifyForceSensorDACCalibration(); + homingInitiated = FALSE; // reset for next time + state = STANDBY_WAIT_FOR_TREATMENT_STATE; // Go to wait for treatment state after above check + } + } + } } else { // Trigger door open alarm to prompt user to close the door activateAlarmNoData( ALARM_ID_CARTRIDGE_DOOR_OPENED ); } - // If homing has been initiated, wait for syringe pump to home and the verify force sensor calibration - if ( ( TRUE == homingInitiated ) && ( TRUE == isSyringePumpHome() ) ) - { - syringePumpVerifyForceSensorDACCalibration(); - homingInitiated = FALSE; // reset for next time - state = STANDBY_WAIT_FOR_TREATMENT_STATE; // Go to wait for treatment state after above check - } - return state; } -// Verify calibration - /*********************************************************************//** * @brief * The handleStandbyModeWaitForTreatmentState function handles wait for Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -re781d3b87509e75ae6a2bde6da3d5819b7b5a2da -r9dda32df52314738f8ef9a4753304d27cd27f878 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision e781d3b87509e75ae6a2bde6da3d5819b7b5a2da) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 9dda32df52314738f8ef9a4753304d27cd27f878) @@ -8,7 +8,7 @@ * @file SystemComm.c * * @author (last) Dara Navaei -* @date (last) 18-Oct-2022 +* @date (last) 11-Nov-2022 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -1380,6 +1380,10 @@ handleHDBloodPumpRotorCountOverrideRequest( message ); break; + case MSG_ID_HD_DIALYSATE_INLET_PUMP_ROTOR_COUNT_OVERRIDE: + handleHDDialInPumpRotorCountOverrideRequest( message ); + break; + case MSG_ID_BLOOD_PUMP_HOME_CMD: handleTestBloodPumpHomeRequest( message ); break; Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -re781d3b87509e75ae6a2bde6da3d5819b7b5a2da -r9dda32df52314738f8ef9a4753304d27cd27f878 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision e781d3b87509e75ae6a2bde6da3d5819b7b5a2da) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 9dda32df52314738f8ef9a4753304d27cd27f878) @@ -8,7 +8,7 @@ * @file SystemCommMessages.c * * @author (last) Dara Navaei -* @date (last) 03-Nov-2022 +* @date (last) 11-Nov-2022 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -3684,6 +3684,38 @@ /*********************************************************************//** * @brief + * The handleHDDialInPumpRotorCountOverrideRequest function handles a request to + * override the dialysate inlet pump rotor count. + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleHDDialInPumpRotorCountOverrideRequest( 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 = testSetDialysateInPumpRotorCountOverride( payload.state.u32 ); + } + else + { + result = testResetDialysateInPumpRotorCountOverride(); + } + } + + // Respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** + * @brief * The handleTestBloodPumpRotorMeasuredSpeedOverrideRequest function handles a request to * override the measured blood pump rotor speed (RPM). * @details Inputs: none @@ -5219,6 +5251,7 @@ if ( sizeof( TEST_OVERRIDE_PAYLOAD_T ) == message->hdr.payloadLen ) { memcpy( &payload, message->payload, sizeof( TEST_OVERRIDE_PAYLOAD_T ) ); + if ( FALSE == payload.reset ) { result = testSetBatteryRemainingPercentOverride( payload.state.f32 ); Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -re781d3b87509e75ae6a2bde6da3d5819b7b5a2da -r9dda32df52314738f8ef9a4753304d27cd27f878 --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision e781d3b87509e75ae6a2bde6da3d5819b7b5a2da) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 9dda32df52314738f8ef9a4753304d27cd27f878) @@ -8,7 +8,7 @@ * @file SystemCommMessages.h * * @author (last) Dara Navaei -* @date (last) 03-Nov-2022 +* @date (last) 11-Nov-2022 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -494,6 +494,9 @@ // MSG_ID_BLOOD_ROTOR_COUNT_OVERRIDE void handleHDBloodPumpRotorCountOverrideRequest( MESSAGE_T *message ); +// MSG_ID_DIALYSATE_INLET_PUMP_ROTOR_COUNT_OVERRIDE +void handleHDDialInPumpRotorCountOverrideRequest( MESSAGE_T *message ); + // MSG_ID_BLOOD_PUMP_MC_MEAS_SPEED_OVERRIDE void handleTestBloodPumpMCMeasuredSpeedOverrideRequest( MESSAGE_T *message ); @@ -836,9 +839,6 @@ // MSG_ID_HD_SEND_BLOOD_LEAK_EMB_MODE_RESPONSE BOOL sendBloodLeakEmbeddedModeCommandResponse( U32 responseLen, U08* response ); -// MSG_ID_HD_SEND_ALARMS_COMMAND -void handleResendAllAlarmsCommand( MESSAGE_T* message ); - // MSG_ID_HD_BLOOD_PUMP_SET_PWM void handleTestBloodPumpSetPWM( MESSAGE_T* message );