Index: firmware/App/Modes/Rinseback.c =================================================================== diff -u -rac6532c81f2a6d4ad1c67420c22d59f6aeeaae13 -rdb22e9d530c5c9d62b02e6dcc72ed96fb67c165a --- firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision ac6532c81f2a6d4ad1c67420c22d59f6aeeaae13) +++ firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision db22e9d530c5c9d62b02e6dcc72ed96fb67c165a) @@ -66,7 +66,7 @@ static F32 cumulativeRinsebackVolume_mL; ///< Total cumulative rinseback volume (in mL). static F32 targetRinsebackVolumePlusAdditional_mL; ///< Target rinseback volume w/ additional volume(s) added (in mL). static F32 additionalRinsebackVolume_mL; ///< Total volume (in mL) delivered so far for additional volume request. -static U32 rinsebackMotorCount; ///< The cumulative sum of BP motor encoder counts used for independent rinseback volume check. +static S32 rinsebackMotorCount; ///< The cumulative sum of BP motor encoder counts used for independent rinseback volume check. static U32 rinsebackLastMotorCount; ///< The last BP motor encoder count read for independent rinseback volume check. static F32 rinsebackVolumeDelivered_Safety; ///< The cumulative independent rinseback volume (in mL) calculated so far. static U32 rinsebackAdditionalTimerCtr; ///< Timer counter for duration of an additional rinseback delivery. @@ -345,7 +345,7 @@ // Update rinseback volume delivered so far cumulativeRinsebackVolume_mL += ( getMeasuredBloodFlowRate() * RINSEBACK_FLOW_INTEGRATOR ); // update independent calculated safety volume delivered so far - rinsebackMotorCount = u32DiffWithWrap( rinsebackLastMotorCount, getBloodPumpMotorCount() ) / BP_HALL_EDGE_COUNTS_PER_REV; + rinsebackMotorCount = u32BiDiffWithWrap( rinsebackLastMotorCount, getBloodPumpMotorCount() ) / BP_HALL_EDGE_COUNTS_PER_REV; rinsebackVolumeDelivered_Safety = ( (F32)rinsebackMotorCount * VOLUME_PER_BP_MOTOR_REV_ML ); // TODO - include upstream pressure compensation to this calc // Has user requested to end rinseback? @@ -371,7 +371,7 @@ // Check for empty saline bag if ( TRUE == isSalineBagEmpty() ) { - SET_ALARM_WITH_1_F32_DATA( ALARM_ID_EMPTY_SALINE_BAG, 0.0 ); // TODO - give data supporting empty bag detection + activateAlarmNoData( ALARM_ID_EMPTY_SALINE_BAG ); setupForRinsebackStopOrPause(); result = RINSEBACK_PAUSED_STATE; }