Index: firmware/App/Controllers/BalancingChamber.c =================================================================== diff -u -r0e2bb0e29903be865ff96ba88b5f165bf0e2ff3b -rc4e1d97e73dd863ddffe895833d209e172b5ae4a --- firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision 0e2bb0e29903be865ff96ba88b5f165bf0e2ff3b) +++ firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision c4e1d97e73dd863ddffe895833d209e172b5ae4a) @@ -113,10 +113,10 @@ static BAL_CHAMBER_EXEC_STATE_T handleBalChamberState1FillStart( void ); static BAL_CHAMBER_EXEC_STATE_T handleBalChamberConcentrateControl(void); -static BAL_CHAMBER_EXEC_STATE_T handleBalChamberState1ValvesClose( void ); +static BAL_CHAMBER_EXEC_STATE_T handleBalChamberState1FillDetectComplete( void ); static BAL_CHAMBER_EXEC_STATE_T handleBalChamberState1FillEnd(void); static BAL_CHAMBER_EXEC_STATE_T handleBalChamberState2FillStart( void ); -static BAL_CHAMBER_EXEC_STATE_T handleBalChamberState2ValvesClose( void ); +static BAL_CHAMBER_EXEC_STATE_T handleBalChamberState2FillDetectComplete( void ); static BAL_CHAMBER_EXEC_STATE_T handleBalChamberState2FillEnd(void); static BAL_CHAMBER_EXEC_STATE_T handleBalChamberStateIdle( void ); static void publishBalChamberData( void ); @@ -299,8 +299,8 @@ * @brief * The scheduleFirstCycleRelaxAfterQdApply function configures how many BC * switches still use first-cycle relaxations after a Qd timing update. - * @details One full BC cycle is two switches require two - * valve-close segments under the new timing before clearing relaxations. + * @details \b Inputs: none + * @details \b Outputs: bcSwitchingBasedOnClosedPeriodCounter * @return none *************************************************************************/ static void scheduleFirstCycleRelaxAfterQdApply( void ) @@ -384,8 +384,8 @@ balChamberExecState = handleBalChamberConcentrateControl(); break; - case BAL_CHAMBER_STATE1_VALVES_CLOSE: - balChamberExecState = handleBalChamberState1ValvesClose(); + case BAL_CHAMBER_STATE1_FILL_DETECT_COMPLETE: + balChamberExecState = handleBalChamberState1FillDetectComplete(); break; case BAL_CHAMBER_STATE1_FILL_END: @@ -400,8 +400,8 @@ balChamberExecState = handleBalChamberConcentrateControl(); break; - case BAL_CHAMBER_STATE2_VALVES_CLOSE: - balChamberExecState = handleBalChamberState2ValvesClose(); + case BAL_CHAMBER_STATE2_FILL_DETECT_COMPLETE: + balChamberExecState = handleBalChamberState2FillDetectComplete(); break; case BAL_CHAMBER_STATE2_FILL_END: @@ -723,12 +723,12 @@ { // Low-Qd spent slope: baseline = spent pressure on last dosing tick (this task period) before VALVES_CLOSE. prevSpentDialPressure = spentDialPressure; - state = BAL_CHAMBER_STATE1_VALVES_CLOSE; + state = BAL_CHAMBER_STATE1_FILL_DETECT_COMPLETE; } else { prevSpentDialPressure = spentDialPressure; - state = BAL_CHAMBER_STATE2_VALVES_CLOSE; + state = BAL_CHAMBER_STATE2_FILL_DETECT_COMPLETE; } } @@ -737,15 +737,15 @@ /*********************************************************************//** * @brief - * The handleBalChamberState1ValvesClose function check for the balancing chamber + * The handleBalChamberState1FillDetectComplete function check for the balancing chamber * fill complete and close the currently opened valves. * @details \b Inputs: currentBalChamberSwitchingCounter, spent and fresh dialysate pressure * @details \b Outputs: isPressureStalbilizedDuringFill,isBalChamberFillInProgress * @return next balancing chamber state. *************************************************************************/ -static BAL_CHAMBER_EXEC_STATE_T handleBalChamberState1ValvesClose( void ) +static BAL_CHAMBER_EXEC_STATE_T handleBalChamberState1FillDetectComplete( void ) { - BAL_CHAMBER_EXEC_STATE_T state = BAL_CHAMBER_STATE1_VALVES_CLOSE; + BAL_CHAMBER_EXEC_STATE_T state = BAL_CHAMBER_STATE1_FILL_DETECT_COMPLETE; BOOL isBothFillsComplete = FALSE; BOOL isFirstCycleNotDone = FALSE; BOOL isFillCompleteOrFirstCycle = FALSE; @@ -754,7 +754,7 @@ spentDialPressure = getFilteredPressure( D51_PRES ); // After the first BC cycle, fault if fill never completes at the Qd-based timeout. - if ( currentBalChamberFillCounter > balChamberFillTimeoutCount ) + if ( ( currentBalChamberFillCounter > balChamberFillTimeoutCount ) && ( TRUE != getTestConfigStatus( TEST_CONFIG_DD_DISABLE_BC_PRESSURE_ALARMS ) ) ) { SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_BC_FILL_TIMEOUT_FAULT, currentBalChamberFillCounter, balChamberFillTimeoutCount ); @@ -827,8 +827,6 @@ * balanceChamberSwitchingOnlyOffRequested * @details \b Alarm: ALARM_ID_DD_BC_STATE1_FILL_PRESSURE_DROP_OUT_OF_RANGE * when pressure drop is not in range during balancing chamber fill in progress. - * @details \b Alarm: ALARM_ID_DD_BC_STATE1_FILL_END_PRESSURE_OUT_OF_RANGE - * when pressure is not in range during balancing chamber fill complete. * @return next balancing chamber state. *************************************************************************/ static BAL_CHAMBER_EXEC_STATE_T handleBalChamberState1FillEnd( void ) @@ -856,14 +854,6 @@ // Move to the idle state state = BAL_CHAMBER_STATE_IDLE; } - else if ( ( TRUE != isPressureStabilizedDuringFill ) && ( TRUE != isSpentFillComplete ) ) - { - // Alarm when switching time expired, but still pressure not in range which indicates fill is not yet completed. - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE1_FILL_END_PRESSURE_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); - - // Move to the idle state - state = BAL_CHAMBER_STATE_IDLE; - } else { // Move to next state when pressure is in range. @@ -1007,15 +997,15 @@ /*********************************************************************//** * @brief - * The handleBalChamberState2ValvesClose function check for the balancing chamber + * The handleBalChamberState2FillDetectComplete function check for the balancing chamber * fill complete and close the currently opened valves. * @details \b Inputs: currentBalChamberSwitchingCounter, spent and fresh dialysate pressure * @details \b Outputs: isPressureStalbilizedDuringFill,isBalChamberFillInProgress * @return next balancing chamber state. *************************************************************************/ -static BAL_CHAMBER_EXEC_STATE_T handleBalChamberState2ValvesClose( void ) +static BAL_CHAMBER_EXEC_STATE_T handleBalChamberState2FillDetectComplete( void ) { - BAL_CHAMBER_EXEC_STATE_T state = BAL_CHAMBER_STATE2_VALVES_CLOSE; + BAL_CHAMBER_EXEC_STATE_T state = BAL_CHAMBER_STATE2_FILL_DETECT_COMPLETE; BOOL isBothFillsComplete = FALSE; BOOL isFirstCycleNotDone = FALSE; BOOL isFillCompleteOrFirstCycle = FALSE; @@ -1039,7 +1029,7 @@ } // After the first BC cycle, fault if fill never completes at the Qd-based timeout. - if ( currentBalChamberFillCounter > balChamberFillTimeoutCount ) + if ( ( currentBalChamberFillCounter > balChamberFillTimeoutCount ) && ( TRUE != getTestConfigStatus( TEST_CONFIG_DD_DISABLE_BC_PRESSURE_ALARMS ) ) ) { SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_BC_FILL_TIMEOUT_FAULT, currentBalChamberFillCounter, balChamberFillTimeoutCount ); @@ -1107,8 +1097,6 @@ * balanceChamberSwitchingOnlyOffRequested * @details \b Alarm: ALARM_ID_DD_BC_STATE2_FILL_PRESSURE_DROP_OUT_OF_RANGE * when pressure is not in range during balacing chamber state 2 fill in progress. - * @details \b Alarm: ALARM_ID_DD_BC_STATE2_FILL_END_PRESSURE_OUT_OF_RANGE - * when pressure is not in range during balacing chamber state 2 fill complete. * @return next balancing chamber state. *************************************************************************/ static BAL_CHAMBER_EXEC_STATE_T handleBalChamberState2FillEnd( void ) @@ -1136,14 +1124,6 @@ // Move to the idle state state = BAL_CHAMBER_STATE_IDLE; } - else if ( ( TRUE != isPressureStabilizedDuringFill ) && ( TRUE != isSpentFillComplete ) ) - { - // Alarm when switching time expired, but still pressure not in range which indicates fill is not completed. - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_BC_STATE2_FILL_END_PRESSURE_OUT_OF_RANGE, freshDialPressure, spentDialPressure ); - - // Move to the idle state - state = BAL_CHAMBER_STATE_IDLE; - } else { // Move to next state when pressure is in range. @@ -1559,8 +1539,7 @@ data.balChamberExecState = (U32)balChamberExecState; data.balChamberSWState = (U32)balChamberSWState; data.balChamberSWFreq = getBalChamberSwitchingFreq(); - data.balChamberSwPeriod = getD48PumpSpeedForBCFill(); - data.isBalChamberFillInProgress = isSpentFillComplete; + data.isSpentFillComplete = isSpentFillComplete; data.currentBalChamberSwitchingCounter = currentBalChamberFillCounter; data.isPressureStabilizedDuringFill = isPressureStabilizedDuringFill; data.balChamberSWOnlyState = balanceChamberSwitchingOnly; Index: firmware/App/Controllers/BalancingChamber.h =================================================================== diff -u -r8348015aa77e1ee2c4c20e9f8e2c45b59bcf3f17 -rc4e1d97e73dd863ddffe895833d209e172b5ae4a --- firmware/App/Controllers/BalancingChamber.h (.../BalancingChamber.h) (revision 8348015aa77e1ee2c4c20e9f8e2c45b59bcf3f17) +++ firmware/App/Controllers/BalancingChamber.h (.../BalancingChamber.h) (revision c4e1d97e73dd863ddffe895833d209e172b5ae4a) @@ -46,8 +46,7 @@ U32 balChamberExecState; ///< Balancing chamber execution state U32 balChamberSWState; ///< Balancing chamber switching state (state 1 or state 2) F32 balChamberSWFreq; ///< Balancing chamber switching frequency - U32 balChamberSwPeriod; ///< Balancing chamber switching period - BOOL isBalChamberFillInProgress; ///< Whether balancing chamber fill in progress or not + BOOL isSpentFillComplete; ///< Whether balancing chamber spent fill completed or not U32 currentBalChamberSwitchingCounter; ///< Current balancing chamber switching counter BOOL isPressureStabilizedDuringFill; ///< Whether pressure stabilized during fill or not BOOL balChamberSWOnlyState; ///< Balancing chamber switching only status ( On/Off) Index: firmware/App/Controllers/ConcentratePumps.c =================================================================== diff -u -rbdf2c733a764466fcc4a0ff4938f5c97456bdb77 -rc4e1d97e73dd863ddffe895833d209e172b5ae4a --- firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision bdf2c733a764466fcc4a0ff4938f5c97456bdb77) +++ firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision c4e1d97e73dd863ddffe895833d209e172b5ae4a) @@ -852,8 +852,8 @@ concentratePumps[ pumpId ].currentPumpSpeed = 0.0F; // set target rate to zero pumpTargetSpeed[ pumpId ].data = 0.0F; pumpTargetRevCnt[ pumpId ].data = 0; - measuredPumpSpeed[ pumpId ].data = 0.0F; - concentratePumps[ pumpId ].pulseWidthUS = 0.0F; + measuredPumpSpeed[ pumpId ].data = 0.0F; + concentratePumps[ pumpId ].pulseWidthUS = 0.0F; isDosingCompleted [ pumpId ] = TRUE; // Disable the motor when stopping, to take next revolution count Index: firmware/App/DDCommon.h =================================================================== diff -u -r20aba5b5bb7c758e8f565458e7a74faa8ba12ddd -rc4e1d97e73dd863ddffe895833d209e172b5ae4a --- firmware/App/DDCommon.h (.../DDCommon.h) (revision 20aba5b5bb7c758e8f565458e7a74faa8ba12ddd) +++ firmware/App/DDCommon.h (.../DDCommon.h) (revision c4e1d97e73dd863ddffe895833d209e172b5ae4a) @@ -39,8 +39,8 @@ //Uncomment below if barometric pressure sensor reading available //#define __BARO_PRES_SENSOR__ 1 -//Uncomment below if TD is integrated with DD -#define ENABLE_ALARM_1 +//Uncomment below to disable the communication to dialin for blood leak embedded mode +//#define __BLOOD_LEAK_EMB_MODE_RESPONSE_DISABLED__ 1 //Uncomment below once characterization/study completed //#define ENABLE_ALARM_2 @@ -57,14 +57,14 @@ // comment below to disable bicarb multi level sensor for time based chamber F fill #define CONDUCTIVE_LEVEL_SENSOR_ENABLED 1 -//Uncomment below to enable d30 heater alarm(as all units are not equipped with d30 temp sensor) -//#define ENABLE_ALARM_3 +//Uncomment below to disable d30 heater alarm(as all units are not equipped with d30 temp sensor) +//#define __D30_TEMPERATURE_DISABLED__ -//Comment below to disable the DD too-many-bad-message-CRCs alarm. -#define __BAD_MSG_CRC_ALARM_ENABLED__ 1 +//Uncomment below to disable the DD too-many-bad-message-CRCs alarm. +//#define __BAD_MSG_CRC_ALARM_DISABLED__ 1 -//Comment below to disable the conductivity sensor alarms -#define ENABLE_ALARM_4 +//Uncomment below to disable the conductivity sensor alarms +//#define __CONDUCTIVITY_SENSOR_ALARMS_DISABLED__ #include Index: firmware/App/Drivers/BloodLeakDriver.c =================================================================== diff -u -recd204503f9f4837800080a58c07dac8a2e8d602 -rc4e1d97e73dd863ddffe895833d209e172b5ae4a --- firmware/App/Drivers/BloodLeakDriver.c (.../BloodLeakDriver.c) (revision ecd204503f9f4837800080a58c07dac8a2e8d602) +++ firmware/App/Drivers/BloodLeakDriver.c (.../BloodLeakDriver.c) (revision c4e1d97e73dd863ddffe895833d209e172b5ae4a) @@ -1008,10 +1008,8 @@ response.responseLen = responseLen; memcpy( response.responseBuffer, responseBuffer, responseLen ); -#ifndef ENABLE_ALARM_1 - // TO0: Uncomment once TD is integrated +#ifndef __BLOOD_LEAK_EMB_MODE_RESPONSE_DISABLED__ result = sendMessage( MSG_ID_DD_SEND_BLOOD_LEAK_EMB_MODE_RESPONSE, COMM_BUFFER_OUT_DD_CAN_PC, (U08*)&response, sizeof( BLOOD_LEAK_EMB_MODE_RESP_T ) ); - #endif return result; Index: firmware/App/Drivers/ConductivitySensors.c =================================================================== diff -u -rbdf2c733a764466fcc4a0ff4938f5c97456bdb77 -rc4e1d97e73dd863ddffe895833d209e172b5ae4a --- firmware/App/Drivers/ConductivitySensors.c (.../ConductivitySensors.c) (revision bdf2c733a764466fcc4a0ff4938f5c97456bdb77) +++ firmware/App/Drivers/ConductivitySensors.c (.../ConductivitySensors.c) (revision c4e1d97e73dd863ddffe895833d209e172b5ae4a) @@ -555,7 +555,7 @@ if ( ++conductivitySensorStatus[ sensorId ].interalCondErrorCount > MAX_ALLOWED_UNCHANGED_CONDUCTIVITY_READS ) { //TODO: restore once conductivity sensor are calibrated and working -#ifndef ENABLE_ALARM_4 +#ifdef __CONDUCTIVITY_SENSOR_ALARMS_DISABLED__ SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, sensorId ) #endif } @@ -571,7 +571,7 @@ if ( ++conductivitySensorStatus[ sensorId ].interalTempErrorCount > MAX_ALLOWED_UNCHANGED_CONDUCTIVITY_READS ) { //TODO: restore once conductivity sensor are calibrated and working -#ifndef ENABLE_ALARM_4 +#ifdef __CONDUCTIVITY_SENSOR_ALARMS_DISABLED__ SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, sensorId ) #endif } @@ -582,7 +582,7 @@ if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_CONDUCTIVITY_SENSOR_ERROR ) ) { //TODO: restore once conductivity sensor are calibrated and working -#ifndef ENABLE_ALARM_4 +#ifdef __CONDUCTIVITY_SENSOR_ALARMS_DISABLED__ SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, sensorId ) #endif } @@ -702,7 +702,7 @@ if ( FALSE == result ) { //TODO: restore once conductivity sensor are calibrated and working -#ifndef ENABLE_ALARM_4 +#ifdef __CONDUCTIVITY_SENSOR_ALARMS_DISABLED__ SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, sensorId, ( U32 )idx ) #endif } Index: firmware/App/Monitors/Level.c =================================================================== diff -u -r20aba5b5bb7c758e8f565458e7a74faa8ba12ddd -rc4e1d97e73dd863ddffe895833d209e172b5ae4a --- firmware/App/Monitors/Level.c (.../Level.c) (revision 20aba5b5bb7c758e8f565458e7a74faa8ba12ddd) +++ firmware/App/Monitors/Level.c (.../Level.c) (revision c4e1d97e73dd863ddffe895833d209e172b5ae4a) @@ -28,6 +28,7 @@ */ // ********** private definitions ********** + #define LEVEL_SENSOR_LIQUID 0U ///< Level sensor digital low value (0 = liquid is detected, 1 = no liquid). #define FPGA_B1_HW_LEVEL_LOW 5 ///< Floater low level status for Beta 1.0 #define FPGA_B1_HW_LEVEL_MEDIUM 4 ///< Floater medium level status for Beta 1.0 Index: firmware/App/Monitors/Temperature.c =================================================================== diff -u -recd204503f9f4837800080a58c07dac8a2e8d602 -rc4e1d97e73dd863ddffe895833d209e172b5ae4a --- firmware/App/Monitors/Temperature.c (.../Temperature.c) (revision ecd204503f9f4837800080a58c07dac8a2e8d602) +++ firmware/App/Monitors/Temperature.c (.../Temperature.c) (revision c4e1d97e73dd863ddffe895833d209e172b5ae4a) @@ -382,7 +382,7 @@ *************************************************************************/ void checkDialysateTemperatureSensors( void ) { -#ifdef ENABLE_ALARM_3 +#ifndef __D30_TEMPERATURE_DISABLED__ DD_OP_MODE_T op = getCurrentOperationMode(); if ( ( DD_MODE_GEND == op ) || ( DD_MODE_HEAT == op ) ) Index: firmware/App/Services/AlarmMgmtDD.c =================================================================== diff -u -rbd78b07f061229369635c34995fab1068dce32aa -rc4e1d97e73dd863ddffe895833d209e172b5ae4a --- firmware/App/Services/AlarmMgmtDD.c (.../AlarmMgmtDD.c) (revision bd78b07f061229369635c34995fab1068dce32aa) +++ firmware/App/Services/AlarmMgmtDD.c (.../AlarmMgmtDD.c) (revision c4e1d97e73dd863ddffe895833d209e172b5ae4a) @@ -116,7 +116,7 @@ if ( TRUE == isTransitionToFaultRequired() ) { // If alarm is a DD fault and the alarm manager can transition to fault immediately, go to fault mode - //requestNewOperationMode( DD_MODE_FAUL ); + requestNewOperationMode( DD_MODE_FAUL ); } } if ( ( TRUE == props.alarmIsDDFault ) && ( ALM_SRC_FP == props.alarmSource ) ) Index: firmware/App/Services/SystemCommDD.c =================================================================== diff -u -rbdf2c733a764466fcc4a0ff4938f5c97456bdb77 -rc4e1d97e73dd863ddffe895833d209e172b5ae4a --- firmware/App/Services/SystemCommDD.c (.../SystemCommDD.c) (revision bdf2c733a764466fcc4a0ff4938f5c97456bdb77) +++ firmware/App/Services/SystemCommDD.c (.../SystemCommDD.c) (revision c4e1d97e73dd863ddffe895833d209e172b5ae4a) @@ -92,7 +92,7 @@ initSystemComm(); //TODO: Restore this as this was system specific -#ifndef __BAD_MSG_CRC_ALARM_ENABLED__ +#ifndef __BAD_MSG_CRC_ALARM_DISABLED__ // initialize bad message CRC time windowed count initTimeWindowedCount( TIME_WINDOWED_COUNT_BAD_MSG_CRC, MAX_COMM_CRC_FAILURES, MAX_COMM_CRC_FAILURE_WINDOW_MS ); #endif @@ -272,7 +272,7 @@ void checkTooManyBadMsgCRCs( void ) { //TODO: Remove this as this was my current system specific. -#ifdef __BAD_MSG_CRC_ALARM_ENABLED__ +#ifdef __BAD_MSG_CRC_ALARM_DISABLED__ if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_BAD_MSG_CRC ) ) { SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DD_COMM_TOO_MANY_BAD_CRCS, 2 ); // 2 for DD