Index: firmware/App/Controllers/DGInterface.c =================================================================== diff -u -r565ed0856be2fcf1443e3ec4cb8fe023b2c14db4 -r7334590e610cd1543e128ad2dbc0de17e824b619 --- firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 565ed0856be2fcf1443e3ec4cb8fe023b2c14db4) +++ firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 7334590e610cd1543e128ad2dbc0de17e824b619) @@ -16,13 +16,14 @@ ***************************************************************************/ #include "DialInFlow.h" +#include "Dialysis.h" #include "DGDefs.h" +#include "DGInterface.h" #include "ModeInitPOST.h" #include "ModeTreatment.h" #include "OperationModes.h" #include "SystemCommMessages.h" #include "Timers.h" -#include "DGInterface.h" /** * @addtogroup DGInterface @@ -222,7 +223,7 @@ // Calculate volume used from active reservoir - do not accumulate if saline bolus in progress if ( SALINE_BOLUS_STATE_IN_PROGRESS != getSalineBolusState() ) { - resUseVolumeMl += ( flowRateMlPerMs * msSinceLastVolumeCalc ); // TODO - should this calc be done and kept by Dialysis sub-mode? + resUseVolumeMl += ( flowRateMlPerMs * msSinceLastVolumeCalc ); } resUseTimer = getMSTimerCount(); @@ -491,7 +492,7 @@ } else { - activateAlarmNoData( ALARM_ID_HD_SOFTWARE_FAULT ); + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_INVALID_LOAD_CELL_ID, loadCellID ); } return result; @@ -537,7 +538,7 @@ } else { - // TODO + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_INVALID_DG_OPERATING_MODE, opMode ); } } @@ -593,8 +594,8 @@ dgReservoirDrainVolumeTarget = drainVol; } else - { - // TODO + { + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_HD_INVALID_RESERVOIR_ID, resID ); } } @@ -670,7 +671,7 @@ loadCellWeightInGrams[ LOAD_CELL_RESERVOIR_2_PRIMARY ].data = res2Primary; loadCellWeightInGrams[ LOAD_CELL_RESERVOIR_2_BACKUP ].data = res2Backup; - // feed new weight samples into filters and update moving averages + // Feed new weight samples into filters and update moving averages for ( res = DG_RESERVOIR_1; res < NUM_OF_DG_RESERVOIRS; res++ ) { F32 wt = ( res == DG_RESERVOIR_1 ? res1Primary : res2Primary ); @@ -680,6 +681,9 @@ lgFilteredReservoirWeightInGrams[ res ] = lgLoadCellReadingsTotal[ res ] / (F32)SIZE_OF_LARGE_LOAD_CELL_AVG; } lgLoadCellReadingsIdx = INC_WRAP( lgLoadCellReadingsIdx, 0, SIZE_OF_LARGE_LOAD_CELL_AVG - 1 ); + + // Update Dialysis sub-mode with new reservoir volumes + updateReservoirVolumes( res1Primary, res2Primary ); } /*********************************************************************//**