Index: firmware/App/Controllers/DialInFlow.c =================================================================== diff -u -rac2c218b9e310a14d2872c9b4c32a6f69615088e -rffaaf7d1e1eb5715eac3f7c7b424a4648526344d --- firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision ac2c218b9e310a14d2872c9b4c32a6f69615088e) +++ firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision ffaaf7d1e1eb5715eac3f7c7b424a4648526344d) @@ -1220,20 +1220,18 @@ *************************************************************************/ SELF_TEST_STATUS_T execDialInFlowTest( void ) { - SELF_TEST_STATUS_T result = SELF_TEST_STATUS_FAILED; - CALIBRATION_DATA_T cal; + SELF_TEST_STATUS_T result = SELF_TEST_STATUS_FAILED; + + // Get the flow sensors calibration record + HD_FLOW_SENSORS_CAL_RECORD_T cal = getHDFlowSensorsCalibrationRecord(); switch ( dialInPumpSelfTestState ) { case DIAL_IN_FLOW_SELF_TEST_STATE_START: - // Retrieve blood flow sensor calibration data - if ( TRUE == getCalibrationData( &cal ) ) - { - dialInFlowCalGain = cal.dialysateFlowGain; - dialInFlowCalOffset = cal.dialysateFlowOffset_mL_min; - dialInPumpSelfTestState = DIAL_IN_FLOW_TEST_STATE_COMPLETE; // TODO - implement rest of self-test(s) - result = SELF_TEST_STATUS_PASSED; - } + dialInFlowCalGain = cal.hdFlowSensors[ CAL_DATA_HD_DIALYZER_FLOW_SENSOR ].gain; + dialInFlowCalOffset = cal.hdFlowSensors[ CAL_DATA_HD_DIALYZER_FLOW_SENSOR ].offset; + dialInPumpSelfTestState = DIAL_IN_FLOW_TEST_STATE_COMPLETE; // TODO - implement rest of self-test(s) + result = SELF_TEST_STATUS_PASSED; break; case DIAL_IN_FLOW_TEST_STATE_IN_PROGRESS: @@ -1255,57 +1253,6 @@ * TEST SUPPORT FUNCTIONS *************************************************************************/ - -/*********************************************************************//** - * @brief - * The setDialInFlowCalibration function sets the dialysate flow calibration - * factors and has them stored in non-volatile memory. - * @details Inputs: none - * @details Outputs: dialInFlowCalGain, dialInFlowCalOffset - * @param gain gain calibration factor for dialysate flow sensor - * @param offset offset calibration factor for dialysate flow sensor - * @return TRUE if calibration factors successfully set/stored, FALSE if not - *************************************************************************/ -BOOL setDialInFlowCalibration( F32 gain, F32 offset ) -{ - BOOL result = FALSE; - - if ( TRUE == isTestingActivated() ) - { - CALIBRATION_DATA_T cal; - - getCalibrationData( &cal ); - // Keep locally and apply immediately - dialInFlowCalGain = gain; - dialInFlowCalOffset = offset; - // Also update calibration record in non-volatile memory - cal.dialysateFlowGain = gain; - cal.dialysateFlowOffset_mL_min = offset; - if ( TRUE == setCalibrationData( cal ) ) - { - result = TRUE; - } - } - - return result; -} - -/*********************************************************************//** - * @brief - * The getDialInFlowCalibration function retrieves the current dialysate flow - * calibration factors. - * @details Inputs: dialInFlowCalGain, dialInFlowCalOffset - * @details Outputs: none - * @param gain value to populate with gain calibration factor for dialysate flow sensor - * @param offset value to populate with offset calibration factor for dialysate flow sensor - * @return none - *************************************************************************/ -void getDialInFlowCalibration( F32 *gain, F32 *offset ) -{ - *gain = dialInFlowCalGain; - *offset = dialInFlowCalOffset; -} - /*********************************************************************//** * @brief * The testSetDialInFlowDataPublishIntervalOverride function overrides the