Index: firmware/App/Controllers/ConductivitySensors.c =================================================================== diff -u -r5109bb981cab2025fcb9de33e303d046085efa18 -rdae35bc588959c0205d2cb90c25be1e1d5c32de7 --- firmware/App/Controllers/ConductivitySensors.c (.../ConductivitySensors.c) (revision 5109bb981cab2025fcb9de33e303d046085efa18) +++ firmware/App/Controllers/ConductivitySensors.c (.../ConductivitySensors.c) (revision dae35bc588959c0205d2cb90c25be1e1d5c32de7) @@ -14,7 +14,8 @@ * @date (original) 13-Jul-2020 * ***************************************************************************/ -#include // Used for calculating the polynomial calibration equation. +#include // Used for calculating the polynomial calibration equation. +#include // For memcpy #include "ConductivitySensors.h" #include "FPGA.h" Index: firmware/App/Controllers/FlowSensors.c =================================================================== diff -u -r6a9ed8dcd069dc5a06974e235c4dd0f35795888c -rdae35bc588959c0205d2cb90c25be1e1d5c32de7 --- firmware/App/Controllers/FlowSensors.c (.../FlowSensors.c) (revision 6a9ed8dcd069dc5a06974e235c4dd0f35795888c) +++ firmware/App/Controllers/FlowSensors.c (.../FlowSensors.c) (revision dae35bc588959c0205d2cb90c25be1e1d5c32de7) @@ -16,6 +16,7 @@ ***************************************************************************/ #include +#include // For memcpy #include "ConcentratePumps.h" #include "FlowSensors.h" Index: firmware/App/Controllers/Heaters.c =================================================================== diff -u -r2bf612eeb70204a5ca65697b9054948919b854b7 -rdae35bc588959c0205d2cb90c25be1e1d5c32de7 --- firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision 2bf612eeb70204a5ca65697b9054948919b854b7) +++ firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision dae35bc588959c0205d2cb90c25be1e1d5c32de7) @@ -694,13 +694,12 @@ // Update the calculated target temperature // Reset the duty cycle since the reservoir has been switched + // Cap the minimum duty cycle. So if it is calculated to negative, set it to 0 heatersStatus[ heater ].calculatedTemperatureC = currentTemperature; heatersStatus[ heater ].inactiveRsrvr = getInactiveReservoir(); heatersStatus[ heater ].targetFlowLPM = targetFlowLPM; heatersStatus[ heater ].isThisFirstControl = TRUE; - - // Cap the minimum duty cycle. So if it is calculated to negative, set it to 0 - heatersStatus[ heater ].dutyCycle.data = MAX( dutyCycle, HEATERS_MIN_DUTY_CYCLE ); + heatersStatus[ heater ].dutyCycle.data = MAX( dutyCycle, HEATERS_MIN_DUTY_CYCLE ); setHeaterDutyCycle( heater ); return state; @@ -723,7 +722,7 @@ U32 controlInterval = ( TRUE == heatersStatus[ heater ].isThisFirstControl ? TRIMMER_HEATER_INITIAL_CONTROL_INTERVAL_COUNT : TRIMMER_HEATER_CONTROL_INTERVAL_COUNT ); - // If the inactive reservoir has changed from the last run or the target dialysate flow has changed, transition to ramp state to recalculate the + // If the inactive reservoir has changed from the last run, transition to ramp state to recalculate the // duty cycle for the next delivery if ( heatersStatus[ heater ].inactiveRsrvr != getInactiveReservoir() ) { @@ -732,7 +731,8 @@ else if ( ( ++heatersStatus[ heater ].controlIntervalCounter > controlInterval ) || ( fabs( heatersStatus[ heater ].prevDiaTargetFlowLPM - targetFlowLPM ) > NEARLY_ZERO ) ) { - // Reset the control counter + // Check if it is time for another control interval or the current target flow is different from the previous flow and + // we need to reset the control counter heatersStatus[ heater ].controlIntervalCounter = 0; heatersStatus[ heater ].isThisFirstControl = FALSE; @@ -744,6 +744,8 @@ if ( fabs( heatersStatus[ heater ].prevDiaTargetFlowLPM - targetFlowLPM ) > NEARLY_ZERO ) { + // If the current flow is different from the previous flow, restart the duty cycle as the controller is restarting itself + // Set it as it is the first control so the control interval is shorter since it is the first guess with the new dialysate flow tempDutyCycle = dutyCycle; heatersStatus[ heater ].isThisFirstControl = TRUE; } @@ -989,6 +991,7 @@ data.trimmerCalcCurrentTemp = heatersStatus[ DG_TRIMMER_HEATER ].calculatedTemperatureC; data.trimmerUseLastDC = (U32)heatersStatus[ DG_TRIMMER_HEATER ].useLastDutyCycle; data.previsouFlow = heatersStatus[ DG_TRIMMER_HEATER ].prevDiaTargetFlowLPM; + data.controlCounter = heatersStatus[ DG_TRIMMER_HEATER ].controlIntervalCounter; dataPublicationTimerCounter = 0; broadcastData( MSG_ID_DG_HEATERS_DATA, COMM_BUFFER_OUT_CAN_DG_BROADCAST, (U08*)&data, sizeof( HEATERS_DATA_T ) ); Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -r5f854c6a8ca14bdfa920d7f13085a6a851983b4c -rdae35bc588959c0205d2cb90c25be1e1d5c32de7 --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision 5f854c6a8ca14bdfa920d7f13085a6a851983b4c) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision dae35bc588959c0205d2cb90c25be1e1d5c32de7) @@ -14,6 +14,7 @@ * @date (original) 06-May-2020 * ***************************************************************************/ +#include // For memcpy #include "FPGA.h" #include "MessageSupport.h" Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -r5109bb981cab2025fcb9de33e303d046085efa18 -rdae35bc588959c0205d2cb90c25be1e1d5c32de7 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 5109bb981cab2025fcb9de33e303d046085efa18) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision dae35bc588959c0205d2cb90c25be1e1d5c32de7) @@ -1212,13 +1212,15 @@ handleTestUsedBicarbVolumeMLOverrideRequest( message ); break; +#ifndef _RELEASE_ case MSG_ID_DG_GET_SW_CONFIG_RECORD: handleGetDGSoftwareConfigRecord( message ); break; case MSG_ID_DG_SET_SW_CONFIG_RECORD: handleSetDGSoftwareConfigRecord( message ); break; +#endif case MSG_ID_DG_FANS_DUTY_CYCLE_OVERRIDE: handleSetFansDutyCycleOverrideRequest( message ); Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r5109bb981cab2025fcb9de33e303d046085efa18 -rdae35bc588959c0205d2cb90c25be1e1d5c32de7 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 5109bb981cab2025fcb9de33e303d046085efa18) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision dae35bc588959c0205d2cb90c25be1e1d5c32de7) @@ -3773,6 +3773,7 @@ sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); } +#ifndef _RELEASE_ /*********************************************************************//** * @brief * The handleGetDGSoftwareConfigRecord function handles a request to get the DG @@ -3835,6 +3836,7 @@ // Respond to request sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, status ); } +#endif /*********************************************************************//** * @brief Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -r5109bb981cab2025fcb9de33e303d046085efa18 -rdae35bc588959c0205d2cb90c25be1e1d5c32de7 --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 5109bb981cab2025fcb9de33e303d046085efa18) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision dae35bc588959c0205d2cb90c25be1e1d5c32de7) @@ -396,11 +396,13 @@ // MSG_ID_DG_FANS_DUTY_CYCLE_OVERRIDE void handleSetFansDutyCycleOverrideRequest( MESSAGE_T *message ); +#ifndef _RELEASE_ // MSG_ID_DG_GET_SW_CONFIG_RECORD void handleGetDGSoftwareConfigRecord( MESSAGE_T *message ); // MSG_ID_DG_SET_SW_CONFIG_RECORD void handleSetDGSoftwareConfigRecord( MESSAGE_T *message ); +#endif // MSG_ID_DG_HD_COMMUNICATION_STATUS void handleTestHDCommunicationStatusOverrideRequest( MESSAGE_T *message );