Index: firmware/App/Controllers/DrainPump.c =================================================================== diff -u -r025612ad77fe630889a364586de54bffe5262d56 -r44222e803e04d057ab793ce6b72902b8bfe9b7d0 --- firmware/App/Controllers/DrainPump.c (.../DrainPump.c) (revision 025612ad77fe630889a364586de54bffe5262d56) +++ firmware/App/Controllers/DrainPump.c (.../DrainPump.c) (revision 44222e803e04d057ab793ce6b72902b8bfe9b7d0) @@ -118,7 +118,7 @@ static DRAIN_PUMP_STATE_T pendingDrainPumpCmd = DRAIN_PUMP_OFF_STATE; ///< Delayed (pending) drain pump command. static F32 pendingDrainPumpCmdTarget = 0.0; ///< Delayed (pending) drain pump command target (rpm or PSI depending on command). static U32 pendingDrainPumpCmdCountDown = 0; ///< Delayed (pending) drain pump command count down timer (in task intervals). -static F32 targetFlushLineVolume_L = 0.0; ///< Target flush volume in liters. +static DG_DRAIN_LINE_VOLUME_T drainLineVolumeRecord; /// ADC to RPM conversion coefficient or RPM to ADC conversion. static const F32 CONVERSION_COEFF = SEC_PER_MIN / ( 2 * TOGGLE_PERIOD_RESOLUTION_SECONDS * ROTATIONAL_TO_TOGGLE_PERIOD_CONVERSION ); @@ -130,22 +130,19 @@ static DRAIN_PUMP_STATE_T handleDrainPumpOpenLoopState( void ); static void stopDrainPump( void ); static void publishDrainPumpData( void ); -static BOOL processCalibrationData( void ); /*********************************************************************//** * @brief * The initDrainPump function initializes the DrainPump module. * @details Inputs: none - * @details Outputs: hasClosedLoopBeenRequested, targetFlushLineVolume_L, - * signalNewRPMRequest + * @details Outputs: hasClosedLoopBeenRequested, signalNewRPMRequest * @return none *************************************************************************/ void initDrainPump( void ) { stopDrainPump(); hasClosedLoopBeenRequested = FALSE; - targetFlushLineVolume_L = 0.0; signalNewRPMRequest = FALSE; // Initialize the drain pump PI controller @@ -379,6 +376,14 @@ *************************************************************************/ void execDrainPumpController( void ) { + // Check if a new calibration is available + if ( TRUE == isNewCalibrationRecordAvailable() ) + { + // This is only one record the number of items to check is 0 since the get NV data function does not do a for loop to check the calibration time + getNVRecord2Driver( GET_CAL_DRAIN_LINE_VOLUME_RECORD, (U08*)&drainLineVolumeRecord, sizeof( DG_DRAIN_LINE_VOLUME_T ), 0, + ALARM_ID_DG_DRAIN_LINE_VOLUME_INVALID_CAL_RECORD ); + } + // Handle pending drain pump command if ( pendingDrainPumpCmdCountDown > 0 ) { @@ -440,7 +445,9 @@ { SELF_TEST_STATUS_T result = SELF_TEST_STATUS_IN_PROGRESS; - BOOL calStatus = processCalibrationData(); + // This is only one record the number of items to check is 0 since the get NV data function does not do a for loop to check the calibration time + BOOL calStatus = getNVRecord2Driver( GET_CAL_DRAIN_LINE_VOLUME_RECORD, (U08*)&drainLineVolumeRecord, sizeof( DG_DRAIN_LINE_VOLUME_T ), 0, + ALARM_ID_DG_DRAIN_LINE_VOLUME_INVALID_CAL_RECORD ); if ( TRUE == calStatus ) { @@ -514,14 +521,15 @@ /*********************************************************************//** * @brief - * The getFlushLineVolume function returns the target flush line volume. - * @details Inputs: targetFlushLineVolume_L + * The getFlushLineVolumeL function returns the target flush line volume in + * liters. + * @details Inputs: drainLineVolumeRecord * @details Outputs: none * @return the target flush line volume in Liter *************************************************************************/ -F32 getFlushLineVolume( void ) +F32 getFlushLineVolumeL( void ) { - return targetFlushLineVolume_L; + return drainLineVolumeRecord.volume; } /*********************************************************************//** @@ -663,39 +671,7 @@ } } -/*********************************************************************//** - * @brief - * The processCalibrationData function gets the calibration data and makes - * sure it is valid by checking the calibration date. The calibration date - * should not be 0. - * @details Inputs: none - * @details Outputs: modeRecircTargetFlushVolL - * @return TRUE if the calibration record is valid, otherwise FALSE - *************************************************************************/ -static BOOL processCalibrationData( void ) -{ - BOOL status = TRUE; - // Get the calibration record from NVDataMgmt - DG_DRAIN_LINE_VOLUME_T calData = getDGDrainLineVolumeRecord(); - - // Check if the calibration data that was received from NVDataMgmt is legitimate - // The calibration date item should not be zero. If the calibration date is 0, - // then the data is not stored in the NV memory or it was corrupted. - if ( 0 == calData.calibrationTime ) - { -#ifndef SKIP_CAL_CHECK - activateAlarmNoData( ALARM_ID_DG_DRAIN_LINE_VOLUME_INVALID_CAL_RECORD ); - status = FALSE; -#endif - } - - // The calibration data was valid, update the local copy - targetFlushLineVolume_L = calData.volume; - - return status; -} - /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/ Index: firmware/App/Controllers/DrainPump.h =================================================================== diff -u -r025612ad77fe630889a364586de54bffe5262d56 -r44222e803e04d057ab793ce6b72902b8bfe9b7d0 --- firmware/App/Controllers/DrainPump.h (.../DrainPump.h) (revision 025612ad77fe630889a364586de54bffe5262d56) +++ firmware/App/Controllers/DrainPump.h (.../DrainPump.h) (revision 44222e803e04d057ab793ce6b72902b8bfe9b7d0) @@ -68,7 +68,7 @@ BOOL isDrainPumpOn( void ); -F32 getFlushLineVolume( void ); +F32 getFlushLineVolumeL( void ); BOOL testSetDrainPumpDataPublishIntervalOverride( U32 value ); BOOL testResetDrainPumpDataPublishIntervalOverride( void ); Index: firmware/App/Controllers/Fans.c =================================================================== diff -u -r025612ad77fe630889a364586de54bffe5262d56 -r44222e803e04d057ab793ce6b72902b8bfe9b7d0 --- firmware/App/Controllers/Fans.c (.../Fans.c) (revision 025612ad77fe630889a364586de54bffe5262d56) +++ firmware/App/Controllers/Fans.c (.../Fans.c) (revision 44222e803e04d057ab793ce6b72902b8bfe9b7d0) @@ -518,14 +518,15 @@ { FANS_DATA_T fansData; - fansData.dutyCycle = fansStatus.dutyCycle * FRACTION_TO_PERCENT_FACTOR; - fansData.targetFansRPM = fansStatus.targetRPM; - fansData.fanInlet1RPM = getMeasuredFanRPM( FAN_INLET_1 ); - fansData.fanInlet2RPM = getMeasuredFanRPM( FAN_INLET_2 ); - fansData.fanInlet3RPM = getMeasuredFanRPM( FAN_INLET_3 ); - fansData.fanOutlet1RPM = getMeasuredFanRPM( FAN_OUTLET_1 ); - fansData.fanOutlet2RPM = getMeasuredFanRPM( FAN_OUTLET_2 ); - fansData.fanOutlet3RPM = getMeasuredFanRPM( FAN_OUTLET_3 ); + fansData.dutyCycle = fansStatus.dutyCycle * FRACTION_TO_PERCENT_FACTOR; + fansData.targetFansRPM = fansStatus.targetRPM; + fansData.fanInlet1RPM = getMeasuredFanRPM( FAN_INLET_1 ); + fansData.fanInlet2RPM = getMeasuredFanRPM( FAN_INLET_2 ); + fansData.fanInlet3RPM = getMeasuredFanRPM( FAN_INLET_3 ); + fansData.fanOutlet1RPM = getMeasuredFanRPM( FAN_OUTLET_1 ); + fansData.fanOutlet2RPM = getMeasuredFanRPM( FAN_OUTLET_2 ); + fansData.fanOutlet3RPM = getMeasuredFanRPM( FAN_OUTLET_3 ); + fansData.rpmAlarmTimeOffset = getRPMAlarmStartTimeOffset(); broadcastData( MSG_ID_DG_FANS_DATA, COMM_BUFFER_OUT_CAN_DG_BROADCAST, (U08*)&fansData, sizeof( FANS_DATA_T ) ); Index: firmware/App/Controllers/Fans.h =================================================================== diff -u -r025612ad77fe630889a364586de54bffe5262d56 -r44222e803e04d057ab793ce6b72902b8bfe9b7d0 --- firmware/App/Controllers/Fans.h (.../Fans.h) (revision 025612ad77fe630889a364586de54bffe5262d56) +++ firmware/App/Controllers/Fans.h (.../Fans.h) (revision 44222e803e04d057ab793ce6b72902b8bfe9b7d0) @@ -51,6 +51,7 @@ F32 fanOutlet1RPM; ///< Fan outlet 1 RPM F32 fanOutlet2RPM; ///< Fan outlet 2 RPM F32 fanOutlet3RPM; ///< Fan outlet 3 RPM + U32 rpmAlarmTimeOffset; ///< RPM alarm time offset } FANS_DATA_T; void initFans( void ); Index: firmware/App/Controllers/TemperatureSensors.c =================================================================== diff -u -r025612ad77fe630889a364586de54bffe5262d56 -r44222e803e04d057ab793ce6b72902b8bfe9b7d0 --- firmware/App/Controllers/TemperatureSensors.c (.../TemperatureSensors.c) (revision 025612ad77fe630889a364586de54bffe5262d56) +++ firmware/App/Controllers/TemperatureSensors.c (.../TemperatureSensors.c) (revision 44222e803e04d057ab793ce6b72902b8bfe9b7d0) @@ -127,6 +127,7 @@ static U32 dataPublicationTimerCounter; ///< Temperature sensors data publish timer counter. static OVERRIDE_U32_T tempSensorsPublishInterval = { TEMP_SENSORS_DATA_PUBLISH_INTERVAL, TEMP_SENSORS_DATA_PUBLISH_INTERVAL, 0, 0 }; ///< Temperature sensors publish time interval override. +static DG_TEMP_SENSORS_CAL_RECORD_T tempSensorCalRecord; ///< Temperature sensors calibration record. static const F32 POSITIVE_TC_EXP_A0 = 0.118597600000E0; ///< K TC positive temperature exponent coefficient A0. static const F32 POSITIVE_TC_EXP_A1 = -0.118343200000E-3; ///< K TC positive temperature exponent coefficient A1. @@ -297,14 +298,21 @@ *************************************************************************/ SELF_TEST_STATUS_T execTemperatureSensorsSelfTest( void ) { - SELF_TEST_STATUS_T status = SELF_TEST_STATUS_IN_PROGRESS; + SELF_TEST_STATUS_T result = SELF_TEST_STATUS_IN_PROGRESS; - // TODO implement the calibration processing function. - // It returns a pass for now + BOOL calStatus = getNVRecord2Driver( GET_CAL_TEMP_SENSORS, (U08*)&tempSensorCalRecord, sizeof( DG_TEMP_SENSORS_CAL_RECORD_T ), + NUM_OF_CAL_DATA_TEMP_SENSORS, ALARM_ID_NO_ALARM ); - status = SELF_TEST_STATUS_PASSED; + if ( TRUE == calStatus ) + { + result = SELF_TEST_STATUS_PASSED; + } + else + { + result = SELF_TEST_STATUS_FAILED; + } - return status; + return result; } /*********************************************************************//** Index: firmware/App/Controllers/TemperatureSensors.h =================================================================== diff -u -r025612ad77fe630889a364586de54bffe5262d56 -r44222e803e04d057ab793ce6b72902b8bfe9b7d0 --- firmware/App/Controllers/TemperatureSensors.h (.../TemperatureSensors.h) (revision 025612ad77fe630889a364586de54bffe5262d56) +++ firmware/App/Controllers/TemperatureSensors.h (.../TemperatureSensors.h) (revision 44222e803e04d057ab793ce6b72902b8bfe9b7d0) @@ -19,6 +19,7 @@ #define __TEMPERATURESENSORS_H__ #include "DGCommon.h" +#include "NVDataMgmt.h" /** * @defgroup TemperatureSensors TemperatureSensors Index: firmware/App/Modes/ModeFill.c =================================================================== diff -u -r025612ad77fe630889a364586de54bffe5262d56 -r44222e803e04d057ab793ce6b72902b8bfe9b7d0 --- firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision 025612ad77fe630889a364586de54bffe5262d56) +++ firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision 44222e803e04d057ab793ce6b72902b8bfe9b7d0) @@ -761,9 +761,10 @@ static void setFillInfoToRTCRAM( void ) { DG_HEATERS_RECORD_T record; + record.averageFillFlow = fillStatus.fillFlowRateAverage; - setHeatersInfoRecord( (U08*)&record ); + setHeatersInfoRecord( (U08*)&record, sizeof( DG_HEATERS_RECORD_T ) ); } /**@}*/ Index: firmware/App/Modes/ModeGenIdle.c =================================================================== diff -u -r025612ad77fe630889a364586de54bffe5262d56 -r44222e803e04d057ab793ce6b72902b8bfe9b7d0 --- firmware/App/Modes/ModeGenIdle.c (.../ModeGenIdle.c) (revision 025612ad77fe630889a364586de54bffe5262d56) +++ firmware/App/Modes/ModeGenIdle.c (.../ModeGenIdle.c) (revision 44222e803e04d057ab793ce6b72902b8bfe9b7d0) @@ -215,7 +215,7 @@ flushLinesVolumeL += waterVolume; // When enough water volume has flowed to flush the lines, transition to flush water state - if ( flushLinesVolumeL >= getFlushLineVolume() ) + if ( flushLinesVolumeL >= getFlushLineVolumeL() ) { #ifndef DISABLE_FLOW_CONTROL_TREATMENT setROPumpTargetFlowRateLPM( TARGET_RO_FLOW_RATE_L, TARGET_RO_PRESSURE_PSI ); Index: firmware/App/Services/Reservoirs.c =================================================================== diff -u -rbe4507c7fef6c9d987eba9e34369402e989e962e -r44222e803e04d057ab793ce6b72902b8bfe9b7d0 --- firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision be4507c7fef6c9d987eba9e34369402e989e962e) +++ firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision 44222e803e04d057ab793ce6b72902b8bfe9b7d0) @@ -52,10 +52,6 @@ #define MAX_REDUNDANT_LOAD_CELL_DIFF 50.0 ///< Maximum difference in redundant load cells when determining if fill completed. -#define RESERVOIR_TEMPERATURE_TAU_C_PER_MIN -0.512 ///< Reservoir temperature time constant C/min. -#define ULTRAFILTER_TEMPERATURE_TAU_C_PER_MIN -4.565 ///< Ultrafilter temperature time constant C/min. -#define ULTRAFILTER_VOLUME_ML 700 ///< Ultrafilter volume in milliliters. - // ********** private data ********** /// Heaters temperature calculation data structure @@ -77,7 +73,7 @@ static U32 reservoirDataPublicationTimerCounter = 0; ///< used to schedule reservoir data publication to CAN bus. static OVERRIDE_U32_T activeReservoir = { 0, 0, 0, 0 }; ///< The active reservoir that the DG is filling/draining/etc. -static OVERRIDE_U32_T fillVolumeTargetMl = { 0, 0, 0, 0 }; ///< The target reservoir fill volume (in mL). +static OVERRIDE_U32_T fillVolumeTargetMl = { 0, 0, 0, 0 }; // TODO is this needed with NV Data? ///< The target reservoir fill volume (in mL). static OVERRIDE_U32_T drainVolumeTargetMl = { 0, 0, 0, 0 }; ///< The target reservoir drain volume (in mL). @@ -91,15 +87,10 @@ static U32 reservoirWeightUnchangeStartTime[ NUM_OF_DG_RESERVOIRS ] = { 0, 0 }; ///< The reservoirs' weight start time when weight stop decreasing. static BOOL tareLoadCellRequest; ///< Flag indicates if load cell tare has been requested by HD. static DG_RESERVOIR_VOLUME_RECORD_T reservoirsCalRecord; ///< DG reservoirs non-volatile record. +static DG_HEATING_CAL_RECORD_T heatingConstsCalRecord; ///< DG heating calibration record. static F32 targetFillFlowRateLPM; ///< Target fill flow rate in L/min. static BOOL isThisTheFirstCycle = TRUE; ///< Boolean flag to indicate whether this is the first cycle. -/// Conversion of ultrafilter tau in C/min to C/ms. -static const F32 ULTRAFILTER_TAU_C_PER_MS = ULTRAFILTER_TEMPERATURE_TAU_C_PER_MIN / ( SEC_PER_MIN * MS_PER_SECOND ); - -/// Conversion of reservoir tau in C/min to C/ms. -static const F32 RESERVOIR_TAU_C_PER_MS = RESERVOIR_TEMPERATURE_TAU_C_PER_MIN / ( SEC_PER_MIN * MS_PER_SECOND ); - /*********************************************************************//** * @brief * The initReservoirs function initializes the Reservoirs module. @@ -121,7 +112,8 @@ * @brief * The execReservoirs function manages periodic tasks for the Reservoirs module. * @details Inputs: reservoirDataPublicationTimerCounter - * @details Outputs: reservoirDataPublicationTimerCounter + * @details Outputs: reservoirDataPublicationTimerCounter, heatingCalRecord, + * reservoirsCalRecord * @return none *************************************************************************/ void execReservoirs( void ) @@ -132,6 +124,9 @@ // Get the new calibration data and check its validity getNVRecord2Driver( GET_CAL_RSRVRS_VOL_RECORD, (U08*)&reservoirsCalRecord, sizeof( reservoirsCalRecord ), NUM_OF_CAL_DATA_RSRVRS, ALARM_ID_DG_RESERVOIRS_INVALID_CAL_RECORD ); + + getNVRecord2Driver( GET_CAL_HEATING_RECORD, (U08*)&heatingConstsCalRecord, sizeof( heatingConstsCalRecord ), + NUM_OF_CAL_DATA_RSRVRS, ALARM_ID_DG_HEATING_INVALID_CAL_RECORD ); } // publish active reservoir, fill/drain volume targets at 1 Hz. @@ -167,10 +162,14 @@ SELF_TEST_STATUS_T execReservoirsSelfTest( void ) { SELF_TEST_STATUS_T result = SELF_TEST_STATUS_IN_PROGRESS; + BOOL calStatus = FALSE; - BOOL calStatus = getNVRecord2Driver( GET_CAL_RSRVRS_VOL_RECORD, (U08*)&reservoirsCalRecord, sizeof( reservoirsCalRecord ), - NUM_OF_CAL_DATA_RSRVRS, ALARM_ID_DG_RESERVOIRS_INVALID_CAL_RECORD ); + calStatus |= getNVRecord2Driver( GET_CAL_RSRVRS_VOL_RECORD, (U08*)&reservoirsCalRecord, sizeof( reservoirsCalRecord ), + NUM_OF_CAL_DATA_RSRVRS, ALARM_ID_DG_RESERVOIRS_INVALID_CAL_RECORD ); + calStatus |= getNVRecord2Driver( GET_CAL_HEATING_RECORD, (U08*)&heatingConstsCalRecord, sizeof( heatingConstsCalRecord ), + NUM_OF_CAL_DATA_RSRVRS, ALARM_ID_DG_HEATING_INVALID_CAL_RECORD ); + if ( TRUE == calStatus ) { result = SELF_TEST_STATUS_PASSED; @@ -572,20 +571,22 @@ F32 targetFillVolML = getTargetFillVolumeML(); F32 tempLastFill = getLastFillTemperature(); F32 tempAvgFill = getAvgFillTemperature(); + F32 UFTauCPerMS = heatingConstsCalRecord.ultrafilterTempTauCPerMin / ( SEC_PER_MIN * MS_PER_SECOND ); + F32 RsrvrTauCPerMS = heatingConstsCalRecord.reservoirTempTauCPerMin / ( SEC_PER_MIN * MS_PER_SECOND ); // Only do the calculations if the fill volume is not 0.0 so the final value will not be a nan. if ( targetFillVolML > NEARLY_ZERO ) { heatersTempCalc.timeUFDecayMS = (F32)heatersTempCalc.timeReservoirCycleMS - heatersTempCalc.timeReservoirFillMS; - UFTimeConstant = heatersTempCalc.timeUFDecayMS * ULTRAFILTER_TAU_C_PER_MS; + UFTimeConstant = heatersTempCalc.timeUFDecayMS * UFTauCPerMS; heatersTempCalc.tempUFFill = tempLastFill + UFTimeConstant; - F32 ultrafilterPart = ( ULTRAFILTER_VOLUME_ML / targetFillVolML ) * heatersTempCalc.tempUFFill; - F32 fillPart = ( ( targetFillVolML - ULTRAFILTER_VOLUME_ML ) / targetFillVolML ) * tempAvgFill; + F32 ultrafilterPart = ( heatingConstsCalRecord.ultrafilterVolmL / targetFillVolML ) * heatersTempCalc.tempUFFill; + F32 fillPart = ( ( targetFillVolML - heatingConstsCalRecord.ultrafilterVolmL ) / targetFillVolML ) * tempAvgFill; F32 tempReservoir0Actual = ultrafilterPart + fillPart; - F32 tempReservoirEndfillActual = tempReservoir0Actual + ( ( heatersTempCalc.timeReservoirFillMS * 0.5 ) * RESERVOIR_TAU_C_PER_MS ); - heatersTempCalc.tempReservoirUseActual = tempReservoirEndfillActual + ( heatersTempCalc.timeReservoirFill2SwitchMS * RESERVOIR_TAU_C_PER_MS ); + F32 tempReservoirEndfillActual = tempReservoir0Actual + ( ( heatersTempCalc.timeReservoirFillMS * 0.5 ) * RsrvrTauCPerMS ); + heatersTempCalc.tempReservoirUseActual = tempReservoirEndfillActual + ( heatersTempCalc.timeReservoirFill2SwitchMS * RsrvrTauCPerMS ); } else { @@ -610,6 +611,8 @@ F32 targetFillVolML = getTargetFillVolumeML(); F32 UFTimeConstant = 0.0; F32 tempLastFill = getLastFillTemperature(); + F32 UFTauCPerMS = heatingConstsCalRecord.ultrafilterTempTauCPerMin / ( SEC_PER_MIN * MS_PER_SECOND ); + F32 RsrvrTauCPerMS = heatingConstsCalRecord.reservoirTempTauCPerMin / ( SEC_PER_MIN * MS_PER_SECOND ); if ( FALSE == isThisTheFirstFill() ) { @@ -618,15 +621,15 @@ F32 tempReservoirUse; tempReservoirUse = heatersTempCalc.tempTargetTrimmer + RESERVOIR_EXTRA_TEMPERATURE; - heatersTempCalc.tempReservoirEndFill = tempReservoirUse - ( heatersTempCalc.timeReservoirFill2SwitchMS * RESERVOIR_TAU_C_PER_MS ); - heatersTempCalc.tempReservoir0 = heatersTempCalc.tempReservoirEndFill - ( ( heatersTempCalc.timeReservoirFillMS * 0.5 ) * RESERVOIR_TAU_C_PER_MS ); + heatersTempCalc.tempReservoirEndFill = tempReservoirUse - ( heatersTempCalc.timeReservoirFill2SwitchMS * RsrvrTauCPerMS ); + heatersTempCalc.tempReservoir0 = heatersTempCalc.tempReservoirEndFill - ( ( heatersTempCalc.timeReservoirFillMS * 0.5 ) * RsrvrTauCPerMS ); heatersTempCalc.timeUFDecayMS = (F32)heatersTempCalc.timeReservoirCycleMS - heatersTempCalc.timeReservoirFillMS; - UFTimeConstant = heatersTempCalc.timeUFDecayMS * ULTRAFILTER_TAU_C_PER_MS; + UFTimeConstant = heatersTempCalc.timeUFDecayMS * UFTauCPerMS; heatersTempCalc.tempUFFill = tempLastFill + UFTimeConstant; - tempTargetNumerator = heatersTempCalc.tempReservoir0 - ( ( ULTRAFILTER_VOLUME_ML / targetFillVolML ) * heatersTempCalc.tempUFFill ); - targetTempDenominator = ( ( targetFillVolML - ULTRAFILTER_VOLUME_ML ) / targetFillVolML ); + tempTargetNumerator = heatersTempCalc.tempReservoir0 - ( ( heatingConstsCalRecord.ultrafilterVolmL / targetFillVolML ) * heatersTempCalc.tempUFFill ); + targetTempDenominator = ( ( targetFillVolML - heatingConstsCalRecord.ultrafilterVolmL ) / targetFillVolML ); tempTarget = tempTargetNumerator / targetTempDenominator; } else Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -r025612ad77fe630889a364586de54bffe5262d56 -r44222e803e04d057ab793ce6b72902b8bfe9b7d0 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 025612ad77fe630889a364586de54bffe5262d56) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 44222e803e04d057ab793ce6b72902b8bfe9b7d0) @@ -1148,6 +1148,14 @@ handleTestFansRPMAlarmStartTimeOffsetOverrideRequest( message ); break; + case MSG_ID_DG_GET_SW_CONFIG_RECORD: + handleGetDGSoftwareConfigRecord( message ); + break; + + case MSG_ID_DG_SET_SW_CONFIG_RECORD: + handleSetDGSoftwareConfigRecord( message ); + break; + default: // TODO - unrecognized message ID received - ignore break; Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -rbe4507c7fef6c9d987eba9e34369402e989e962e -r44222e803e04d057ab793ce6b72902b8bfe9b7d0 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision be4507c7fef6c9d987eba9e34369402e989e962e) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 44222e803e04d057ab793ce6b72902b8bfe9b7d0) @@ -3212,4 +3212,64 @@ sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); } +/*********************************************************************//** +* @brief +* The handleGetDGSoftwareConfigRecord function handles a request to get the DG +* software configuration record. +* @details Inputs: none +* @details Outputs: message handled +* @param message a pointer to the message to handle +* @return none +*************************************************************************/ +void handleGetDGSoftwareConfigRecord( MESSAGE_T *message ) +{ + BOOL result = FALSE; + + // verify payload length + if ( 0 == message->hdr.payloadLen ) + { + // Tester must be logged in + if ( TRUE == isTestingActivated() ) + { + result = sendRecordToDialin( NVDATAMGMT_SW_CONFIG_RECORD ); + } + } + + // respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** +* @brief +* The handleSetDGSoftwareConfigRecord function handles a request to set the DG +* software configuration record. +* @details Inputs: none +* @details Outputs: message handled +* @param message a pointer to the message to handle +* @return none +*************************************************************************/ +void handleSetDGSoftwareConfigRecord( MESSAGE_T *message ) +{ + U32 currentMessage; + U32 totalMessages; + U32 payloadLength; + + BOOL status = FALSE; + U08* payloadPtr = message->payload; + + memcpy(¤tMessage, payloadPtr, sizeof(U32)); + payloadPtr += sizeof(U32); + + memcpy(&totalMessages, payloadPtr, sizeof(U32)); + payloadPtr += sizeof(U32); + + memcpy(&payloadLength, payloadPtr, sizeof(U32)); + payloadPtr += sizeof(U32); + + status = receiveRecordFromDialin( NVDATAMGMT_SW_CONFIG_RECORD, currentMessage, totalMessages, payloadLength, payloadPtr ); + + // Respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, status ); +} + /**@}*/ Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -r025612ad77fe630889a364586de54bffe5262d56 -r44222e803e04d057ab793ce6b72902b8bfe9b7d0 --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 025612ad77fe630889a364586de54bffe5262d56) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 44222e803e04d057ab793ce6b72902b8bfe9b7d0) @@ -353,6 +353,12 @@ // MSG_ID_DG_FAN_RPM_ALARM_START_TIME_OFFSET_OVERRIDE void handleTestFansRPMAlarmStartTimeOffsetOverrideRequest( MESSAGE_T *message ); +// 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