Index: firmware/App/Controllers/AirTrap.c =================================================================== diff -u -re2dc5254fd0a36724e817d27a21297e9f78ce4fd -r9f5f704cee369c8293cc6c5d0eeaeff3399b4568 --- firmware/App/Controllers/AirTrap.c (.../AirTrap.c) (revision e2dc5254fd0a36724e817d27a21297e9f78ce4fd) +++ firmware/App/Controllers/AirTrap.c (.../AirTrap.c) (revision 9f5f704cee369c8293cc6c5d0eeaeff3399b4568) @@ -100,10 +100,11 @@ U32 i; resetAirTrap(); - airTrapDataPublicationTimerCounter = DATA_PUBLISH_COUNTER_START_COUNT; - airTrapValveOpenAtStablePressureState = TRUE; + airPumpUpperLevelCtr = 0; + airTrapDataPublicationTimerCounter = DATA_PUBLISH_COUNTER_START_COUNT; airPumpOnDelayStartTime = getMSTimerCount(); + airTrapValveOpenAtStablePressureState = TRUE; for ( i = 0; i < NUM_OF_AIR_TRAP_LEVEL_SENSORS; i++ ) { @@ -438,7 +439,7 @@ setValveAirTrap( STATE_OPEN ); fillStartTime = getMSTimerCount(); - SEND_EVENT_WITH_2_U32_DATA( HD_EVENT_AIR_TRAP_FILL, 0, 0 ); + SEND_EVENT_WITH_2_U32_DATA( HD_EVENT_AIR_TRAP_FILL, STATE_OPEN, 0 ); result = AIR_TRAP_VALVE_OPEN_STATE; } @@ -467,6 +468,8 @@ else if ( AIR_TRAP_LEVEL_FLUID == getAirTrapLevel( AIR_TRAP_LEVEL_SENSOR_UPPER ) ) { setValveAirTrap( STATE_CLOSED ); + signalLowVenousPressureCheck(); + SEND_EVENT_WITH_2_U32_DATA( HD_EVENT_AIR_TRAP_FILL, STATE_CLOSED, 0 ); result = AIR_TRAP_VALVE_CLOSED_STATE; } return result; Index: firmware/App/Controllers/DGInterface.c =================================================================== diff -u -rcec99d45c5560214a8c911588ce66a7b1653470d -r9f5f704cee369c8293cc6c5d0eeaeff3399b4568 --- firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision cec99d45c5560214a8c911588ce66a7b1653470d) +++ firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 9f5f704cee369c8293cc6c5d0eeaeff3399b4568) @@ -25,7 +25,7 @@ #include "ModeInitPOST.h" #include "ModeTreatment.h" #include "ModeTreatmentParams.h" -#include "OperationModes.h" +#include "OperationModes.h" #include "PersistentAlarm.h" #include "SystemComm.h" #include "SystemCommMessages.h" @@ -58,12 +58,12 @@ // ********** private data ********** -// DG status -static DG_OP_MODE_T dgCurrentOpMode; ///< Current DG operation mode. +// DG status +static DG_OP_MODE_T dgCurrentOpMode; ///< Current DG operation mode. static U32 dgSubMode; ///< Current state (sub-mode) of current DG operation mode. -static BOOL dgStartCommandSent; ///< Flag indicates command to start DG has been sent. -static BOOL dgStarted; ///< Flag indicates whether we have commanded the DG to start or stop. -static BOOL dgTrimmerHeaterOn; ///< Flag indicates whether we have commanded the DG to start or stop the trimmer heater. +static BOOL dgStartCommandSent; ///< Flag indicates command to start DG has been sent. +static BOOL dgStarted; ///< Flag indicates whether we have commanded the DG to start or stop. +static BOOL dgTrimmerHeaterOn; ///< Flag indicates whether we have commanded the DG to start or stop the trimmer heater. // DG sensor data static F32 dgDialysateTemp; ///< Dialysate temperature reported by the DG. @@ -125,8 +125,8 @@ U32 i, j; // NOTE: the active reservoir is set to reservoir 1 since DG will send active reservoir 1 as active on power up - dgStarted = FALSE; - dgTrimmerHeaterOn = FALSE; + dgStarted = FALSE; + dgTrimmerHeaterOn = FALSE; dgTrimmerTempSet = 0.0F; dgTrimmerTempCheckTimerCtr = 0; dgActiveReservoirSet = DG_RESERVOIR_2; @@ -458,14 +458,14 @@ /*********************************************************************//** * @brief - * The getDialysateTemperature function gets the latest dialysate temperature. - * @details Inputs: dgDialysateTemp + * The getDGDisinfectsStates function returns the DG disinfects readings. + * @details Inputs: none * @details Outputs: none - * @return the latest dialysate temperature + * @return the current DG disinfects readings *************************************************************************/ -F32 getDialysateTemperature( void ) +DG_DISINFECT_UI_STATES_T getDGDisinfectsStates( void ) { - return dgDialysateTemp; + return disinfectsStatus; } /*********************************************************************//** @@ -509,14 +509,14 @@ /*********************************************************************//** * @brief - * The getDGDisinfectsStates function returns the DG disinfects readings. - * @details Inputs: disinfectsStatus + * The getDialysateTemperature function returns the DG dialysate temperature. + * @details Inputs: dgDialysateTemp * @details Outputs: none - * @return the current DG disinfects readings + * @return the latest dialysate temperature *************************************************************************/ -DG_DISINFECT_UI_STATES_T getDGDisinfectsStates( void ) +F32 getDialysateTemperature( void ) { - return disinfectsStatus; + return dgDialysateTemp; } /*********************************************************************//** Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -ra917bdd62000e847e992cbb0b82e706176c1b004 -r9f5f704cee369c8293cc6c5d0eeaeff3399b4568 --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision a917bdd62000e847e992cbb0b82e706176c1b004) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision 9f5f704cee369c8293cc6c5d0eeaeff3399b4568) @@ -1215,31 +1215,34 @@ maxDeviation = MAX_DEVIATION_FROM_TRAGET_IN_POS_B; } - // Check if the current position has deviated from the position it is supposed to be in - // For more than a certain amount of time. If it has, raise an alarm - // Absolute value is used for comparison to cover +/- from the commanded position - if ( abs( currentPosition - commandedPosition ) > maxDeviation ) + if ( FALSE == isACPowerLost() ) { - valvesStatus[ valve ].positionOutOfRangeCounter++; - } + // Check if the current position has deviated from the position it is supposed to be in + // For more than a certain amount of time. If it has, raise an alarm + // Absolute value is used for comparison to cover +/- from the commanded position + if ( abs( currentPosition - commandedPosition ) > maxDeviation ) + { + valvesStatus[ valve ].positionOutOfRangeCounter++; + } - if ( valvesStatus[ valve ].positionOutOfRangeCounter > MAX_POS_DEVIATION_TIME_INTERVAL_COUNTER ) - { - // If the valve's deviation from target was more than the counts for the define period of time trigger the alarm. - // Also, set the state to Idle so in the fault mode, the valve can transition to Pos C. The exec state is directly set here - // because this is a monitor function that is called in the controller function. - valvesStatus[ valve ].execState = VALVE_STATE_IDLE; - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_VALVE_POSITION_OUT_OF_RANGE, (U32)valve, currentPosition ); + if ( valvesStatus[ valve ].positionOutOfRangeCounter > MAX_POS_DEVIATION_TIME_INTERVAL_COUNTER ) + { + // If the valve's deviation from target was more than the counts for the define period of time trigger the alarm. + // Also, set the state to Idle so in the fault mode, the valve can transition to Pos C. The exec state is directly set here + // because this is a monitor function that is called in the controller function. + valvesStatus[ valve ].execState = VALVE_STATE_IDLE; + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_VALVE_POSITION_OUT_OF_RANGE, (U32)valve, currentPosition ); - if ( VALVE_POSITION_C_CLOSE == valvesStatus[ valve ].commandedPosition ) + if ( VALVE_POSITION_C_CLOSE == valvesStatus[ valve ].commandedPosition ) + { + activateSafetyShutdown(); + } + } + else if ( ( TRUE == isValveCloseToCommandedPosition( valve, commandedPositionEnum ) ) && ( valvesStatus[ valve ].positionOutOfRangeCounter > 0 ) ) { - activateSafetyShutdown(); + valvesStatus[ valve ].positionOutOfRangeCounter = 0; } } - else if ( ( TRUE == isValveCloseToCommandedPosition( valve, commandedPositionEnum ) ) && ( valvesStatus[ valve ].positionOutOfRangeCounter > 0 ) ) - { - valvesStatus[ valve ].positionOutOfRangeCounter = 0; - } } else { Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -re6471488a8342e5b23f8a4dc977980e1e442d923 -r9f5f704cee369c8293cc6c5d0eeaeff3399b4568 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision e6471488a8342e5b23f8a4dc977980e1e442d923) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 9f5f704cee369c8293cc6c5d0eeaeff3399b4568) @@ -5564,6 +5564,7 @@ if ( sizeof( TEST_OVERRIDE_PAYLOAD_T ) == message->hdr.payloadLen ) { memcpy( &payload, message->payload, sizeof( TEST_OVERRIDE_PAYLOAD_T ) ); + if ( FALSE == payload.reset ) { result = testSetBatteryRemainingCapacityOverride( payload.state.f32 ); Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -re6471488a8342e5b23f8a4dc977980e1e442d923 -r9f5f704cee369c8293cc6c5d0eeaeff3399b4568 --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision e6471488a8342e5b23f8a4dc977980e1e442d923) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 9f5f704cee369c8293cc6c5d0eeaeff3399b4568) @@ -937,9 +937,6 @@ // MSG_ID_HD_SEND_BLOOD_LEAK_EMB_MODE_RESPONSE BOOL sendBloodLeakEmbeddedModeCommandResponse( U08 cmd, U32 responseLen, U08* response ); -// MSG_ID_HD_SEND_ALARMS_COMMAND -void handleResendAllAlarmsCommand( MESSAGE_T* message ); - // MSG_ID_HD_BLOOD_PUMP_SET_PWM void handleTestBloodPumpSetPWM( MESSAGE_T* message );