Index: firmware/App/Controllers/ConcentratePumps.c =================================================================== diff -u -ra069eb423b26296eb95214e18383c81adae07497 -reeb4e9c7c8ca2bc41168353c3d30f311080972b2 --- firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision a069eb423b26296eb95214e18383c81adae07497) +++ firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision eeb4e9c7c8ca2bc41168353c3d30f311080972b2) @@ -56,6 +56,8 @@ #define CONCENTRATE_PUMP_CONTROL_INTERVAL ( 50 / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the concentrate pump is controlled. #define CONCENTRATE_PUMP_SPEED_CONTROL_PERSISTENCE_PERIOD ( 5 * MS_PER_SECOND ) ///< Persistence period for concentrate pump speed control error. +#define NUMBER_OF_ACID_AND_BICARB_NV_DATA_TO_CHECK 1 ///< Number of acid and bicarb non-volatile data to check. + /// Enumeration of concentrate pump states. typedef enum ConcentratePumpState { @@ -149,14 +151,11 @@ if ( TRUE == isNewCalibrationRecordAvailable() ) { // Get the calibration values of acid and bicarb - // NOTE: since only the first acid and bicarb are used the number of sensors to check is acid or bicarb + 1 since the for loop - // starts from 0 and goes to sizeof the array so target sensor + 1 to just check the calibration time of the calibration values - // that are calibrated getNVRecord2Driver( GET_CAL_ACID_CONCENTREATES, (U08*)&acidConcentrateCalRecord, sizeof( acidConcentrateCalRecord ), - ( CAL_DATA_ACID_CONCENTRATE_1 + 1 ), ALARM_ID_DG_ACID_CONCENTRATE_INVALID_CAL_RECORD ); + NUMBER_OF_ACID_AND_BICARB_NV_DATA_TO_CHECK, ALARM_ID_DG_ACID_CONCENTRATE_INVALID_CAL_RECORD ); getNVRecord2Driver( GET_CAL_BICARB_CONCENTRATES, (U08*)&bicarbConcentrateCalRecord, sizeof( bicarbConcentrateCalRecord ), - ( CAL_DATA_BICARB_CONCENTRATE_1 + 1 ), ALARM_ID_DG_BICARB_CONCENTRATE_INVALID_CAL_RECORD ); + NUMBER_OF_ACID_AND_BICARB_NV_DATA_TO_CHECK, ALARM_ID_DG_BICARB_CONCENTRATE_INVALID_CAL_RECORD ); } if ( ++concentratePumpMonitorTimerCounter >= getU32OverrideValue( &concentratePumpDataPublishInterval ) ) @@ -166,7 +165,7 @@ if ( 0 != fpgaConcentratePumpsFault ) { - //SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DG_CONCENTRATE_PUMP_FAULT, fpgaConcentratePumpsFault ); // TODO why did this error occur once? + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DG_CONCENTRATE_PUMP_FAULT, fpgaConcentratePumpsFault ); } calcMeasuredPumpsSpeed( CONCENTRATEPUMPS_CP1_ACID, getFPGACP1HallSensePulseWidth() );