Index: firmware/App/Controllers/SyringePump.c =================================================================== diff -u -r17473fe71d115b4b78309e69656a984cd1e4a160 -r93036331d13395927c373e60c1d54cc3d79b014f --- firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision 17473fe71d115b4b78309e69656a984cd1e4a160) +++ firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision 93036331d13395927c373e60c1d54cc3d79b014f) @@ -174,6 +174,14 @@ SYRINGE_PUMP_CONTROL_FORWARD_DIR | SYRINGE_PUMP_CONTROL_32TH_STEP; +// TODO: Remove the following force sensor calibration data when NVM is implemented. +static const TD_HEPARIN_FORCE_SENSOR_CAL_RECORD_T forceSensorCalRecord = ///< TD heparin force sensor calibration record. +{ + .tdHeparinForceSensorDACVoltage = 0.1f, + .calibrationTime = 1u, + .crc = 0u +}; + /// Defined states for the syringe pump control state machine. typedef enum SyringePump_States { @@ -251,8 +259,7 @@ static U32 syringePumpEmptyForceCount; ///< Counter for empty syringe detection. // TODO: Remove the following code when NVM is implemented. -static TD_HEPARIN_FORCE_SENSOR_CAL_RECORD_T forceSensorCalRecord; ///< TD heparin force sensor calibration record. -//static BOOL spumpCalibrated; ///< Flag to ensure that calibration request is made only once. +//static BOOL spumpCalibrated; ///< Flag to ensure that calibration request is made only once. // ********** private function prototypes ********** @@ -338,62 +345,62 @@ syringePumpMeasRate.data = 0.0; syringePumpMeasRate.ovInitData = 0.0; syringePumpMeasRate.ovData = 0.0; - syringePumpMeasRate.override = 0; + syringePumpMeasRate.override = OVERRIDE_RESET; syringePumpMeasForce.data = 0.0; syringePumpMeasForce.ovInitData = 0.0; syringePumpMeasForce.ovData = 0.0; - syringePumpMeasForce.override = 0; + syringePumpMeasForce.override = OVERRIDE_RESET; syringePumpMeasHome.data = 0.0; syringePumpMeasHome.ovInitData = 0.0; syringePumpMeasHome.ovData = 0.0; - syringePumpMeasHome.override = 0; + syringePumpMeasHome.override = OVERRIDE_RESET; syringePumpPosition.data = 0; syringePumpPosition.ovInitData = 0; syringePumpPosition.ovData = 0; - syringePumpPosition.override = 0; + syringePumpPosition.override = OVERRIDE_RESET; syringePumpVolumeDelivered.data = 0.0; syringePumpVolumeDelivered.ovInitData = 0.0; syringePumpVolumeDelivered.ovData = 0.0; - syringePumpVolumeDelivered.override = 0; + syringePumpVolumeDelivered.override = OVERRIDE_RESET; heparinBolusTargetRate.data = HEPARIN_BOLUS_TARGET_RATE; heparinBolusTargetRate.ovInitData = 0.0; heparinBolusTargetRate.ovData = HEPARIN_BOLUS_TARGET_RATE; - heparinBolusTargetRate.override = 0; + heparinBolusTargetRate.override = OVERRIDE_RESET; syringePumpStatus.data = 0; syringePumpStatus.ovInitData = 0; syringePumpStatus.ovData = 0; - syringePumpStatus.override = 0; + syringePumpStatus.override = OVERRIDE_RESET; syringePumpEncoderStatus.data = 0; syringePumpEncoderStatus.ovInitData = 0; syringePumpEncoderStatus.ovData = 0; - syringePumpEncoderStatus.override = 0; + syringePumpEncoderStatus.override = OVERRIDE_RESET; syringePumpADCandDACStatus.data = 0; syringePumpADCandDACStatus.ovInitData = 0; syringePumpADCandDACStatus.ovData = 0; - syringePumpADCandDACStatus.override = 0; + syringePumpADCandDACStatus.override = OVERRIDE_RESET; syringePumpADCReadCtr.data = 0; syringePumpADCReadCtr.ovInitData = 0; syringePumpADCReadCtr.ovData = 0; - syringePumpADCReadCtr.override = 0; + syringePumpADCReadCtr.override = OVERRIDE_RESET; syringePumpDACVref.data = 0.0; syringePumpDACVref.ovInitData = 0.0; syringePumpDACVref.ovData = 0.0; - syringePumpDACVref.override = 0; + syringePumpDACVref.override = OVERRIDE_RESET; syringePumpDataPublishInterval.data = SYRINGE_PUMP_DATA_PUB_INTERVAL; syringePumpDataPublishInterval.ovInitData = SYRINGE_PUMP_DATA_PUB_INTERVAL; syringePumpDataPublishInterval.ovData = 0; - syringePumpDataPublishInterval.override = 0; + syringePumpDataPublishInterval.override = OVERRIDE_RESET; // Zero pump position counts buffer for ( i = 0; i < SYRINGE_PUMP_SPEED_CALC_BUFFER_LEN; i++ ) @@ -415,8 +422,6 @@ resetSyringePumpRequestFlags(); // TODO: Remove the following code when NVM is implemented. -// forceSensorCalRecord.tdHeparinForceSensorDACVoltage = 0.1; -// forceSensorCalRecord.calibrationTime = 1; // spumpCalibrated = FALSE; } @@ -512,6 +517,11 @@ { SELF_TEST_STATUS_T result = SELF_TEST_STATUS_PASSED; BOOL calStatus = FALSE; + + // TODO: Remove when NVM is implemented. + // Verify that the calibration time is not zero + calStatus = ( 0 != forceSensorCalRecord.calibrationTime ? TRUE : FALSE ); + // Read/check force sensor calibration // BOOL calStatus = getNVRecord2Driver( GET_CAL_HEPARIN_FORCE_SENSOR, (U08*)&forceSensorCalRecord, sizeof( TD_HEPARIN_FORCE_SENSOR_CAL_RECORD_T ), // 0, ALARM_ID_TD_HEPARIN_FORCE_SENSOR_INVALID_CAL_RECORD ); @@ -1196,7 +1206,6 @@ if ( TRUE == isPersistentAlarmTriggered( ALARM_ID_TD_SYRINGE_PUMP_RUNNING_WHILE_BP_OFF_ERROR, runWhileOff ) ) { SET_ALARM_WITH_1_U32_DATA( ALARM_ID_TD_SYRINGE_PUMP_RUNNING_WHILE_BP_OFF_ERROR, (U32)syringePumpState ); - activateSafetyShutdown(); } }