Index: firmware/App/Controllers/PresOccl.c =================================================================== diff -u -r6f5bb3935a079cf48c836b2227db430c069bac40 -r204a2a20b60ec122fa97a71e24af8019d847ddce --- firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision 6f5bb3935a079cf48c836b2227db430c069bac40) +++ firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision 204a2a20b60ec122fa97a71e24af8019d847ddce) @@ -81,6 +81,7 @@ #define PSI_TO_MMHG ( 51.7149F ) ///< Conversion factor for converting PSI to mmHg. +// The new arterial pressure sensor is the same as the venous pressure sensor #define VENOUS_PRESSURE_NORMAL_OP 0 ///< Venous pressure status bits indicate normal operation. #define VENOUS_PRESSURE_CMD_MODE 1 ///< Venous pressure status bits indicate sensor in command mode. #define VENOUS_PRESSURE_STALE_DATA 2 ///< Venous pressure status bits indicate data is stale (no new data since last fpga read). @@ -838,7 +839,6 @@ } } } - // Check for occlusion in Treatment modes where pumps are moving else if ( MODE_TREA == getCurrentOperationMode() ) { Index: firmware/App/Modes/ModeTreatment.c =================================================================== diff -u -r556668d4ef26ad4afbc438cc28d397a898459084 -r204a2a20b60ec122fa97a71e24af8019d847ddce --- firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision 556668d4ef26ad4afbc438cc28d397a898459084) +++ firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision 204a2a20b60ec122fa97a71e24af8019d847ddce) @@ -1095,6 +1095,9 @@ S32 timeDiff = 0; F32 rateDiff = 0.0; HD_OP_MODE_T currMode = getCurrentOperationMode(); + S32 txSecRem = CALC_TREAT_TIME_REMAINING_IN_SECS(); + S32 txMinEla = CALC_ELAPSED_TREAT_TIME_IN_SECS() / SEC_PER_MIN; + F32 txMinRem = (F32)txSecRem / (F32)SEC_PER_MIN; // Reset pending UF/time settings changes to current values in case request is rejected pendingUFVolumeChange = presMaxUFVolumeML; @@ -1109,9 +1112,12 @@ { DIALYSIS_STATE_T currDialysisState = getDialysisState(); UF_STATE_T currUFState = getUltrafiltrationState(); - F32 uFRate = uFVolume / ((F32)presTreatmentTimeSecs / (F32)SEC_PER_MIN); // What UF rate would be if user selected to adjust it - U32 trtTime = (S32)( uFVolume / presUFRate ) + 1; // What the treatment duration would be if user selected to adjust it - U32 dialVolume = getTreatmentParameterU32( TREATMENT_PARAM_DIALYSATE_FLOW ) * trtTime; // What dialysate volume would be if user selected to adjust time + F32 colUFVol = getUltrafiltrationReferenceVolume(); // How much UF volume have we taken so far? + F32 remUFVol = uFVolume - colUFVol; // What would remaining UF volume be after subtracting UF volume already taken + F32 remUFVolCap = RANGE( remUFVol, 0.0F, (F32)MAX_UF_VOLUME_ML ); // Enforce valid range on remaining UF volume + F32 uFRate = remUFVolCap / txMinRem; // What UF rate would be if user selected to adjust it + U32 trtTime = ( fabs( presUFRate ) < NEARLY_ZERO ? txMinEla + 1 : (S32)( remUFVolCap / presUFRate ) + txMinEla + 1 ); // What the treatment duration would be if user selected to adjust it + U32 dialVolume = getTreatmentParameterU32( TREATMENT_PARAM_DIALYSATE_FLOW ) * trtTime; // What dialysate volume would be if user selected to adjust time // UF should already be paused but let's make sure. if ( ( TREATMENT_DIALYSIS_STATE == currentTreatmentState ) && Index: firmware/App/Modes/Prime.c =================================================================== diff -u -r6f5bb3935a079cf48c836b2227db430c069bac40 -r204a2a20b60ec122fa97a71e24af8019d847ddce --- firmware/App/Modes/Prime.c (.../Prime.c) (revision 6f5bb3935a079cf48c836b2227db430c069bac40) +++ firmware/App/Modes/Prime.c (.../Prime.c) (revision 204a2a20b60ec122fa97a71e24af8019d847ddce) @@ -436,15 +436,20 @@ *************************************************************************/ static void broadcastPrimingStatus( void ) { - U32 const elapsedPrimeTimeInSecs = calcTimeSince( primeStartTime ) / MS_PER_SECOND; + U32 elapsedPrimeTimeInSecs = calcTimeSince( primeStartTime ) / MS_PER_SECOND; + // If the elapsed time is greater than the maximum prime time, it is capped to max prime time so the remaining time + // is a large number + elapsedPrimeTimeInSecs = CAP( elapsedPrimeTimeInSecs, MAX_PRIME_TIME ); + // timeout alarm that used to trigger when max prime time elapsed was removed. if ( ++primeStatusBroadcastTimerCounter >= PRIME_DATA_PUB_INTERVAL ) { PRIMING_DATA_PAYLOAD_T primeData; - primeData.totalTime = MAX_PRIME_TIME; - primeData.remainingTime = MAX_PRIME_TIME - elapsedPrimeTimeInSecs; + primeData.totalTime = MAX_PRIME_TIME; + primeData.remainingTime = MAX_PRIME_TIME - elapsedPrimeTimeInSecs; + broadcastData( MSG_ID_HD_PRIMING_STATUS_DATA, COMM_BUFFER_OUT_CAN_HD_BROADCAST, (U08*)&primeData, sizeof( PRIMING_DATA_PAYLOAD_T ) ); primeStatusBroadcastTimerCounter = 0; } @@ -1025,8 +1030,6 @@ else if ( TRUE == doesAlarmStatusIndicateStop() ) { setupForPrimePause(); - state = HD_PRIME_PAUSE; - setCurrent4thLevelState( NO_SUB_STATE ); } return state;