Index: firmware/App/Controllers/DGInterface.c =================================================================== diff -u -r316f8773970f94c9b1996a03f2235050afb514da -r754427f339e660b7fa688e5e3becc587b30518a8 --- firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 316f8773970f94c9b1996a03f2235050afb514da) +++ firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 754427f339e660b7fa688e5e3becc587b30518a8) @@ -234,7 +234,7 @@ { if ( currentTrtResMgmtState < TREATMENT_RESERVOIR_MGMT_WAIT_FOR_RES_SWITCH_STATE ) { - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_HD_RESERVOIR_FULL_AND_DG_NOT_READY_TO_SWITCH, getReservoirWeight( getDGActiveReservoir(), (F32)currentTrtResMgmtState ) + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_HD_RESERVOIR_FULL_AND_DG_NOT_READY_TO_SWITCH, getReservoirWeight( getDGActiveReservoir() ), (F32)currentTrtResMgmtState ) } else { Index: firmware/App/Controllers/SyringePump.c =================================================================== diff -u -r40959111de79e7cc3b1dfed5d244d5038e3c375c -r754427f339e660b7fa688e5e3becc587b30518a8 --- firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision 40959111de79e7cc3b1dfed5d244d5038e3c375c) +++ firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision 754427f339e660b7fa688e5e3becc587b30518a8) @@ -1743,7 +1743,7 @@ /*********************************************************************//** * @brief * The calcMeasRate function calculates the measured rate from a given delta - * position in last 1 sedond. + * position in last 1 second. * @details Inputs: syringePumpLastPositions[], syringePumpSpeedCalcTimerCounter * @details Outputs: syringePumpMeasRate, syringePumpSpeedCalcTimerCounter * @return none @@ -1754,15 +1754,15 @@ { S32 pos = getSyringePumpPosition(); U32 nextIdx = INC_WRAP( syringePumpMotorSpeedCalcIdx, 0, SYRINGE_PUMP_SPEED_CALC_BUFFER_LEN - 1 ); - S32 countsPerSec = pos - syringePumpLastPositions[ nextIdx ]; // Calc delta between pos 1 second ago and pos now + S32 countsPerSec = pos - syringePumpLastPositions[ syringePumpMotorSpeedCalcIdx ]; // Calc delta between pos 1 second ago and pos now S32 countsPerHr = countsPerSec * ( MIN_PER_HOUR * SEC_PER_MIN); F32 mLPerHr = (F32)((double)countsPerHr / (double)SYRINGE_ENCODER_COUNTS_PER_ML); // Set latest measured rate syringePumpMeasRate.data = mLPerHr; // Update last position for next time - syringePumpLastPositions[ nextIdx ] = pos; + syringePumpLastPositions[ syringePumpMotorSpeedCalcIdx ] = pos; syringePumpMotorSpeedCalcIdx = nextIdx; syringePumpSpeedCalcTimerCounter = 0; }