Index: firmware/App/Controllers/DGInterface.c =================================================================== diff -u -ra6fc93f9d2c7231db0e93216036c6f7fff38740a -r0a61f7fa5ff6945ebc2e507d8ecb71a652c38eaa --- firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision a6fc93f9d2c7231db0e93216036c6f7fff38740a) +++ firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 0a61f7fa5ff6945ebc2e507d8ecb71a652c38eaa) @@ -1,14 +1,14 @@ /************************************************************************** * -* Copyright (c) 2020-2022 Diality Inc. - All Rights Reserved. +* Copyright (c) 2020-2023 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file DGInterface.c * -* @author (last) Dara Navaei -* @date (last) 11-Oct-2022 +* @author (last) Sean Nash +* @date (last) 08-Mar-2023 * * @author (original) Sean * @date (original) 08-Apr-2020 @@ -17,6 +17,7 @@ #include // To check for NaN +#include "Battery.h" #include "DialInFlow.h" #include "Dialysis.h" #include "DGDefs.h" @@ -37,88 +38,78 @@ // ********** private definitions ********** -#define START_DG_CMD TRUE ///< Parameter for DG start/stop command function. True = start. -#define STOP_DG_CMD FALSE ///< Parameter for DG start/stop command function. False = stop. +#define START_DG_CMD TRUE ///< Parameter for DG start/stop command function. True = start. +#define STOP_DG_CMD FALSE ///< Parameter for DG start/stop command function. False = stop. -#define SIZE_OF_LARGE_LOAD_CELL_AVG 32 ///< Large load cell moving average has 32 samples. +#define SIZE_OF_LARGE_LOAD_CELL_AVG 32 ///< Large load cell moving average has 32 samples. -#define DIALYSATE_TEMP_OUT_OF_TARGET_TOL_C 2.0F ///< Dialysate temperature out of target tolerance C. -#define DIALYSATE_TEMP_OUT_OF_TARGET_TIMEOUT_MS ( 300 * MS_PER_SECOND ) ///< Dialysate temperature out of target timeout in milliseconds. -#define DIALYSATE_TEMP_HIGH_SAFETY_LIMIT_C 46.0F ///< Dialysate high safety temperature limit in C. -#define DIALYSATE_TEMP_HIGH_SAFETY_TIMEOUT_MS ( 1 * MS_PER_SECOND ) ///< Dialysate temperature high safety timeout in milliseconds. -#define DIALYSATE_TEMP_LOW_SAFETY_LIMIT_C 42.0F ///< Dialysate low safety temperature limit in C. -#define DIALYSATE_TEMP_LOW_SAFETY_TIMEOUT_MS ( 10 * MS_PER_SECOND ) ///< Dialysate temperature low safety timeout in milliseconds. -#define DG_DATA_FRESHNESS_TIMEOUT_MS ( 3 * MS_PER_SECOND ) ///< DG data freshness timeout (in ms). +#define DIALYSATE_TEMP_OUT_OF_TARGET_TOL_C 2.0F ///< Dialysate temperature out of target tolerance C. +#define DIALYSATE_TEMP_OUT_OF_TARGET_TIMEOUT_MS ( 300 * MS_PER_SECOND ) ///< Dialysate temperature out of target timeout in milliseconds. +#define DIALYSATE_TEMP_HIGH_SAFETY_LIMIT_C 46.0F ///< Dialysate high safety temperature limit in C. +#define DIALYSATE_TEMP_HIGH_SAFETY_TIMEOUT_MS ( 1 * MS_PER_SECOND ) ///< Dialysate temperature high safety timeout in milliseconds. +#define DIALYSATE_TEMP_LOW_SAFETY_LIMIT_C 42.0F ///< Dialysate low safety temperature limit in C. +#define DIALYSATE_TEMP_LOW_SAFETY_TIMEOUT_MS ( 10 * MS_PER_SECOND ) ///< Dialysate temperature low safety timeout in milliseconds. +#define DG_DATA_FRESHNESS_TIMEOUT_MS ( 3 * MS_PER_SECOND ) ///< DG data freshness timeout (in ms). // ********** private data ********** -static const U32 DIP_LOAD_CELL_DATA_MESSAGE_ALARM_THRESHOLD = ((2 * MS_PER_SECOND) / TASK_GENERAL_INTERVAL); -static const U32 DIP_TEMPERATURE_DATA_MESSAGE_ALARM_THRESHOLD = ((2 * MS_PER_SECOND) / TASK_GENERAL_INTERVAL); -static const U32 DIP_RESERVOIRS_DATA_MESSAGE_ALARM_THRESHOLD = ((2 * MS_PER_SECOND) / TASK_GENERAL_INTERVAL); -static const U32 DIP_DG_OP_MODE_DATA_MESSAGE_ALARM_THRESHOLD = ((2 * MS_PER_SECOND) / TASK_GENERAL_INTERVAL); - -// ********** private data ********** - // 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. -// State machine states -static U32 timeStartMS = 0; // TODO is this needed? - // DG sensor data -static F32 dgDialysateTemp = 0.0; ///< Dialysate temperature reported by the DG. -static F32 dgRedundantDialysateTemp = 0.0; ///< Redundant dialysate temperature reported by the DG. -static F32 dgPrimaryTemp = 0.0; ///< Latest RO water temperature reported by the DG. -static F32 dgTrimmerTempSet = 0.0; ///< Trimmer heater target temperature commanded. -static F32 dgTrimmerTemp = 0.0; ///< Latest dialysate temperature reported by the DG. +static F32 dgDialysateTemp; ///< Dialysate temperature reported by the DG. +static F32 dgRedundantDialysateTemp; ///< Redundant dialysate temperature reported by the DG. +static F32 dgHeatDisinfectTemp; ///< Heat disinfect temperature reported by the DG. +static F32 dgTrimmerTempSet; ///< Trimmer heater target temperature commanded. /// Measured weight from load cells. static OVERRIDE_F32_T loadCellWeightInGrams[ NUM_OF_LOAD_CELLS ]; -/// Filtered (32 sample) weight of reservoirs. -static F32 lgFilteredReservoirWeightInGrams[ NUM_OF_DG_RESERVOIRS ]; -static F32 lgFilteredReservoirBackupWeightInGrams[ NUM_OF_DG_RESERVOIRS ]; +static F32 lgFilteredReservoirWeightInGrams[ NUM_OF_DG_RESERVOIRS ]; ///< Filtered (32 sample) weight of reservoirs from primary load cells. +static F32 lgFilteredReservoirBackupWeightInGrams[ NUM_OF_DG_RESERVOIRS ]; ///< Filtered (32 sample) weight of reservoirs from redundant load cells. + // Load cell filtering data static F32 lgLoadCellReadings[ NUM_OF_DG_RESERVOIRS ][ SIZE_OF_LARGE_LOAD_CELL_AVG ]; ///< Holds load cell samples for large load cell moving average. -static U32 lgLoadCellReadingsIdx = 0; ///< Index for next sample in large load cell rolling average sample array. -static F32 lgLoadCellReadingsTotal[ NUM_OF_DG_RESERVOIRS ]; ///< Rolling total - used to calc large load cell moving average. +static U32 lgLoadCellReadingsIdx = 0; ///< Index for next sample in large load cell rolling average sample array. +static F32 lgLoadCellReadingsTotal[ NUM_OF_DG_RESERVOIRS ]; ///< Rolling total - used to calc large load cell moving average. static F32 lgLoadCellBackupReadings[ NUM_OF_DG_RESERVOIRS ][ SIZE_OF_LARGE_LOAD_CELL_AVG ]; ///< Holds load cell samples for large load cell moving average. -static F32 lgLoadCellBackupReadingsTotal[ NUM_OF_DG_RESERVOIRS ]; ///< Rolling total - used to calc large load cell moving average. +static F32 lgLoadCellBackupReadingsTotal[ NUM_OF_DG_RESERVOIRS ]; ///< Rolling total - used to calc large load cell moving average. // DG Dialysate flow rate -static F32 dgDialysateFlowRateMlMin = 0.0; ///< Latest dialysate flow rate reported by the DG. -static BOOL dgDialysateFlowDataFreshFlag = FALSE; ///< Flag to signal the execDialInFlowMonitor() to process fresh flow rate data -static BOOL dgLoadCellDataFreshFlag = FALSE; ///< Flag to signal the handleLoadCellReadingsFromDG() to process fresh load cell data -static BOOL dgDialysateTemperatureDataFreshFlag = FALSE; ///< Flag to signal the handleTemperatureReadingsFromDG() to process fresh temperature data -static BOOL dgReservoirsDataFreshFlag = FALSE; ///< Flag to signal the handleDGReservoirData() to process fresh reservoirs data -static BOOL dgOpModeDataFreshFlag = FALSE; ///< Flag to signal the handleDGOpMode() to process fresh dg op mode data +static F32 dgDialysateFlowRateLMin; ///< Latest dialysate flow rate (in L/min) reported by the DG. +static F32 dgDialysateFlowRateRawLMin; ///< Latest raw dialysate flow rate (in L/min) reported by the DG. +static BOOL dgDialysateFlowDataFreshFlag = FALSE; ///< Flag to signal the execDialInFlowMonitor() to process fresh flow rate data +static BOOL dgLoadCellDataFreshFlag = FALSE; ///< Flag to signal the handleLoadCellReadingsFromDG() to process fresh load cell data +static BOOL dgDialysateTemperatureDataFreshFlag = FALSE; ///< Flag to signal the handleTemperatureReadingsFromDG() to process fresh temperature data +static BOOL dgReservoirsDataFreshFlag = FALSE; ///< Flag to signal the handleDGReservoirData() to process fresh reservoirs data +static BOOL dgOpModeDataFreshFlag = FALSE; ///< Flag to signal the handleDGOpMode() to process fresh dg op mode data // Reservoir data -static DG_RESERVOIR_ID_T dgActiveReservoir = DG_RESERVOIR_2; ///< Latest active reservoir reported by the DG. -static DG_RESERVOIR_ID_T dgActiveReservoirSet = DG_RESERVOIR_2; ///< Active reservoir commanded. +static DG_RESERVOIR_ID_T dgActiveReservoir = DG_RESERVOIR_2; ///< Latest active reservoir reported by the DG. +static DG_RESERVOIR_ID_T dgActiveReservoirSet = DG_RESERVOIR_2; ///< Active reservoir commanded. -// TODO remove below variables -static U32 dgReservoirFillVolumeTarget = 0; ///< Latest fill-to volume reported by the DG. -static U32 dgReservoirFillVolumeTargetSet = 0; ///< Fill-to volume commanded. -static U32 dgReservoirDrainVolumeTarget = 0; ///< Latest drain-to volume reported by the DG. -static U32 dgReservoirDrainVolumeTargetSet = 0; ///< Drain-to volume commanded. +static U32 dgReservoirFillVolumeTarget = 0; ///< Latest fill-to volume reported by the DG. +static U32 dgReservoirFillVolumeTargetSet = 0; ///< Fill-to volume commanded. +static U32 dgReservoirDrainVolumeTarget = 0; ///< Latest drain-to volume reported by the DG. +static U32 dgReservoirDrainVolumeTargetSet = 0; ///< Drain-to volume commanded. -static DG_DISINFECT_UI_STATES_T disinfectsStatus; ///< DG disinfects status. -static DG_MIXING_RATIOS_T dgMixingRatios; ///< DG mixing ratios. -static HEATERS_DATA_T dgHeatersData; ///< DG heaters data. -static DG_SERVICE_AND_USAGE_DATA_T dgServiceAndUsageData; ///< DG service and usage data. +static DG_DISINFECT_UI_STATES_T disinfectsStatus; ///< DG disinfects status. +static DG_MIXING_RATIOS_T dgMixingRatios; ///< DG mixing ratios. +static HEATERS_DATA_T dgHeatersData; ///< DG heaters data. +static DG_SERVICE_AND_USAGE_DATA_T dgServiceAndUsageData; ///< DG service and usage data. // DG command response -static DG_CMD_RESPONSE_T dgCmdResp[ NUM_OF_DG_COMMANDS ]; ///< Keep the latest DG command response for each command. +static DG_CMD_RESPONSE_T dgCmdResp[ NUM_OF_DG_COMMANDS ]; ///< Keep the latest DG command response for each command. // ********** private function prototypes ********** static void checkDGRestart( void ); static void checkDGTrimmerHeaterStatus( void ); +static void checkDGDataFreshness( ALARM_ID_T alarmID, BOOL *dgFreshDataFlag ); /*********************************************************************//** * @brief @@ -142,8 +133,10 @@ dgCurrentOpMode = DG_MODE_INIT; dgSubMode = 0; dgStartCommandSent = FALSE; - dgDialysateFlowRateMlMin = 0.0F; + dgDialysateFlowRateLMin = 0.0F; + dgDialysateFlowRateRawLMin = 0.0F; dgDialysateFlowDataFreshFlag = FALSE; + dgHeatDisinfectTemp = 0.0F; // initialize load cell weights for ( i = 0; i < NUM_OF_LOAD_CELLS; i++ ) @@ -201,7 +194,7 @@ * @param flag to signal the fresh data processing * @return None *************************************************************************/ -void checkDGDataFreshness( ALARM_ID_T alarmID, BOOL *dgFreshDataFlag ) +static void checkDGDataFreshness( ALARM_ID_T alarmID, BOOL *dgFreshDataFlag ) { if ( TRUE == *dgFreshDataFlag ) { @@ -233,40 +226,30 @@ *************************************************************************/ void execDGInterfaceMonitor( void ) { - // Trigger alarm if not receiving new load cell data message in timely manner - checkDGDataFreshness( ALARM_ID_HD_NEW_LOAD_CELL_DATA_MESSAGE_NOT_RECEIVE, &dgLoadCellDataFreshFlag ); + if ( isACPowerLost() != TRUE ) + { + // Trigger alarm if not receiving new load cell data message in timely manner + checkDGDataFreshness( ALARM_ID_HD_NEW_LOAD_CELL_DATA_MESSAGE_NOT_RECEIVE, &dgLoadCellDataFreshFlag ); - // Trigger alarm if not receiving new dialysate temperature data message in timely manner - checkDGDataFreshness( ALARM_ID_HD_NEW_DIALYSATE_TEMPERATURE_DATA_MESSAGE_NOT_RECEIVE, &dgDialysateTemperatureDataFreshFlag ); + // Trigger alarm if not receiving new dialysate temperature data message in timely manner + checkDGDataFreshness( ALARM_ID_HD_NEW_DIALYSATE_TEMPERATURE_DATA_MESSAGE_NOT_RECEIVE, &dgDialysateTemperatureDataFreshFlag ); - // Trigger alarm if not receiving new reservoirs data message in timely manner - checkDGDataFreshness( ALARM_ID_HD_NEW_RESERVOIRS_DATA_MESSAGE_NOT_RECEIVE, &dgReservoirsDataFreshFlag ); + // Trigger alarm if not receiving new reservoirs data message in timely manner + checkDGDataFreshness( ALARM_ID_HD_NEW_RESERVOIRS_DATA_MESSAGE_NOT_RECEIVE, &dgReservoirsDataFreshFlag ); - // Trigger alarm if not receiving new DG op mode message in timely manner - checkDGDataFreshness( ALARM_ID_HD_NEW_DG_OPERATION_MODE_MESSAGE_NOT_RECEIVE, &dgOpModeDataFreshFlag ); + // Trigger alarm if not receiving new DG op mode message in timely manner + checkDGDataFreshness( ALARM_ID_HD_NEW_DG_OPERATION_MODE_MESSAGE_NOT_RECEIVE, &dgOpModeDataFreshFlag ); - // Check to see if DG has restarted - checkDGRestart(); + // Check to see if DG has restarted + checkDGRestart(); - // Check the status of the trimmer heater - checkDGTrimmerHeaterStatus(); + // Check the status of the trimmer heater + checkDGTrimmerHeaterStatus(); + } } /*********************************************************************//** * @brief - * The dialysisResumed function initializes the reservoir re-use timer - * when dialysis is started/resumed so that dialysate usage can be tracked. - * @details Inputs: none - * @details Outputs: resUseTimer - * @return none - *************************************************************************/ -void dialysisResumed( void ) -{ - timeStartMS = getMSTimerCount(); -} - -/*********************************************************************//** - * @brief * The getDGOpMode function gets the current DG operating mode. * @details Inputs: dgCurrentOpMode * @details Outputs: none @@ -332,19 +315,34 @@ * @brief * The getDGDialysateFlowRateLMin function gets the latest dialysate flow * rate reported by the DG. - * @details Inputs: dgDialysateFlowRateMlMin + * @details Inputs: dgDialysateFlowRateLMin * @details Outputs: none * @return Latest dialysate flow rate (in L/min) reported by DG. *************************************************************************/ F32 getDGDialysateFlowRateLMin( void ) { - F32 result = dgDialysateFlowRateMlMin; + F32 result = dgDialysateFlowRateLMin; return result; } /*********************************************************************//** * @brief + * The getDGRawDialysateFlowRateLMin function gets the latest raw dialysate flow + * rate reported by the DG. + * @details Inputs: dgDialysateFlowRateRawLMin + * @details Outputs: none + * @return Latest dialysate flow rate (in L/min) reported by DG. + *************************************************************************/ +F32 getDGRawDialysateFlowRateLMin( void ) +{ + F32 result = dgDialysateFlowRateRawLMin; + + return result; +} + +/*********************************************************************//** + * @brief * The getDialysateFlowDataFreshFlag function returns a flag to indicate * if the dialysate flow rate data reported by the DG is fresh or stale data. * @details Inputs: dgDialysateFlowDataFreshFlag @@ -463,6 +461,19 @@ /*********************************************************************//** * @brief + * The getHeatDisinfectTemperatureSensorValue function gets the latest + * heat disinfect temperature sensor value. + * @details Inputs: dgDialysateTemp + * @details Outputs: none + * @return the current heat disinfect temperature sensor value + *************************************************************************/ +F32 getHeatDisinfectTemperatureSensorValue( void ) +{ + return dgHeatDisinfectTemp; +} + +/*********************************************************************//** + * @brief * The getDGDisinfectsStates function returns the DG disinfects readings. * @details Inputs: none * @details Outputs: none @@ -533,15 +544,16 @@ * @details Inputs: none * @details Outputs: dgDialysateTemp, dgRedundantDialysateTemp, * dgDialysateTemperatureDataFreshFlag - * @param temp1 dialysate temperature reported by DG - * @param temp2 redundant dialysate temperature reported by DG + * @param tdi dialysate temperature reported by DG + * @param tro redundant dialysate temperature reported by DG + * @param thd heat disinfect temperature sensor reported by DG * @return none *************************************************************************/ -void setDialysateTemperatureReadings( F32 temp1, F32 temp2 ) +void setDialysateTemperatureReadings( F32 tdi, F32 tro, F32 thd ) { - dgDialysateTemp = temp1; - dgRedundantDialysateTemp = temp2; - + dgDialysateTemp = tdi; + dgRedundantDialysateTemp = tro; + dgHeatDisinfectTemp = thd; dgDialysateTemperatureDataFreshFlag = TRUE; } @@ -578,19 +590,25 @@ * The setDialysateFlowData function sets the latest dialysate flow rate * and its freshness status. The dialysate flow data is reported by the DG. * @details Inputs: none - * @details Outputs: dgDialysateFlowRateMlMin, dgDialysateFlowDataFreshFlag - * @param flowRate latest dialysate flow rate (mL/min) reported by DG + * @details Outputs: dgDialysateFlowRateLMin, dgDialysateFlowRateRawLMin, + * dgDialysateFlowDataFreshFlag + * @param flowRates latest DG flow rates (mL/min) reported by DG * @return none *************************************************************************/ -void setDialysateFlowData( F32 flowRate ) +void setDialysateFlowData( FLOW_SENSORS_DATA_T flowRates ) { // Check if the sent value by DG is a NaN - if ( isnan( flowRate ) ) + if ( isnan( flowRates.dialysateFlowRateLPM ) ) { - flowRate = 0.0; + flowRates.dialysateFlowRateLPM = 0.0F; } + if ( isnan( flowRates.dialysateRawFlowRateLPM ) ) + { + flowRates.dialysateRawFlowRateLPM = 0.0F; + } - dgDialysateFlowRateMlMin = flowRate; + dgDialysateFlowRateLMin = flowRates.dialysateFlowRateLPM; + dgDialysateFlowRateRawLMin = flowRates.dialysateRawFlowRateLPM; dgDialysateFlowDataFreshFlag = TRUE; } @@ -694,10 +712,10 @@ * record * @return none *************************************************************************/ -void setHDVersionDGServiceRecord( HD_VERSION_DG_SERVICE_RECORD_T* data ) +void setHDVersionDGServiceRecord( DG_SERVICE_RECORD_T* data ) { dgServiceAndUsageData.isDGServiceRecordAvailable = TRUE; - memcpy( &dgServiceAndUsageData.dgServiceRecord, data, sizeof( HD_VERSION_DG_SERVICE_RECORD_T ) ); + memcpy( &dgServiceAndUsageData.dgServiceRecord, data, sizeof( DG_SERVICE_RECORD_T ) ); } /*********************************************************************//** @@ -710,10 +728,10 @@ * info * @return none *************************************************************************/ -void setHDVersionDGUsageInfo( HD_VERSION_DG_USAGE_INFO_T* data ) +void setHDVersionDGUsageInfo( DG_USAGE_INFO_RECORD_T* data ) { - dgServiceAndUsageData.isDGUsageInfoAviable = TRUE; - memcpy( &dgServiceAndUsageData.dgUsageInfo, data, sizeof( HD_VERSION_DG_USAGE_INFO_T ) ); + dgServiceAndUsageData.isDGUsageInfoAvailable = TRUE; + memcpy( &dgServiceAndUsageData.dgUsageInfo, data, sizeof( DG_USAGE_INFO_RECORD_T ) ); } /*********************************************************************//** @@ -803,14 +821,16 @@ * @param resID ID of reservoir to set as active (reservoir for HD to draw from) * @return none *************************************************************************/ -void cmdSetDGActiveReservoir( DG_RESERVOIR_ID_T resID ) +void cmdSetDGActiveReservoir( DG_SWITCH_RSRVRS_CMD_T *cmd ) { + DG_RESERVOIR_ID_T resID = (DG_RESERVOIR_ID_T)cmd->reservoirID; + if ( resID < NUM_OF_DG_RESERVOIRS ) { - dgActiveReservoirSet = resID; + dgActiveReservoirSet = resID; dgCmdResp[ DG_CMD_SWITCH_RESERVOIR ].commandID = DG_CMD_NONE; - sendDGSwitchReservoirCommand( (U32)resID ); + sendDGSwitchReservoirCommand( cmd ); } else { @@ -1088,7 +1108,6 @@ { hasCommandResp = TRUE; memcpy( cmdRespPtr, &dgCmdResp[ commandID ], sizeof( DG_CMD_RESPONSE_T ) ); - dgCmdResp[ commandID ].commandID = DG_CMD_NONE; } return hasCommandResp; @@ -1165,18 +1184,21 @@ U32 trimmerState = dgHeatersData.trimmerHeaterState; DG_OP_MODE_T dgOp = getDGOpMode(); - if ( ( DG_MODE_GENE == dgOp ) || ( DG_MODE_FILL == dgOp ) || ( DG_MODE_DRAI == dgOp ) ) + if ( isACPowerLost() != TRUE ) { - // In heat disinfect and chemical disinfect, the trimmer heater is controlled by the DG itself so no commands from HD should be sent - // regarding the trimmer heater. - if ( ( TRUE == dgTrimmerHeaterOn ) && ( HEATER_EXEC_STATE_OFF == trimmerState ) ) + if ( ( DG_MODE_GENE == dgOp ) || ( DG_MODE_FILL == dgOp ) || ( DG_MODE_DRAI == dgOp ) ) { - cmdStartDGTrimmerHeater(); + // In heat disinfect and chemical disinfect, the trimmer heater is controlled by the DG itself so no commands from HD should be sent + // regarding the trimmer heater. + if ( ( TRUE == dgTrimmerHeaterOn ) && ( HEATER_EXEC_STATE_OFF == trimmerState ) ) + { + cmdStartDGTrimmerHeater(); + } + else if ( ( FALSE == dgTrimmerHeaterOn ) && ( trimmerState != HEATER_EXEC_STATE_OFF ) ) + { + cmdStopDGTrimmerHeater(); + } } - else if ( ( FALSE == dgTrimmerHeaterOn ) && ( trimmerState != HEATER_EXEC_STATE_OFF ) ) - { - cmdStopDGTrimmerHeater(); - } } }