Index: firmware/App/Controllers/ConcentratePumps.c =================================================================== diff -u -rc914eb443ee2679eb9fe3668119058ccc578437d -rd3819286869611f9c02add72a0f8e321598fdf42 --- firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision c914eb443ee2679eb9fe3668119058ccc578437d) +++ firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision d3819286869611f9c02add72a0f8e321598fdf42) @@ -99,7 +99,6 @@ static void stepConcentratePumpToTargetSpeed( CONCENTRATE_PUMPS_T pumpId ); static CONCENTRATE_PUMP_STATE_T handleConcentratePumpOnState( CONCENTRATE_PUMPS_T pumpId ); -static U32 getPublishConcentratePumpDataInterval( void ); static void calcMeasuredPumpsSpeed( CONCENTRATE_PUMPS_T pumpId, U16 pulseWidthCount ); static BOOL processCalibrationData( void ); @@ -153,7 +152,7 @@ processCalibrationData(); } - if ( ++concentratePumpMonitorTimerCounter >= getPublishConcentratePumpDataInterval() ) + if ( ++concentratePumpMonitorTimerCounter >= getU32OverrideValue( &concentratePumpDataPublishInterval ) ) { CONCENTRATE_PUMP_DATA_T data; U08 const fpgaConcentratePumpsFault = getFPGAConcentratePumpsFault(); @@ -504,26 +503,6 @@ /*********************************************************************//** * @brief - * The getPublishConcentratePumpDataInterval function gets the concentrate pump - * data publication interval. - * @details Inputs: concentratePumpDataPublishInterval - * @details Outputs: none - * @return the current concentrate pump data publication interval (in ms). - *************************************************************************/ -static U32 getPublishConcentratePumpDataInterval( void ) -{ - U32 result = concentratePumpDataPublishInterval.data; - - if ( OVERRIDE_KEY == concentratePumpDataPublishInterval.override ) - { - result = concentratePumpDataPublishInterval.ovData; - } - - return result; -} - -/*********************************************************************//** - * @brief * The calcMeasuredPumpsSpeed function calculates the concentrate pump flow * rate using the hall sense pulse width count. * @details Inputs: none Index: firmware/App/Controllers/ConductivitySensors.c =================================================================== diff -u -re6f3a632890f96a5aa282922d11df148bdd06587 -rd3819286869611f9c02add72a0f8e321598fdf42 --- firmware/App/Controllers/ConductivitySensors.c (.../ConductivitySensors.c) (revision e6f3a632890f96a5aa282922d11df148bdd06587) +++ firmware/App/Controllers/ConductivitySensors.c (.../ConductivitySensors.c) (revision d3819286869611f9c02add72a0f8e321598fdf42) @@ -108,7 +108,6 @@ static U32 prefixStrToSIFactor( U08 prefix ); static void processMeasurementDataPackage( U32 sensorId ); static void processCD1CD2SensorRead( U16 fpgaReadCount, U08 fpgaErrorCount ); -static U32 getConductivityDataPublishInterval( void ); static BOOL processCalibrationData( void ); static F32 getCalibrationAppliedConductivityValue( U32 sensorId, F32 compensatedValue ); @@ -166,7 +165,7 @@ processCPiCPoSensorRead( CONDUCTIVITYSENSORS_CPO_SENSOR, getFPGACPo(), getFPGACPoReadCount(), getFPGACPoErrorCount(), getFPGACPoFault() ); processCD1CD2SensorRead( getFPGAEmstatRxFifoCount(), getFPGAEmstatRxErrCount() ); - if ( ++conductivityDataPublicationTimerCounter >= getConductivityDataPublishInterval() ) + if ( ++conductivityDataPublicationTimerCounter >= getU32OverrideValue( &conductivityDataPublishInterval ) ) { CONDUCTIVITY_DATA_T data; @@ -263,14 +262,7 @@ if ( sensorId < NUM_OF_CONDUCTIVITY_SENSORS ) { - if ( OVERRIDE_KEY == compensatedConductivityValues[ sensorId ].override ) - { - result = compensatedConductivityValues[ sensorId ].ovData; - } - else - { - result = compensatedConductivityValues[ sensorId ].data; - } + result = getF32OverrideValue( &compensatedConductivityValues[ sensorId ] ); } else { @@ -509,26 +501,6 @@ /*********************************************************************//** * @brief - * The getConductivityDataPublishInterval function gets the conductivity - * data publication interval. - * @details Inputs: conductivityDataPublishInterval - * @details Outputs: none - * @return the current conductivity data publication interval (in ms/task interval). - *************************************************************************/ -static U32 getConductivityDataPublishInterval( void ) -{ - U32 result = conductivityDataPublishInterval.data; - - if ( OVERRIDE_KEY == conductivityDataPublishInterval.override ) - { - result = conductivityDataPublishInterval.ovData; - } - - return result; -} - -/*********************************************************************//** - * @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. Index: firmware/App/Controllers/DrainPump.c =================================================================== diff -u -rc2fe204db1b8926994b5eee78afa1b516c97d02c -rd3819286869611f9c02add72a0f8e321598fdf42 --- firmware/App/Controllers/DrainPump.c (.../DrainPump.c) (revision c2fe204db1b8926994b5eee78afa1b516c97d02c) +++ firmware/App/Controllers/DrainPump.c (.../DrainPump.c) (revision d3819286869611f9c02add72a0f8e321598fdf42) @@ -128,7 +128,6 @@ static DRAIN_PUMP_STATE_T handleDrainPumpOpenLoopState( void ); static void stopDrainPump( void ); static void publishDrainPumpData( void ); -static U32 getPublishDrainPumpDataInterval( void ); static BOOL processCalibrationData( void ); /*********************************************************************//** @@ -609,26 +608,6 @@ /*********************************************************************//** * @brief - * The getPublishDrainPumpDataInterval function gets the drain pump data - * publication interval. - * @details Inputs: drainPumpDataPublishInterval - * @details Outputs: drainPumpDataPublishInterval - * @return the current Drain pump data publication interval (in ms). - *************************************************************************/ -static U32 getPublishDrainPumpDataInterval( void ) -{ - U32 result = drainPumpDataPublishInterval.data; - - if ( OVERRIDE_KEY == drainPumpDataPublishInterval.override ) - { - result = drainPumpDataPublishInterval.ovData; - } - - return result; -} - -/*********************************************************************//** - * @brief * The publishDrainPumpData function publishes drain pump data at the set * interval. * @details Inputs: drainPumpDataPublicationTimerCounter @@ -638,7 +617,7 @@ static void publishDrainPumpData( void ) { // publish Drain pump data on interval - if ( ++drainPumpDataPublicationTimerCounter >= getPublishDrainPumpDataInterval() ) + if ( ++drainPumpDataPublicationTimerCounter >= getU32OverrideValue( &drainPumpDataPublishInterval ) ) { DRAIN_PUMP_DATA_T drainPumpData; Index: firmware/App/Controllers/Fans.c =================================================================== diff -u -r67021fbc633259e8e1bce76749dbef7d0cb51998 -rd3819286869611f9c02add72a0f8e321598fdf42 --- firmware/App/Controllers/Fans.c (.../Fans.c) (revision 67021fbc633259e8e1bce76749dbef7d0cb51998) +++ firmware/App/Controllers/Fans.c (.../Fans.c) (revision d3819286869611f9c02add72a0f8e321598fdf42) @@ -85,7 +85,6 @@ static F32 getMaximumTemperature( void ); static void convertTogglePeriod2RPM( void ); static void monitorFans( void ); -static U32 getPublishFansDataInterval( void ); static void publishFansData( void ); /*********************************************************************//** @@ -414,25 +413,6 @@ /*********************************************************************//** * @brief - * The getPublishFansDataInterval function gets the fans data publish interval. - * @details Inputs: fansPublishInterval - * @details Outputs: none - * @return data publish time interval in counts - *************************************************************************/ -static U32 getPublishFansDataInterval( void ) -{ - U32 result = fansPublishInterval.data; - - if ( OVERRIDE_KEY == fansPublishInterval.override ) - { - result = fansPublishInterval.ovData; - } - - return result; -} - -/*********************************************************************//** - * @brief * The publishFansData function publishes the fans data at the specified * time interval. * @details Inputs: dataPublishCounter @@ -441,7 +421,7 @@ *************************************************************************/ static void publishFansData( void ) { - if ( ++fansPublishCounter > getPublishFansDataInterval() ) + if ( ++fansPublishCounter > getU32OverrideValue( &fansPublishInterval ) ) { FANS_DATA_T fansData; Index: firmware/App/Controllers/FluidLeak.c =================================================================== diff -u -r21af15686138a30ab982980ff8a641804964f1de -rd3819286869611f9c02add72a0f8e321598fdf42 --- firmware/App/Controllers/FluidLeak.c (.../FluidLeak.c) (revision 21af15686138a30ab982980ff8a641804964f1de) +++ firmware/App/Controllers/FluidLeak.c (.../FluidLeak.c) (revision d3819286869611f9c02add72a0f8e321598fdf42) @@ -43,7 +43,6 @@ // ********** private function prototypes ********** static void publishFluidLeakState( void ); -static U32 getPublishFluidLeakStateInterval( void ); /*********************************************************************//** * @brief @@ -122,26 +121,6 @@ /*********************************************************************//** * @brief - * The getPublishFluidLeakStateInterval function gets the fluid leak state - * publication interval. - * @details Inputs: fluidLeakStatePublishInterval - * @details Outputs: none - * @return the current fluid leak state publication interval (in task intervals). - *************************************************************************/ -static U32 getPublishFluidLeakStateInterval( void ) -{ - U32 result = fluidLeakStatePublishInterval.data; - - if ( OVERRIDE_KEY == fluidLeakStatePublishInterval.override ) - { - result = fluidLeakStatePublishInterval.ovData; - } - - return result; -} - -/*********************************************************************//** - * @brief * The publishFluidLeakState function publishes fluid leak state at the set interval. * @details Inputs: fluidLeakState * @details Outputs: if broadcast is due, send fluid leak state @@ -150,7 +129,7 @@ static void publishFluidLeakState( void ) { // Publish fluid leak state on interval - if ( ++fluidLeakStatePublicationTimerCounter >= getPublishFluidLeakStateInterval() ) + if ( ++fluidLeakStatePublicationTimerCounter >= getU32OverrideValue( &fluidLeakStatePublishInterval ) ) { FLUID_LEAK_STATES_T state = getFluidLeakState(); Index: firmware/App/Controllers/Heaters.c =================================================================== diff -u -re6f3a632890f96a5aa282922d11df148bdd06587 -rd3819286869611f9c02add72a0f8e321598fdf42 --- firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision e6f3a632890f96a5aa282922d11df148bdd06587) +++ firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision d3819286869611f9c02add72a0f8e321598fdf42) @@ -139,7 +139,6 @@ static void setSmallPrimaryHeaterPWM( F32 pwm ); static void setTrimmerHeaterPWM( F32 pwm ); static void resetHeaterState( NAME_OF_HEATER_T heater ); -static U32 getPublishHeatersDataInterval( void ); static void publishHeatersData( void ); static void checkPrimaryHeaterTempSensors( void ); static void checkTrimmerHeaterTempSensors( void ); @@ -708,25 +707,6 @@ /*********************************************************************//** * @brief - * The getPublishHeatersDataInterval function gets the publish interval. - * @details Inputs: heatersDataPublishInterval - * @details Outputs: none - * @return result - *************************************************************************/ -U32 getPublishHeatersDataInterval( void ) -{ - U32 result = heatersDataPublishInterval.data; - - if ( OVERRIDE_KEY == heatersDataPublishInterval.override ) - { - result = heatersDataPublishInterval.ovData; - } - - return result; -} - -/*********************************************************************//** - * @brief * The publishTemperatureData function publishes the heaters data into * at the defined time interval. * @details Inputs: dataPublicationTimerCounter @@ -735,7 +715,7 @@ *************************************************************************/ static void publishHeatersData( void ) { - if ( ++dataPublicationTimerCounter >= getPublishHeatersDataInterval() ) + if ( ++dataPublicationTimerCounter >= getU32OverrideValue( &heatersDataPublishInterval ) ) { HEATERS_DATA_T data; Index: firmware/App/Controllers/LoadCell.c =================================================================== diff -u -re6f3a632890f96a5aa282922d11df148bdd06587 -rd3819286869611f9c02add72a0f8e321598fdf42 --- firmware/App/Controllers/LoadCell.c (.../LoadCell.c) (revision e6f3a632890f96a5aa282922d11df148bdd06587) +++ firmware/App/Controllers/LoadCell.c (.../LoadCell.c) (revision d3819286869611f9c02add72a0f8e321598fdf42) @@ -78,7 +78,6 @@ // ********** private function prototypes ********** -static U32 getLoadCellDataPublishInterval( void ); static BOOL processCalibrationData( void ); /*********************************************************************//** @@ -231,7 +230,7 @@ } // broadcast load cell data if we are at scheduled interval. - if ( ++loadCellDataPublicationTimerCounter >= getLoadCellDataPublishInterval() ) + if ( ++loadCellDataPublicationTimerCounter >= getU32OverrideValue( &loadCellDataPublishInterval ) ) { LOAD_CELL_DATA_T loadCellData; @@ -436,25 +435,6 @@ /*********************************************************************//** * @brief - * The getLoadCellDataPublishInterval function gets the load cell data publish interval. - * @details Inputs: loadCellDataPublishInterval - * @details Outputs: none - * @return the current load cell data publication interval (in ms/task interval). - *************************************************************************/ -static U32 getLoadCellDataPublishInterval( void ) -{ - U32 result = loadCellDataPublishInterval.data; - - if ( OVERRIDE_KEY == loadCellDataPublishInterval.override ) - { - result = loadCellDataPublishInterval.ovData; - } - - return result; -} - -/*********************************************************************//** - * @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. Index: firmware/App/Controllers/Pressures.c =================================================================== diff -u -r4790fb46181f78a19f0a557b0e9688cc03a74e97 -rd3819286869611f9c02add72a0f8e321598fdf42 --- firmware/App/Controllers/Pressures.c (.../Pressures.c) (revision 4790fb46181f78a19f0a557b0e9688cc03a74e97) +++ firmware/App/Controllers/Pressures.c (.../Pressures.c) (revision d3819286869611f9c02add72a0f8e321598fdf42) @@ -87,7 +87,6 @@ static PRESSURE_STATE_T handlePressuresInitState( void ); static PRESSURE_STATE_T handlePressuresContReadState( void ); static void publishPressuresData( void ); -static U32 getPublishPressuresDataInterval( void ); static BOOL processCalibrationData( void ); static SELF_TEST_STATUS_T handleSelfTestADCCheck( void ); @@ -169,18 +168,11 @@ if ( pressureID < NUM_OF_PRESSURE_SENSORS ) { - if ( OVERRIDE_KEY == pressures[ pressureID ].override ) - { - result = pressures[ pressureID ].ovData; - } - else - { - result = pressures[ pressureID ].data; - } + getF32OverrideValue( &pressures[ pressureID ] ); } else { - activateAlarmNoData( ALARM_ID_DG_SOFTWARE_FAULT ); + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_INVALID_PRESSURE_SENSOR_ID, pressureID ); } return result; @@ -346,26 +338,6 @@ } return result; -} - -/*********************************************************************//** - * @brief - * The getPublishPressuresDataInterval function gets the pressure data - * publish interval. - * @details Inputs: pressuresDataPublishInterval - * @details Outputs: none - * @return the current pressures data publication interval (in task intervals). - *************************************************************************/ -static U32 getPublishPressuresDataInterval( void ) -{ - U32 result = pressuresDataPublishInterval.data; - - if ( OVERRIDE_KEY == pressuresDataPublishInterval.override ) - { - result = pressuresDataPublishInterval.ovData; - } - - return result; } /*********************************************************************//** @@ -420,7 +392,7 @@ static void publishPressuresData( void ) { // publish pressure/occlusion data on interval - if ( ++pressuresDataPublicationTimerCounter >= getPublishPressuresDataInterval() ) + if ( ++pressuresDataPublicationTimerCounter >= getU32OverrideValue( &pressuresDataPublishInterval ) ) { F32 roIn = getMeasuredDGPressure( PRESSURE_SENSOR_RO_PUMP_INLET ); F32 roOut = getMeasuredDGPressure( PRESSURE_SENSOR_RO_PUMP_OUTLET ); Index: firmware/App/Controllers/ROPump.c =================================================================== diff -u -re6f3a632890f96a5aa282922d11df148bdd06587 -rd3819286869611f9c02add72a0f8e321598fdf42 --- firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision e6f3a632890f96a5aa282922d11df148bdd06587) +++ firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision d3819286869611f9c02add72a0f8e321598fdf42) @@ -146,7 +146,6 @@ static void setROPumpControlSignalDutyCycle( F32 dutyCycle ); static void stopROPump( void ); static void publishROPumpData( void ); -static U32 getPublishROPumpDataInterval( void ); static BOOL processCalibrationData( void ); /*********************************************************************//** @@ -528,14 +527,7 @@ *************************************************************************/ F32 getMeasuredROFlowRate( void ) { - F32 result = measuredROFlowRateLPM.data; - - if ( OVERRIDE_KEY == measuredROFlowRateLPM.override ) - { - result = measuredROFlowRateLPM.ovData; - } - - return result; + return getF32OverrideValue( &measuredROFlowRateLPM ); } /*********************************************************************//** @@ -788,26 +780,6 @@ /*********************************************************************//** * @brief - * The getPublishROPumpDataInterval function gets the RO pump data publish - * interval. - * @details Inputs: roPumpDataPublishInterval - * @details Outputs: roPumpDataPublishInterval - * @return the current RO pump data publication interval (in ms). - *************************************************************************/ -static U32 getPublishROPumpDataInterval( void ) -{ - U32 result = roPumpDataPublishInterval.data; - - if ( OVERRIDE_KEY == roPumpDataPublishInterval.override ) - { - result = roPumpDataPublishInterval.ovData; - } - - return result; -} - -/*********************************************************************//** - * @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. @@ -858,7 +830,7 @@ static void publishROPumpData( void ) { // publish RO pump data on interval - if ( ++roPumpDataPublicationTimerCounter >= getPublishROPumpDataInterval() ) + if ( ++roPumpDataPublicationTimerCounter >= getU32OverrideValue( &roPumpDataPublishInterval ) ) { RO_PUMP_DATA_T pumpData; Index: firmware/App/Controllers/Switches.c =================================================================== diff -u -r8ee6a4ee6ae356143104f93551d10d7a875eaad1 -rd3819286869611f9c02add72a0f8e321598fdf42 --- firmware/App/Controllers/Switches.c (.../Switches.c) (revision 8ee6a4ee6ae356143104f93551d10d7a875eaad1) +++ firmware/App/Controllers/Switches.c (.../Switches.c) (revision d3819286869611f9c02add72a0f8e321598fdf42) @@ -33,7 +33,6 @@ // ********** private function prototypes ********** static void publishSwitchesData( void ); -static U32 getPublishSwitchesDataInterval( void ); /*********************************************************************//** * @brief @@ -160,7 +159,7 @@ *************************************************************************/ static void publishSwitchesData( void ) { - if ( ++switchesDataPublicationCounter > getPublishSwitchesDataInterval() ) + if ( ++switchesDataPublicationCounter > getU32OverrideValue( &switchesDataPublishInterval ) ) { SWITCHES_DATA_T data; @@ -174,27 +173,7 @@ } } -/*********************************************************************//** - * @brief - * The getPublishSwitchesDataInterval function returns the data - * publication interval either from the data or from the override. - * @details Inputs: switchesDataPublishInterval - * @details Outputs: none - * @return data publish interval - *************************************************************************/ -static U32 getPublishSwitchesDataInterval( void ) -{ - U32 result = switchesDataPublishInterval.data; - if ( OVERRIDE_KEY == switchesDataPublishInterval.override ) - { - result = switchesDataPublishInterval.ovData; - } - - return result; -} - - /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/ Index: firmware/App/Controllers/TemperatureSensors.c =================================================================== diff -u -re6f3a632890f96a5aa282922d11df148bdd06587 -rd3819286869611f9c02add72a0f8e321598fdf42 --- firmware/App/Controllers/TemperatureSensors.c (.../TemperatureSensors.c) (revision e6f3a632890f96a5aa282922d11df148bdd06587) +++ firmware/App/Controllers/TemperatureSensors.c (.../TemperatureSensors.c) (revision d3819286869611f9c02add72a0f8e321598fdf42) @@ -162,7 +162,6 @@ static void processHtrsTempSnsrsADCRead( U32 sensorIndex, U16 adc, U32 fpgaError, U32 fpgaCount ); static BOOL isADCReadValid( U32 sensorIndex, U32 fpgaError, U32 fpgaCount ); static void processADCRead( U32 sensorIndex, S32 adc ); -static U32 getPublishTemperatureSensorsDataInterval( void ); static void publishTemperatureSensorsData( void ); static void monitorTemperatureSnsrs( U32 sensorIndex, F32 temperature ); @@ -828,26 +827,6 @@ /*********************************************************************//** * @brief - * The getPublishTemperatureSensorsDataInterval function returns the data - * publication interval either from the data or from the override. - * @details Inputs: tempSensorsPublishInterval - * @details Outputs: none - * @return data publish interval - *************************************************************************/ -static U32 getPublishTemperatureSensorsDataInterval( void ) -{ - U32 result = tempSensorsPublishInterval.data; - - if ( tempSensorsPublishInterval.override == OVERRIDE_KEY ) - { - result = tempSensorsPublishInterval.ovData; - } - - return result; -} - -/*********************************************************************//** - * @brief * The publishTemperatureSensorsData function broadcasts the temperature * sensors data at the publication interval. * @details Inputs: dataPublicationTimerCounter, tempValuesForPublication @@ -856,7 +835,7 @@ *************************************************************************/ static void publishTemperatureSensorsData( void ) { - if ( ++dataPublicationTimerCounter >= getPublishTemperatureSensorsDataInterval() ) + if ( ++dataPublicationTimerCounter >= getU32OverrideValue( &tempSensorsPublishInterval ) ) { TEMPERATURE_SENSORS_DATA_T data; Index: firmware/App/Controllers/Thermistors.c =================================================================== diff -u -re3705410a6e4df70c2a4f2d590e977326e11d7b3 -rd3819286869611f9c02add72a0f8e321598fdf42 --- firmware/App/Controllers/Thermistors.c (.../Thermistors.c) (revision e3705410a6e4df70c2a4f2d590e977326e11d7b3) +++ firmware/App/Controllers/Thermistors.c (.../Thermistors.c) (revision d3819286869611f9c02add72a0f8e321598fdf42) @@ -65,7 +65,6 @@ static void convertADC2Temperature( void ); static F32 calculateOnBoardThemristorTemperature( U32 adcValue, F32 betaValue ); static void publishThermistorsData( void ); -static U32 getPublishThermistorsDataInterval( void ); /*********************************************************************//** * @brief @@ -313,26 +312,6 @@ /*********************************************************************//** * @brief - * The getPublishThermistorsDataInterval function gets the thermistors - * data publish interval. - * @details Inputs: thermistorsPublishInterval - * @details Outputs: none - * @return data publish time interval in counts - *************************************************************************/ -static U32 getPublishThermistorsDataInterval( void ) -{ - U32 result = thermistorsPublishInterval.data; - - if ( OVERRIDE_KEY == thermistorsPublishInterval.override ) - { - result = thermistorsPublishInterval.ovData; - } - - return result; -} - -/*********************************************************************//** - * @brief * The publishThermistorsData function publishes the thermistors and * temperature sensors data at the specified time interval. * @details Inputs: dataPublishCounter @@ -341,7 +320,7 @@ *************************************************************************/ static void publishThermistorsData( void ) { - if ( ++dataPublishCounter > getPublishThermistorsDataInterval() ) + if ( ++dataPublishCounter > getU32OverrideValue( &thermistorsPublishInterval ) ) { THERMISTORS_DATA_T sensorsData; Index: firmware/App/Controllers/UVReactors.c =================================================================== diff -u -r67021fbc633259e8e1bce76749dbef7d0cb51998 -rd3819286869611f9c02add72a0f8e321598fdf42 --- firmware/App/Controllers/UVReactors.c (.../UVReactors.c) (revision 67021fbc633259e8e1bce76749dbef7d0cb51998) +++ firmware/App/Controllers/UVReactors.c (.../UVReactors.c) (revision d3819286869611f9c02add72a0f8e321598fdf42) @@ -78,7 +78,6 @@ static U32 getReactorHealth( UV_REACTORS_T reactor ); static void setReactorEnableStatus( UV_REACTORS_T reactor, PIN_SIGNAL_STATE_T state ); static void publishUVReactorsData( void ); -static U32 getPublishUVReactorsDataInterval( void ); /*********************************************************************//** * @brief @@ -200,15 +199,7 @@ // Check if the reactor selected is in range if ( reactor < NUM_OF_UV_REACTORS ) { - // Check if the health is in override or not - if ( reactorsStatus[ reactor ].healthStatus.override == OVERRIDE_KEY ) - { - health = (UV_REACTORS_HEALTH_STATUS_T)reactorsStatus[ reactor ].healthStatus.ovData; - } - else - { - health = (UV_REACTORS_HEALTH_STATUS_T)reactorsStatus[ reactor ].healthStatus.data; - } + health = (UV_REACTORS_HEALTH_STATUS_T)getU32OverrideValue( &reactorsStatus[ reactor ].healthStatus ); } else { @@ -439,33 +430,14 @@ /*********************************************************************//** * @brief - * The getPublishValvesDataInterval function gets the data publish interval - * @details Inputs: uvReactorsDataPublishInterval - * @details Outputs: none - * @return returns data publish interval - *************************************************************************/ -static U32 getPublishUVReactorsDataInterval( void ) -{ - U32 result = uvReactorsDataPublishInterval.data; - - if ( OVERRIDE_KEY == uvReactorsDataPublishInterval.override ) - { - result = uvReactorsDataPublishInterval.ovData; - } - - return result; -} - -/*********************************************************************//** - * @brief * The publishUVReactorsData function publishes the UV reactors data. * @details Inputs: dataPublishCounter, reactorsStatus * @details Outputs: dataPublishCounter * @return none *************************************************************************/ static void publishUVReactorsData( void ) { - if ( ++dataPublishCounter > getPublishUVReactorsDataInterval() ) + if ( ++dataPublishCounter > getU32OverrideValue( &uvReactorsDataPublishInterval ) ) { UV_REACTORS_DATA_T uvReactorsData; // Publish the reactors health status Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -r7ed011e79e1338f614cbcc7d3cedf07d359196b7 -rd3819286869611f9c02add72a0f8e321598fdf42 --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision 7ed011e79e1338f614cbcc7d3cedf07d359196b7) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision d3819286869611f9c02add72a0f8e321598fdf42) @@ -52,7 +52,6 @@ static U32 convertValveStateNameToValveState(VALVE_STATE_NAMES_T valveStateName); static U16 fromU32ArrayToU16( void ); static void publishValvesStates( void ); -static U32 getPublishValvesStatesInterval( void ); /*********************************************************************//** * @brief @@ -233,25 +232,6 @@ /*********************************************************************//** * @brief - * The getPublishValveStateInterval function gets the valves states publication interval. - * @details Inputs: valvesStatesPublishInterval - * @details Outputs: none - * @return the current valves states publication interval (in task intervals) - *************************************************************************/ -static U32 getPublishValvesStatesInterval( void ) -{ - U32 result = valvesStatesPublishInterval.data; - - if ( OVERRIDE_KEY == valvesStatesPublishInterval.override ) - { - result = valvesStatesPublishInterval.ovData; - } - - return result; -} - -/*********************************************************************//** - * @brief * The fromU32ArrayToU16 function converts an array of U32 valve states * to U16 valvesStates that can be passed to FPGA for setting valves. * @details Inputs: valveStates[] @@ -422,15 +402,8 @@ U32 valveState = DEENERGIZED; if ( valveID < NUM_OF_VALVES ) - { - if ( OVERRIDE_KEY == valveStates[ valveID ].override ) - { - valveState = valveStates[ valveID ].ovData; - } - else - { - valveState = valveStates[ valveID ].data; - } + { + valveState = getU32OverrideValue( &valveStates[ valveID ] ); } else { @@ -450,7 +423,7 @@ static void publishValvesStates( void ) { // publish valve state on interval - if ( ++valvesStatesPublicationTimerCounter >= getPublishValvesStatesInterval() ) + if ( ++valvesStatesPublicationTimerCounter >= getU32OverrideValue( &valvesStatesPublishInterval ) ) { broadcastValvesStates( getFPGAValveStates() ); valvesStatesPublicationTimerCounter = 0; Index: firmware/App/Controllers/Voltages.c =================================================================== diff -u -r4790fb46181f78a19f0a557b0e9688cc03a74e97 -rd3819286869611f9c02add72a0f8e321598fdf42 --- firmware/App/Controllers/Voltages.c (.../Voltages.c) (revision 4790fb46181f78a19f0a557b0e9688cc03a74e97) +++ firmware/App/Controllers/Voltages.c (.../Voltages.c) (revision d3819286869611f9c02add72a0f8e321598fdf42) @@ -96,7 +96,6 @@ static VOLTAGES_STATE_T handleVoltagesMonitorState( void ); static void checkVoltageRanges( void ); static void publishVoltagesData( void ); -static U32 getPublishVoltagesDataInterval( void ); /*********************************************************************//** * @brief @@ -240,26 +239,6 @@ // TODO - check heater voltages depending on current PWM level } - -/*********************************************************************//** - * @brief - * The getPublishVoltagesDataInterval function gets the voltages monitor data - * publication interval. - * @details Inputs: voltagesDataPublishInterval - * @details Outputs: none - * @return the current voltage monitor data publication interval (in task intervals). - *************************************************************************/ -static U32 getPublishVoltagesDataInterval( void ) -{ - U32 result = voltagesDataPublishInterval.data; - - if ( OVERRIDE_KEY == voltagesDataPublishInterval.override ) - { - result = voltagesDataPublishInterval.ovData; - } - - return result; -} /*********************************************************************//** * @brief @@ -276,12 +255,7 @@ if ( signal < NUM_OF_MONITORED_LINES ) { - result = voltages[ signal ].data; - - if ( OVERRIDE_KEY == voltages[ signal ].override ) - { - result = voltages[ signal ].ovData; - } + result = getF32OverrideValue( &voltages[ signal ] ); } else { @@ -302,7 +276,7 @@ static void publishVoltagesData( void ) { // Publish voltages monitor data on interval - if ( ++voltagesDataPublicationTimerCounter >= getPublishVoltagesDataInterval() ) + if ( ++voltagesDataPublicationTimerCounter >= getU32OverrideValue( &voltagesDataPublishInterval ) ) { VOLTAGES_DATA_PAYLOAD_T data; Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -r7ed011e79e1338f614cbcc7d3cedf07d359196b7 -rd3819286869611f9c02add72a0f8e321598fdf42 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 7ed011e79e1338f614cbcc7d3cedf07d359196b7) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision d3819286869611f9c02add72a0f8e321598fdf42) @@ -64,7 +64,6 @@ static DG_STANDBY_MODE_STATE_T handleStandbyFlushFilterState( void ); static DG_STANDBY_MODE_STATE_T handleStandbyFlushFilterIdleState( void ); static DG_STANDBY_MODE_STATE_T handleStandbySampleWaterState( void ); -static U32 getFilterFlushTimePeriod( void ); /*********************************************************************//** * @brief @@ -189,7 +188,7 @@ static DG_STANDBY_MODE_STATE_T handleStandbyFlushFilterState( void ) { DG_STANDBY_MODE_STATE_T state = DG_STANDBY_MODE_STATE_FLUSH_FILTER; - U32 const filterFlushTimePeriod_ms = getFilterFlushTimePeriod(); + U32 const filterFlushTimePeriod_ms = getU32OverrideValue( &filterFlushTimePeriod ); checkInletPressure(); @@ -437,26 +436,7 @@ return standbyState; } -/*********************************************************************//** - * @brief - * The getFilterFlushTimePeriod function gets the filter flush time period. - * @details Inputs: filterFlushTimePeriod - * @details Outputs: none - * @return the current filter flush time period (in ms). - *************************************************************************/ -static U32 getFilterFlushTimePeriod( void ) -{ - U32 result = filterFlushTimePeriod.data; - if ( OVERRIDE_KEY == filterFlushTimePeriod.override ) - { - result = filterFlushTimePeriod.ovData; - } - - return result; -} - - /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/ Index: firmware/App/Services/Reservoirs.c =================================================================== diff -u -re6f3a632890f96a5aa282922d11df148bdd06587 -rd3819286869611f9c02add72a0f8e321598fdf42 --- firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision e6f3a632890f96a5aa282922d11df148bdd06587) +++ firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision d3819286869611f9c02add72a0f8e321598fdf42) @@ -65,10 +65,6 @@ // ********** private function prototypes ********** -static DG_RESERVOIR_ID_T getActiveReservoir( void ); -static U32 getReservoirFillVolumeTargetMl( void ); - -static U32 getReservoirDrainVolumeTargetMl( void ); static BOOL processCalibrationData( void ); /*********************************************************************//** @@ -104,9 +100,9 @@ // publish active reservoir, fill/drain volume targets at 1 Hz. if ( ++reservoirDataPublicationTimerCounter >= RESERVOIR_DATA_PUB_INTERVAL ) { - U32 actRes = getActiveReservoir(); - U32 filVol = getReservoirFillVolumeTargetMl(); - U32 drnVol = getReservoirDrainVolumeTargetMl(); + U32 actRes = getU32OverrideValue( &activeReservoir ); + U32 filVol = getU32OverrideValue( &fillVolumeTargetMl ); + U32 drnVol = getU32OverrideValue( &drainVolumeTargetMl ); broadcastReservoirData( actRes, filVol, drnVol ); reservoirDataPublicationTimerCounter = 0; } @@ -414,7 +410,7 @@ { DG_RESERVOIR_ID_T inactiveReservoir = DG_RESERVOIR_1; - if ( DG_RESERVOIR_1 == getActiveReservoir() ) + if ( DG_RESERVOIR_1 == getU32OverrideValue( &activeReservoir ) ) { inactiveReservoir = DG_RESERVOIR_2; } @@ -461,7 +457,7 @@ BOOL hasTargetFillVolumeBeenReached( DG_RESERVOIR_ID_T reservoirId ) { F32 const loadcellWeight = getLoadCellSmallFilteredWeight( associatedLoadCell[ reservoirId ] ); - U32 const targetFillVolume = getReservoirFillVolumeTargetMl(); + U32 const targetFillVolume = getU32OverrideValue( &fillVolumeTargetMl ); BOOL const hasTargetReached = ( loadcellWeight >= targetFillVolume ); return hasTargetReached; @@ -482,7 +478,7 @@ BOOL result = FALSE; F32 const loadcellWeight = getLoadCellSmallFilteredWeight( associatedLoadCell[ reservoirId ] ); - U32 const targetDrainVolume = getReservoirDrainVolumeTargetMl(); + U32 const targetDrainVolume = getU32OverrideValue( &drainVolumeTargetMl ); if ( loadcellWeight < reservoirLowestWeight[ reservoirId ] ) { @@ -523,7 +519,7 @@ *************************************************************************/ void tareLoadCellsAtEmpty( DG_RESERVOIR_ID_T reservoirId ) { - U32 const targetDrainVolume = getReservoirDrainVolumeTargetMl(); + U32 const targetDrainVolume = getU32OverrideValue( &drainVolumeTargetMl ); if ( TRUE == tareLoadCellRequest ) { @@ -552,63 +548,6 @@ /*********************************************************************//** * @brief - * The getActiveReservoir function gets the active reservoir. - * @details Inputs: activeReservoir - * @details Outputs: none - * @return the currently active reservoir. - *************************************************************************/ -static DG_RESERVOIR_ID_T getActiveReservoir( void ) -{ - DG_RESERVOIR_ID_T result = (DG_RESERVOIR_ID_T)activeReservoir.data; - - if ( OVERRIDE_KEY == activeReservoir.override ) - { - result = (DG_RESERVOIR_ID_T)activeReservoir.ovData; - } - - return result; -} - -/*********************************************************************//** - * @brief - * The getReservoirFillVolumeTargetMl function gets the reservoir fill volume (in mL). - * @details Inputs: fillVolumeTargetMl - * @details Outputs: none - * @return the current target reservoir fill volume (in mL). - *************************************************************************/ -static U32 getReservoirFillVolumeTargetMl( void ) -{ - U32 result = fillVolumeTargetMl.data; - - if ( OVERRIDE_KEY == fillVolumeTargetMl.override ) - { - result = fillVolumeTargetMl.ovData; - } - - return result; -} - -/*********************************************************************//** - * @brief - * The getReservoirDrainVolumeTargetMl function gets the reservoir drain volume (in mL). - * @details Inputs: drainVolumeTargetMl - * @details Outputs: none - * @return the current target reservoir drain volume (in mL). - *************************************************************************/ -static U32 getReservoirDrainVolumeTargetMl( void ) -{ - U32 result = drainVolumeTargetMl.data; - - if ( OVERRIDE_KEY == drainVolumeTargetMl.override ) - { - result = drainVolumeTargetMl.ovData; - } - - return result; -} - -/*********************************************************************//** - * @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. Index: firmware/App/Services/WatchdogMgmt.c =================================================================== diff -u -re6f3a632890f96a5aa282922d11df148bdd06587 -rd3819286869611f9c02add72a0f8e321598fdf42 --- firmware/App/Services/WatchdogMgmt.c (.../WatchdogMgmt.c) (revision e6f3a632890f96a5aa282922d11df148bdd06587) +++ firmware/App/Services/WatchdogMgmt.c (.../WatchdogMgmt.c) (revision d3819286869611f9c02add72a0f8e321598fdf42) @@ -255,14 +255,7 @@ if ( task < NUM_OF_TASKS ) { - if ( OVERRIDE_KEY == watchdogTaskCheckedIn[ task ].override ) - { - result = (BOOL)watchdogTaskCheckedIn[ task ].ovData; - } - else - { - result = (BOOL)watchdogTaskCheckedIn[ task ].data; - } + result = (BOOL)getU32OverrideValue( &watchdogTaskCheckedIn[ task ] ); } else {