I think these two conditions above the switch statement should end the state processing. So the second condition should be an else if and combined i.e. if ( ( genDialysateState != DD_GEND_DIALYSATE...
I think these two conditions above the switch statement should end the state processing.
So the second condition should be an else if and combined i.e. if ( ( genDialysateState != DD_GEND_DIALYSATE_DELIVERY_PAUSE ) && ( TRUE == areInletWaterConditionsAlarmsActive() ) ).
And then another else where the switch statement should go.
Hydraulic chamber and updating treatment settings should maybe be moved above all of this so they always happen.