Index: firmware/App/Modes/ModeFill.c =================================================================== diff -u -rb1dc3df084a8517ca1575bdbf741fecd96d56a12 -ra3e3feea8cfb6a1e0137bf09031f0484a3c73332 --- firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision b1dc3df084a8517ca1575bdbf741fecd96d56a12) +++ firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision a3e3feea8cfb6a1e0137bf09031f0484a3c73332) @@ -54,15 +54,15 @@ #define CONDUCTIVITY_ERROR_PERSISTENCE_PERIOD_MS ( 5 * MS_PER_SECOND ) ///< Persistence period for conductivity error. -/// Multiplier to conver flow (mL/min) into volume (mL) for period of general task interval. +/// Multiplier to convert flow (L/min) into volume (mL) for period of general task interval. static const F32 RO_FLOW_INTEGRATOR = ( ( ML_PER_LITER * TASK_GENERAL_INTERVAL ) / ( SEC_PER_MIN * MS_PER_SECOND ) ); // ********** private data ********** static DG_FILL_MODE_STATE_T fillState; ///< Currently active fill state. static U32 dialysateFillStartTime; ///< Current time when starting to fill dialysate. static F32 reservoirBaseWeight; ///< Fill reservoir base weight. -static F32 totalROFlowRate; ///< Total RO flow rate over period of time. +static F32 totalROFlowRate_LPM; ///< Total RO flow rate over period of time. static U32 concentrateTestStartTime; ///< Starting time for concentrate test. // ********** private function prototypes ********** @@ -89,7 +89,7 @@ fillState = DG_FILL_MODE_STATE_START; dialysateFillStartTime = 0; reservoirBaseWeight = 0.0; - totalROFlowRate = 0.0; + totalROFlowRate_LPM = 0.0; concentrateTestStartTime = 0; initPersistentAlarm( ALARM_ID_ACID_CONDUCTIVITY_OUT_OF_RANGE, CONDUCTIVITY_ERROR_PERSISTENCE_PERIOD_MS, CONDUCTIVITY_ERROR_PERSISTENCE_PERIOD_MS ); @@ -356,7 +356,7 @@ { DG_FILL_MODE_STATE_T result = DG_FILL_MODE_STATE_DELIVER_DIALYSATE; DG_RESERVOIR_ID_T inactiveReservoir = getInactiveReservoir(); - totalROFlowRate += getMeasuredROFlowRate(); + totalROFlowRate_LPM += getMeasuredROFlowRate(); handleDialysateMixing(); @@ -372,13 +372,13 @@ // if we've reached our target fill to volume (by weight), we're done filling - go back to re-circ mode if ( hasTargetFillVolumeBeenReached( inactiveReservoir ) ) { - F32 const filledWeight = getReservoirWeight( inactiveReservoir ) - reservoirBaseWeight; - F32 const integratedVolume = totalROFlowRate * RO_FLOW_INTEGRATOR * ACID_BICARB_CONCENTRATE_ADDITION_MULTIPLER; - F32 const integratedVolumeToLoadCellReadingPercent = 1 - ( filledWeight / integratedVolume ); + F32 const filledVolume_mL = getReservoirWeight( inactiveReservoir ) - reservoirBaseWeight; + F32 const integratedVolume_mL = totalROFlowRate_LPM * RO_FLOW_INTEGRATOR * ACID_BICARB_CONCENTRATE_ADDITION_MULTIPLER; + F32 const integratedVolumeToLoadCellReadingPercent = fabs( 1 - ( filledVolume_mL / integratedVolume_mL ) ); if ( integratedVolumeToLoadCellReadingPercent > FLOW_INTEGRATED_VOLUME_CHECK_TOLERANCE ) { - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DG_FLOW_METER_CHECK_FAILURE, filledWeight, integratedVolume ); + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DG_FLOW_METER_CHECK_FAILURE, filledVolume_mL, integratedVolume_mL ); } requestNewOperationMode( DG_MODE_CIRC ); Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -rd79771ea208ebfd21a43ce0668222ca2ddf9c65b -ra3e3feea8cfb6a1e0137bf09031f0484a3c73332 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision d79771ea208ebfd21a43ce0668222ca2ddf9c65b) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision a3e3feea8cfb6a1e0137bf09031f0484a3c73332) @@ -37,9 +37,9 @@ // ********** private definitions ********** #define NUM_OF_CAN_OUT_BUFFERS 5 ///< Number of CAN buffers for transmit -#define NUM_OF_CAN_IN_BUFFERS 6 ///< Number of CAN buffers for receiving +#define NUM_OF_CAN_IN_BUFFERS 7 ///< Number of CAN buffers for receiving #ifndef DEBUG_ENABLED - #define NUM_OF_MSG_IN_BUFFERS 6 ///< Number of Msg buffers for receiving + #define NUM_OF_MSG_IN_BUFFERS 7 ///< Number of Msg buffers for receiving #else #define NUM_OF_MSG_IN_BUFFERS 8 #define SCI1_RECEIVE_DMA_REQUEST 30 Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r45fff2549ecea601f9b603f59ade225086d36e69 -ra3e3feea8cfb6a1e0137bf09031f0484a3c73332 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 45fff2549ecea601f9b603f59ade225086d36e69) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision a3e3feea8cfb6a1e0137bf09031f0484a3c73332) @@ -792,6 +792,25 @@ /*********************************************************************//** * @brief + * The handleAlarmClear function handles a clear alarm message from the HD. + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleAlarmClear( MESSAGE_T *message ) +{ + if ( message->hdr.payloadLen == sizeof( U32 ) ) + { + U32 alarmId; + + memcpy(&alarmId, message->payload, sizeof( U32 ) ); + clearAlarm( (ALARM_ID_T)alarmId ); + } +} + +/*********************************************************************//** + * @brief * The handleSetDialysateTemperatureCmd function handles a dialysate temperature * set points message from the HD. * @details Inputs: none Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -r45fff2549ecea601f9b603f59ade225086d36e69 -ra3e3feea8cfb6a1e0137bf09031f0484a3c73332 --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 45fff2549ecea601f9b603f59ade225086d36e69) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision a3e3feea8cfb6a1e0137bf09031f0484a3c73332) @@ -109,6 +109,9 @@ // MSG_ID_POWER_OFF_WARNING void handlePowerOffWarning( MESSAGE_T *message ); +// MSG_ID_ALARM_CLEARED +void handleAlarmClear( MESSAGE_T *message ); + // MSG_ID_SET_DG_DIALYSATE_TEMP_TARGETS void handleSetDialysateTemperatureCmd( MESSAGE_T *message );