Index: firmware/App/Controllers/ConcentratePumps.c =================================================================== diff -u -re92a64cc9e95e2c79a5ff88d183ec33d8baa9745 -r31a5054c5a9a3c07ecfdced22fe25bb7ce4469cd --- firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision e92a64cc9e95e2c79a5ff88d183ec33d8baa9745) +++ firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision 31a5054c5a9a3c07ecfdced22fe25bb7ce4469cd) @@ -58,6 +58,8 @@ #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 { @@ -151,14 +153,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 ) ) @@ -168,7 +167,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() );