Index: firmware/App/Controllers/SyringePump.c =================================================================== diff -u -rabbad386f4cc94f315300dffef321fe8c03fbd52 -rfa27f8d2dba32416ff6b310b192b9adb5fee6997 --- firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision abbad386f4cc94f315300dffef321fe8c03fbd52) +++ firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision fa27f8d2dba32416ff6b310b192b9adb5fee6997) @@ -948,20 +948,15 @@ *************************************************************************/ static void execSyringePumpMonitor( void ) { + F32 forceSensorBeforCal = 0.0; + // Check if a new calibration is available if ( TRUE == isNewCalibrationRecordAvailable() ) { // Get the new calibration data and check its validity processCalibrationData(); } - F32 forceSensorBeforCal = ( (F32)getFPGASyringePumpADCChannel0() * SYRINGE_PUMP_ADC_REF_V ) / SYRINGE_PUMP_ADC_FULL_SCALE_BITS; - syringePumpMeasForce.data = pow(forceSensorBeforCal, 4) * forceSensorCalRecord.hdHeparinForceSensor.fourthOrderCoeff + - pow(forceSensorBeforCal, 3) * forceSensorCalRecord.hdHeparinForceSensor.thirdOrderCoeff + - pow(forceSensorBeforCal, 2) * forceSensorCalRecord.hdHeparinForceSensor.secondOrderCoeff + - forceSensorBeforCal * forceSensorCalRecord.hdHeparinForceSensor.gain + - forceSensorCalRecord.hdHeparinForceSensor.offset; - S32 encPosition = getFPGASyringePumpEncoderPosition(); // Get latest FPGA status @@ -974,6 +969,13 @@ syringePumpMeasHome.data = ( (F32)getFPGASyringePumpADCChannel2() * SYRINGE_PUMP_ADC_REF_V ) / SYRINGE_PUMP_ADC_FULL_SCALE_BITS; syringePumpMeasSyringeDetectionSwitch.data = ( (F32)getFPGASyringePumpADCChannel1() * SYRINGE_PUMP_ADC_REF_V ) / SYRINGE_PUMP_ADC_FULL_SCALE_BITS; + forceSensorBeforCal = ( (F32)getFPGASyringePumpADCChannel0() * SYRINGE_PUMP_ADC_REF_V ) / SYRINGE_PUMP_ADC_FULL_SCALE_BITS; + syringePumpMeasForce.data = pow(forceSensorBeforCal, 4) * forceSensorCalRecord.hdHeparinForceSensor.fourthOrderCoeff + + pow(forceSensorBeforCal, 3) * forceSensorCalRecord.hdHeparinForceSensor.thirdOrderCoeff + + pow(forceSensorBeforCal, 2) * forceSensorCalRecord.hdHeparinForceSensor.secondOrderCoeff + + forceSensorBeforCal * forceSensorCalRecord.hdHeparinForceSensor.gain + + forceSensorCalRecord.hdHeparinForceSensor.offset; + // Apply home offset to encoder position syringePumpLastPosition = getSyringePumpPosition(); syringePumpPosition.data = encPosition - syringePumpHomePositionOffset; Index: firmware/App/Services/FPGA.c =================================================================== diff -u -r69b93e39861c5493d273f25d9e43cacd0b5819e2 -rfa27f8d2dba32416ff6b310b192b9adb5fee6997 --- firmware/App/Services/FPGA.c (.../FPGA.c) (revision 69b93e39861c5493d273f25d9e43cacd0b5819e2) +++ firmware/App/Services/FPGA.c (.../FPGA.c) (revision fa27f8d2dba32416ff6b310b192b9adb5fee6997) @@ -2330,12 +2330,11 @@ * switch status bit. * @details Inputs: none * @details Outputs: fpgaSensorReadings - * @return cartridge latch FPGA status bit + * @return pump track switch FPGA status bit *************************************************************************/ U16 getFPGAPumpTrackSwitchStatus( void ) { - // TODO fill up - return 0; + return ( fpgaSensorReadings.fpgaGPIO & PUMP_TRACK_SWITCH_MASK ); } #ifdef DEBUG_ENABLED