Index: firmware/App/Controllers/BloodFlow.c =================================================================== diff -u -r9d7ad180a18e29ba08bf65228d61b6179ddbfcca -r94895e32fe18e78b98fe3bb7786838cf00afdbfa --- firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision 9d7ad180a18e29ba08bf65228d61b6179ddbfcca) +++ firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision 94895e32fe18e78b98fe3bb7786838cf00afdbfa) @@ -653,7 +653,7 @@ static void publishBloodFlowData( void ) { // publish blood flow data on interval - if ( ++bloodFlowDataPublicationTimerCounter > getPublishBloodFlowDataInterval() ) + if ( ++bloodFlowDataPublicationTimerCounter >= getPublishBloodFlowDataInterval() ) { S32 flowStPt = (S32)getTargetBloodFlowRate(); #ifndef SHOW_RAW_FLOW_VALUES Index: firmware/App/Controllers/Buttons.c =================================================================== diff -u -r9b262ba08e3180f121c3cf19d8d25e565183f87d -r94895e32fe18e78b98fe3bb7786838cf00afdbfa --- firmware/App/Controllers/Buttons.c (.../Buttons.c) (revision 9b262ba08e3180f121c3cf19d8d25e565183f87d) +++ firmware/App/Controllers/Buttons.c (.../Buttons.c) (revision 94895e32fe18e78b98fe3bb7786838cf00afdbfa) @@ -346,14 +346,7 @@ if ( getOffButtonState() == BUTTON_STATE_PRESSED ) { // if off request in a valid mode, send to UI for user confirmation - if ( TRUE == isCurrentOpModeOkToTurnOff() ) - { - // send off button to UI for user confirmation - sendOffButtonMsgToUI( OFF_BUTTON_CMD_PROMPT_USER_TO_CONFIRM ); - offRequestAwaitingUserConfirmation = TRUE; - offRequestPendingTimer = 0; - userConfirmOffButton( OFF_BUTTON_RSP_USER_REQUESTS_POWER_OFF ); - } + userConfirmOffButton( OFF_BUTTON_RSP_USER_REQUESTS_POWER_OFF ); } prevOffButtonState = getOffButtonState(); } Index: firmware/App/Controllers/DialInFlow.c =================================================================== diff -u -r9d7ad180a18e29ba08bf65228d61b6179ddbfcca -r94895e32fe18e78b98fe3bb7786838cf00afdbfa --- firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision 9d7ad180a18e29ba08bf65228d61b6179ddbfcca) +++ firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision 94895e32fe18e78b98fe3bb7786838cf00afdbfa) @@ -654,7 +654,7 @@ static void publishDialInFlowData( void ) { // publish dialIn flow data on interval - if ( ++dialInFlowDataPublicationTimerCounter > getPublishDialInFlowDataInterval() ) + if ( ++dialInFlowDataPublicationTimerCounter >= getPublishDialInFlowDataInterval() ) { S32 flowStPt = (S32)getTargetDialInFlowRate(); #ifndef SHOW_RAW_FLOW_VALUES Index: firmware/App/Controllers/DialOutFlow.c =================================================================== diff -u -re0e66d4c302c2aa43951ca316689ed4debbff1fb -r94895e32fe18e78b98fe3bb7786838cf00afdbfa --- firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision e0e66d4c302c2aa43951ca316689ed4debbff1fb) +++ firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision 94895e32fe18e78b98fe3bb7786838cf00afdbfa) @@ -628,11 +628,15 @@ static void publishDialOutFlowData( void ) { // publish dialysate outlet pump and UF volume data on interval - if ( ++dialOutFlowDataPublicationTimerCounter > getPublishDialOutDataInterval() ) + if ( ++dialOutFlowDataPublicationTimerCounter >= getPublishDialOutDataInterval() ) { dialOutBroadCastVariables.refUFVolMl = getTotalTargetDialOutUFVolumeInMl(); dialOutBroadCastVariables.measUFVolMl = getTotalMeasuredUFVolumeInMl(); - dialOutBroadCastVariables.measRotSpdRPM = getLoadCellWeightInGrams( LOAD_CELL_RESERVOIR_1_PRIMARY ); //getMeasuredDialOutPumpRotorSpeed(); // TODO - restore to rotor speed later +#ifndef SHOW_LOAD_CELL_IN_ROTOR_RPM + dialOutBroadCastVariables.measRotSpdRPM = getMeasuredDialOutPumpRotorSpeed(); +#else + dialOutBroadCastVariables.measRotSpdRPM = getLoadCellWeightInGrams( LOAD_CELL_RESERVOIR_1_PRIMARY ); +#endif dialOutBroadCastVariables.measSpdRPM = getMeasuredDialOutPumpSpeed(); dialOutBroadCastVariables.measMCSpdRPM = getMeasuredDialOutPumpMCSpeed(); dialOutBroadCastVariables.measMCCurrmA = getMeasuredDialOutPumpMCCurrent(); Index: firmware/App/HDCommon.h =================================================================== diff -u -r9d7ad180a18e29ba08bf65228d61b6179ddbfcca -r94895e32fe18e78b98fe3bb7786838cf00afdbfa --- firmware/App/HDCommon.h (.../HDCommon.h) (revision 9d7ad180a18e29ba08bf65228d61b6179ddbfcca) +++ firmware/App/HDCommon.h (.../HDCommon.h) (revision 94895e32fe18e78b98fe3bb7786838cf00afdbfa) @@ -28,7 +28,8 @@ #define DEBUG_ENABLED 1 #define DISABLE_CRC_ERROR 1 #define DISABLE_MOTOR_CURRENT_ERRORS 1 - #define SHOW_RAW_FLOW_VALUES 1 + #define SHOW_LOAD_CELL_IN_ROTOR_RPM 1 +// #define SHOW_RAW_FLOW_VALUES 1 #ifdef DEBUG_ENABLED #include Index: firmware/App/Modes/Dialysis.c =================================================================== diff -u -r2b6dfea004f84ed54559fb49c4facfc1bfb0c303 -r94895e32fe18e78b98fe3bb7786838cf00afdbfa --- firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision 2b6dfea004f84ed54559fb49c4facfc1bfb0c303) +++ firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision 94895e32fe18e78b98fe3bb7786838cf00afdbfa) @@ -153,12 +153,13 @@ void startDialysis( void ) { U32 tempDPORate = (setDialysateFlowRate * 6) / 10; // TODO - temporary fudge factor - remove later + lastUFTimeStamp = getMSTimerCount(); setDialOutUFVolumes( refUFVolume, measUFVolume ); setBloodPumpTargetFlowRate( setBloodFlowRate, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_OPEN_LOOP ); setDialInPumpTargetFlowRate( setDialysateFlowRate, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_OPEN_LOOP ); - // setDialOutPumpTargetRate( setDialysateFlowRate + FLOAT_TO_INT_WITH_ROUND( setUFRate ), MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); // TODO - restore later - setDialOutPumpTargetRate( tempDPORate + FLOAT_TO_INT_WITH_ROUND( setUFRate ), MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); // TODO - test code - remove later + // setDialOutPumpTargetRate( setDialysateFlowRate + (S32)setUFRate), MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); // TODO - restore later + setDialOutPumpTargetRate( tempDPORate + (S32)setUFRate, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); // TODO - test code - remove later // TODO - Heparin pump } @@ -493,7 +494,7 @@ { F32 uFMeasRatePerHr = measUFVolume - lastUFVolumeChecked; F32 uFSetRatePerHr = ( setUFRate * (F32)MIN_PER_HOUR ); - F32 uFRateError = uFSetRatePerHr - uFMeasRatePerHr; + F32 uFRateError = FABS( uFSetRatePerHr - uFMeasRatePerHr ); // check UF accuracy if ( uFRateError > (F32)MAX_UF_ACCURACY_ERROR_ML_PER_HR ) Index: firmware/App/Services/AlarmMgmt.c =================================================================== diff -u -r2e6c750c202b7361d79488ce383e34f380e75413 -r94895e32fe18e78b98fe3bb7786838cf00afdbfa --- firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision 2e6c750c202b7361d79488ce383e34f380e75413) +++ firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision 94895e32fe18e78b98fe3bb7786838cf00afdbfa) @@ -196,7 +196,7 @@ updateAlarmsSilenceStatus(); setAlarmLampAndAudio(); // publish alarm status at interval - if ( ++alarmStatusPublicationTimerCounter > getPublishAlarmStatusInterval() ) + if ( ++alarmStatusPublicationTimerCounter >= getPublishAlarmStatusInterval() ) { broadcastAlarmStatus( alarmStatus ); alarmStatusPublicationTimerCounter = 0; Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -r04334ed8d1e927939718b1d62fb01afef0a2b9a9 -r94895e32fe18e78b98fe3bb7786838cf00afdbfa --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 04334ed8d1e927939718b1d62fb01afef0a2b9a9) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 94895e32fe18e78b98fe3bb7786838cf00afdbfa) @@ -1120,6 +1120,10 @@ handleChangeUFSettingsConfirmation( message ); break; + case MSG_ID_USER_TREATMENT_TIME_CHANGE_REQUEST: + handleChangeTreatmentDurationRequest( message ); + break; + case MSG_ID_TESTER_LOGIN_REQUEST: handleTesterLogInRequest( message ); break;