Index: NVDataMgmt.c =================================================================== diff -u -r66600859e4fb3036f48901aae8c9845f37e3e707 -re2611bd03c4a86fae5d4f525b91d6fbfb597a8e0 --- NVDataMgmt.c (.../NVDataMgmt.c) (revision 66600859e4fb3036f48901aae8c9845f37e3e707) +++ NVDataMgmt.c (.../NVDataMgmt.c) (revision e2611bd03c4a86fae5d4f525b91d6fbfb597a8e0) @@ -106,13 +106,13 @@ - RECORD_BYTE_SIZE(rcrd)) /// DG padding length macro. #define RECORD_DEFAULT_TIME 0U ///< Record default time (calibration/set). -#define RECORD_FOURTH_ORDER_COEFF 0.0 ///< Record fourth order coefficient. -#define RECORD_THIRD_ORDER_COEFF 0.0 ///< Record third order coefficient. -#define RECORD_SECOND_ORDER_COEFF 0.0 ///< Record second order coefficient. -#define RECORD_DEFAULT_GAIN 1.0 ///< Record default gain. -#define RECORD_DEFAULT_OFFSET 0.0 ///< Record default offset. -#define RECORD_DEFAULT_CONST 0.0 ///< Record default constant. -#define RECORD_DEFAULT_RATIO 1.0 ///< Record default ratio. +#define RECORD_FOURTH_ORDER_COEFF 0.0F ///< Record fourth order coefficient. +#define RECORD_THIRD_ORDER_COEFF 0.0F ///< Record third order coefficient. +#define RECORD_SECOND_ORDER_COEFF 0.0F ///< Record second order coefficient. +#define RECORD_DEFAULT_GAIN 1.0F ///< Record default gain. +#define RECORD_DEFAULT_OFFSET 0.0F ///< Record default offset. +#define RECORD_DEFAULT_CONST 0.0F ///< Record default constant. +#define RECORD_DEFAULT_RATIO 1.0F ///< Record default ratio. // The service record interval is equivalent to 6 months #define RECORD_DEFAULT_SERVICE_INTERVAL_S 15768000U ///< Record default service interval in seconds. #define RECORD_DEFAULT_CHARACTER ' ' ///< Record default character. @@ -127,16 +127,16 @@ // DG specific defines #ifdef _DG_ -#define FLUSH_LINES_DEFAULT_VOLUME_L 0.01 ///< Water volume to flush when starting re-circulate mode in liters. +#define FLUSH_LINES_DEFAULT_VOLUME_L 0.01F ///< Water volume to flush when starting re-circulate mode in liters. #define ACID_CONC_DEFAULT_MIXING_RATIO ( 2.35618 / FRACTION_TO_PERCENT_FACTOR ) ///< Ratio between RO water and acid concentrate mixing ratio. #define BICARB_CONC_DEFAULT_MIXING_RATIO ( 4.06812 / FRACTION_TO_PERCENT_FACTOR ) ///< Ratio between RO water and bicarbonate concentrate mixing ratio. #define PRES_SENSORS_RESERVED_SPACE_COUNT 6 ///< Pressure sensors reserved space count. #define FLOW_SENSROS_RESERVED_SPACE_COUNT 2 ///< Flow sensors reserved space count. #define TEMP_SENSORS_RESERVED_SPACE_COUNT 5 ///< Temperature sensors reserved space count. #define COND_SENSORS_RESERVED_SPACE_COUNT 2 ///< Conductivity sensors reserved space count. #define GENERIC_VOL_RESERVED_SPACE_COUNT 4 ///< Generic volumes reserved space count. -#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 RESERVOIR_TEMPERATURE_TAU_C_PER_MIN -0.512F ///< Reservoir temperature time constant C/min. +#define ULTRAFILTER_TEMPERATURE_TAU_C_PER_MIN -4.565F ///< Ultrafilter temperature time constant C/min. #define ULTRAFILTER_VOLUME_ML 700 ///< Ultrafilter volume in milliliters. #endif @@ -403,6 +403,7 @@ U16 crc; ///< CRC for the HD usage info structure. } HD_USAGE_INFO_GROUP_T; +#ifndef _RELEASE_ /// HD software configurations group typedef struct { @@ -411,6 +412,7 @@ U08 padding[ RECORD_PADDING_LENGTH(HD_SW_CONFIG_RECORD_T, MAX_RTC_RAM_OPS_BUFFER_BYTES) ]; ///< Software configurations group padding. U16 crc; ///< Software configurations CRC. } HD_SW_CONFIG_GROUP_T; +#endif #endif #pragma pack(pop) @@ -441,13 +443,17 @@ static HD_SYSTEM_GROUP_T hdSystemGroup; ///< HD system group structure (including padding and final CRC). static HD_SERVICE_GROUP_T hdServiceGroup; ///< HD service group structure (including padding and final CRC). static HD_USAGE_INFO_GROUP_T hdUsageInfoGroup; ///< HD usage info group structure (including padding and final CRC). +#ifndef _RELEASE_ static HD_SW_CONFIG_GROUP_T hdSWConfigGroup; ///< HD Software configurations structure(including padding and final CRC). +#endif // Process records specifications const PROCESS_RECORD_SPECS_T RECORDS_SPECS [ NUM_OF_NVDATMGMT_RECORDS_JOBS ] = { {CAL_RECORD_NV_MEM_START_ADDRESS, sizeof(HD_CALIBRATION_RECORD_T), MAX_EEPROM_WRITE_BUFFER_BYTES, sizeof(HD_CALIBRATION_RECORD_T), (U08*)&hdCalibrationRecord, (U08*)&hdCalibrationRecord.crc, NVDATAMGMT_EEPROM}, // NVDATAMGMT_CALIBRATION_RECORD {SYSTEM_RECORD_NV_MEM_START_ADDRESS, sizeof(HD_SYSTEM_GROUP_T), MAX_EEPROM_WRITE_BUFFER_BYTES, sizeof(HD_SYSTEM_GROUP_T), (U08*)&hdSystemGroup, (U08*)&hdSystemGroup.crc, NVDATAMGMT_EEPROM}, // NVDATAMGMT_SYSTEM_RECORD {SERVICE_RECORD_START_ADDRESS, sizeof(HD_SERVICE_GROUP_T), MAX_RTC_RAM_OPS_BUFFER_BYTES, MAX_RTC_RAM_OPS_BUFFER_BYTES, (U08*)&hdServiceGroup, (U08*)&hdServiceGroup.crc, NVDATAMGMT_RTC}, // NVDATAMGMT_PROCESS_LAST_SERVICE_RECORD +#ifndef _RELEASE_ {SW_CONFIGS_START_ADDRESS, sizeof(HD_SW_CONFIG_GROUP_T), MAX_RTC_RAM_OPS_BUFFER_BYTES, MAX_RTC_RAM_OPS_BUFFER_BYTES, (U08*)&hdSWConfigGroup, (U08*)&hdSWConfigGroup.crc, NVDATAMGMT_RTC} // NVDATAMGMT_SW_CONFIG_RECORD +#endif }; #endif @@ -570,7 +576,9 @@ static BOOL isHDSystemRecordValid( void ); static BOOL isHDServiceRecordValid( void ); static BOOL isHDCalibrationRecordValid( void ); +#ifndef _RELEASE_ static BOOL isSWConfigRecordValid( void ); +#endif static BOOL isHDValveRecordValid( HD_VALVE_CAL_PAYLOAD_T* record ); static BOOL isHDPumpRecordValid( HD_PUMP_CAL_PAYLOAD_T* record ); static BOOL isHDAccelerometerSensorValid( HD_ACCELEROMETER_SENSOR_CAL_RECORD_T* record ); @@ -1216,6 +1224,7 @@ return isNVDataValid; } +#ifndef _RELEASE_ /*********************************************************************//** * @brief * The getSoftwareConfigStatus function returns the status of a software @@ -1232,17 +1241,16 @@ // If the build is not a release, get the value from the software configurations list // If the build is a release, the configuration not matter what its value is kept in // the NV RAM, it returns a 0 which is the configuration is disabled -#ifndef _RELEASE_ #ifdef _DG_ value = dgSWConfigGroup.dgSWConfigsRecord.swConfigs[ config ]; #endif #ifdef _HD_ value = hdSWConfigGroup.hdSWConfigsRecord.swConfigs[ config ]; #endif -#endif return value; } +#endif #ifdef _DG_ /*********************************************************************//** @@ -1788,8 +1796,10 @@ haveCalGroupsPassed = isHDCalibrationRecordValid(); hasSystemRecordPassed = isHDSystemRecordValid(); hasServiceRecordPassed = isHDServiceRecordValid(); +#ifndef _RELEASE_ hasSWConfigRecordPassed = isSWConfigRecordValid(); #endif +#endif // If any of the records did not pass, they should be filled // with benign values. After that, schedule a write to sector 0 @@ -3673,6 +3683,7 @@ return isCalRecordValid; } +#ifndef _RELEASE_ /*********************************************************************//** * @brief * The isSWConfigRecordValid function checks the validity of the software @@ -3702,6 +3713,7 @@ return status; } +#endif /*********************************************************************//** * @brief