Index: firmware/App/Controllers/BloodLeak.c =================================================================== diff -u -rfb714597ad515d3774d69b94808f065788504724 -redd44135869db32d23a0c809f6107b153c34d3bd --- firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision fb714597ad515d3774d69b94808f065788504724) +++ firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision edd44135869db32d23a0c809f6107b153c34d3bd) @@ -21,6 +21,7 @@ #include "AlarmMgmt.h" #include "BloodLeak.h" +#include "DialInFlow.h" #include "FPGA.h" #include "NVDataMgmtHDRecords.h" #include "OperationModes.h" @@ -866,7 +867,7 @@ { case MODE_TREA: case MODE_SERV: - if ( FALSE == isDialysateLineInBypass() ) + if ( ( FALSE == isDialysateLineInBypass() ) && ( getTreatmentState() != TREATMENT_RECIRC_STATE ) && ( getDialysisState() != DIALYSIS_SALINE_BOLUS_STATE ) ) { if ( BLOOD_LEAK_DETECTED == getBloodLeakStatus() ) { @@ -930,7 +931,10 @@ bloodLeakStatus.data = getFPGABloodDetectProcessedStatus(); - if ( BLOOD_LEAK_NOT_DETECTED == getBloodLeakStatus() ) + // Check if the blood is not detected but at the same time the Dialin pump should be running to make sure we are in the + // blood recovery state of the treatment stop so the blood detection recovery is not done on the stagnant fluid + // NOTE: should we check of the measured flow is about 600 mL/min? + if ( ( BLOOD_LEAK_NOT_DETECTED == getBloodLeakStatus() ) && ( TRUE == isDialInPumpRunning() ) ) { if ( TRUE == didTimeout( bloodLeakRecoveryStartTimeMS, BLOOD_LEAK_DETECT_RECOVERY_MIN_TIME_MS ) ) { @@ -1764,7 +1768,6 @@ status &= ( VALVE_POSITION_C_CLOSE == getValvePosition( VDI ) ? TRUE : FALSE ); status &= ( VALVE_POSITION_C_CLOSE == getValvePosition( VDO ) ? TRUE : FALSE ); - status &= ( getMeasuredDialInPumpSpeed() <= NEARLY_ZERO ? TRUE : FALSE ); return status; } Index: firmware/App/Modes/Dialysis.c =================================================================== diff -u -rfb714597ad515d3774d69b94808f065788504724 -redd44135869db32d23a0c809f6107b153c34d3bd --- firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision fb714597ad515d3774d69b94808f065788504724) +++ firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision edd44135869db32d23a0c809f6107b153c34d3bd) @@ -1596,6 +1596,9 @@ if ( FALSE == isRequestFromTreatmentStop ) { + // The pressure window is widened to prevent pressure alarm in bypassing the dialyzer. + // The spike occurs due to bypassing VDi valve would result in all of the blood flow going through + // the dialyzer and pressure cannot go across the dialyzer. signalInitiatePressureStabilization( USE_NORMAL_STABILIZATION_PERIOD ); } Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -r736cc5b56cc9c784ab1d8fc8687a73d190c35759 -redd44135869db32d23a0c809f6107b153c34d3bd --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 736cc5b56cc9c784ab1d8fc8687a73d190c35759) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision edd44135869db32d23a0c809f6107b153c34d3bd) @@ -45,10 +45,10 @@ #include "Valves.h" #include "WatchdogMgmt.h" - /** - * @addtogroup HDInitAndPOSTMode - * @{ - */ +/** + * @addtogroup HDInitAndPOSTMode + * @{ + */ // ********** private definitions ********** @@ -77,6 +77,7 @@ static UI_VERSIONS_T uiVersion = { 0, 0, 0, 0, 0 }; ///< Version and compatibility information reported by UI. static DG_VERSIONS_T dgVersion = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; ///< Version and compatibility information reported by DG. static U32 startPOSTDelayCounter = 0; ///< Start POST delay counter. +static BOOL hasSNAndInstBeenSent; ///< Boolean flag to check whether serial number and institutional record been sent. extern U32 savedResetReasonCode; ///< Saved reset reason code from sys_startup.c. @@ -87,6 +88,8 @@ static SELF_TEST_STATUS_T execFWCompatibilityTest( void ); static SELF_TEST_STATUS_T execUITest( void ); +static void sendSerialNumberAndInstitutionalToUI( void ); + /*********************************************************************//** * @brief * The initInitAndPOSTMode function initializes the Initialize & POST Mode module. @@ -107,6 +110,7 @@ waitForUIPostTimerCtr = 0; postCompleteDelayTimerCtr = 0; startPOSTDelayCounter = 0; + hasSNAndInstBeenSent = FALSE; } /*********************************************************************//** @@ -157,6 +161,8 @@ // Ignore stop button in this mode. } + sendSerialNumberAndInstitutionalToUI(); + // Execute current POST state *Note - these switch cases must be in same order as enum HD_POST_States switch ( postState ) { @@ -609,4 +615,29 @@ return result; } +/*********************************************************************//** + * @brief + * The sendSerialNumberAndInstitutionalToUI function sends the serial number + * and institutional records to the UI unsolicited. + * @details Inputs: SNAndInstConfigSendStartTimeMS, postState + * @details Outputs: SNAndInstConfigSendStartTimeMS + * @return none + *************************************************************************/ +static void sendSerialNumberAndInstitutionalToUI( void ) +{ + if ( ( FALSE == hasSNAndInstBeenSent ) && ( postState > POST_STATE_NVDATAMGMT ) ) + { + MESSAGE_T message; + + // Create a message object with the payload length to be 0 for the institutional message + message.hdr.msgID = 0; + message.hdr.payloadLen = 0; + + handleHDSerialNumberRequest(); + handleSendInstitutionalRecordToUI( &message ); + + hasSNAndInstBeenSent = TRUE; + } +} + /**@}*/ Index: firmware/App/Modes/ModePostTreat.h =================================================================== diff -u -r736cc5b56cc9c784ab1d8fc8687a73d190c35759 -redd44135869db32d23a0c809f6107b153c34d3bd --- firmware/App/Modes/ModePostTreat.h (.../ModePostTreat.h) (revision 736cc5b56cc9c784ab1d8fc8687a73d190c35759) +++ firmware/App/Modes/ModePostTreat.h (.../ModePostTreat.h) (revision edd44135869db32d23a0c809f6107b153c34d3bd) @@ -42,8 +42,8 @@ U32 acidConcentrate; ///< Acid concentrate option U32 bicarbConcentrate; ///< Bicarbonate concentrate option - U32 potassiumConcentration; ///< Potassium concentration value in mEq/L. - U32 calciumConcentration; ///< Calcium concentration value in mEq/L. + F32 potassiumConcentration; ///< Potassium concentration value in mEq/L. + F32 calciumConcentration; ///< Calcium concentration value in mEq/L. U32 bicarbonateConcentration; ///< Bicarbonate concentration value in mEq/L. U32 sodiumConcentration; ///< Sodium concentration value in mEq/L. Index: firmware/App/Modes/ModeTreatment.c =================================================================== diff -u -rfb714597ad515d3774d69b94808f065788504724 -redd44135869db32d23a0c809f6107b153c34d3bd --- firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision fb714597ad515d3774d69b94808f065788504724) +++ firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision edd44135869db32d23a0c809f6107b153c34d3bd) @@ -1674,7 +1674,6 @@ endTreatmentAlarmResponseRequest = FALSE; } - /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/ Index: firmware/App/Modes/Rinseback.c =================================================================== diff -u -r887e9a3dfbce1255c6469d33e49afe191af21d25 -redd44135869db32d23a0c809f6107b153c34d3bd --- firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision 887e9a3dfbce1255c6469d33e49afe191af21d25) +++ firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision edd44135869db32d23a0c809f6107b153c34d3bd) @@ -38,7 +38,7 @@ // ********** private definitions ********** -#define DEFAULT_RINSEBACK_VOLUME_ML 350.0F ///< Default rinseback volume (in mL). +#define DEFAULT_RINSEBACK_VOLUME_ML 300.0F ///< Default rinseback volume (in mL). #define MAX_TOTAL_ADDITIONAL_RINSEBACK_VOLUME_ML 300.0F ///< Maximum total additional rinseback volume allowed : all additionals (in mL). #define TARGET_ADDITIONAL_RINSEBACK_VOLUME_ML 50.0F ///< Target rinseback volume for an additional volume request (in mL). #define RINSEBACK_FLOW_RATE_ADJ_ML_MIN 25 ///< Adjustment amount (in mL/min) to apply when user requests increase/decrease in flow rate. Index: firmware/App/Modes/TreatmentEnd.c =================================================================== diff -u -r887e9a3dfbce1255c6469d33e49afe191af21d25 -redd44135869db32d23a0c809f6107b153c34d3bd --- firmware/App/Modes/TreatmentEnd.c (.../TreatmentEnd.c) (revision 887e9a3dfbce1255c6469d33e49afe191af21d25) +++ firmware/App/Modes/TreatmentEnd.c (.../TreatmentEnd.c) (revision edd44135869db32d23a0c809f6107b153c34d3bd) @@ -36,6 +36,8 @@ /// Interval at which treatment end progress is to be published to UI. #define TREATMENT_END_DATA_PUBLISH_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) +/// Target flow rate for blood while waiting for user to initiate final rinseback. +#define TX_END_BP_FLOW_RATE_ML_MIN 150 /// Max time to wait for user to initiate final rinseback. static const U32 TX_END_TIMEOUT_MS = ( ( 10 * 60 * MS_PER_SECOND ) / TASK_GENERAL_INTERVAL ); @@ -147,7 +149,7 @@ setValvePosition( VBA, VALVE_POSITION_B_OPEN ); setValvePosition( VBV, VALVE_POSITION_B_OPEN ); // Start blood pump at Tx End slow flow rate - setBloodPumpTargetFlowRate( getTreatmentParameterU32( TREATMENT_PARAM_BLOOD_FLOW ), MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); + setBloodPumpTargetFlowRate( TX_END_BP_FLOW_RATE_ML_MIN, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_CLOSED_LOOP ); bloodSittingTimerCtr = 0; // Continue air trap leveling control startAirTrapControl(); Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -rfb714597ad515d3774d69b94808f065788504724 -redd44135869db32d23a0c809f6107b153c34d3bd --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision fb714597ad515d3774d69b94808f065788504724) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision edd44135869db32d23a0c809f6107b153c34d3bd) @@ -94,6 +94,11 @@ U32 enableChemicalDisinfect; ///< Enable/disable chemical disinfect. } HD_INSTITUTIONAL_LOCAL_RECORD_T; +typedef struct +{ + U08 topLevelSN[ MAX_TOP_LEVEL_SN_CHARS ]; +} LOCAL_TOP_SN_T; + // ********** private data ********** #ifndef CARTRIDGE_TEST_BUILD @@ -3335,10 +3340,6 @@ *************************************************************************/ void handleHDSerialNumberRequest( void ) { - typedef struct - { - U08 topLevelSN[ MAX_TOP_LEVEL_SN_CHARS ]; - } LOCAL_TOP_SN_T; MESSAGE_T msg; HD_SYSTEM_RECORD_T system; U08 i; @@ -3708,7 +3709,7 @@ memcpy( payloadPtr, instit, sizeof( HD_INSTITUTIONAL_LOCAL_RECORD_T ) ); // Serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer - serializeMessage( msg, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); + serializeMessage( msg, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_REQUIRED ); } /*********************************************************************//**