Index: Accel.c =================================================================== diff -u -r66600859e4fb3036f48901aae8c9845f37e3e707 -re2611bd03c4a86fae5d4f525b91d6fbfb597a8e0 --- Accel.c (.../Accel.c) (revision 66600859e4fb3036f48901aae8c9845f37e3e707) +++ Accel.c (.../Accel.c) (revision e2611bd03c4a86fae5d4f525b91d6fbfb597a8e0) @@ -35,19 +35,19 @@ #define ACCEL_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_PRIORITY_INTERVAL ) /// Vector for tilt is filtered w/ moving average. #define SIZE_OF_ROLLING_AVG ( MS_PER_SECOND / TASK_PRIORITY_INTERVAL ) -#define G_PER_LSB ( 0.00390625 ) ///< Conversion from counts (LSB) to gravities. +#define G_PER_LSB ( 0.00390625F ) ///< Conversion from counts (LSB) to gravities. /// Maximum time w/o new accelerometer sample from FPGA. static const U32 NO_NEW_ACCEL_SAMPLES_TIMEOUT = ( 100 / TASK_PRIORITY_INTERVAL ); -#define NOMINAL_ACCEL_VECTOR_LENGTH ( 1.0 ) ///< Expect unit vector length when system is stable. -#define MAX_ACCEL_VECTOR_LENGTH_ERROR ( 0.1 ) ///< POST test looks at vector length at presumably stable moment - should be 1 +/- 0.1. -#define MAX_TILT_ANGLE ( 7.0 ) ///< Maximum tilt of system before alarm. -#define MAX_TILT_ANGLE_TO_CLEAR_ALARM ( 5.0 ) ///< Maximum tilt of system before alarm is cleared. +#define NOMINAL_ACCEL_VECTOR_LENGTH ( 1.0F ) ///< Expect unit vector length when system is stable. +#define MAX_ACCEL_VECTOR_LENGTH_ERROR ( 0.1F ) ///< POST test looks at vector length at presumably stable moment - should be 1 +/- 0.1. +#define MAX_TILT_ANGLE ( 7.0F ) ///< Maximum tilt of system before alarm. +#define MAX_TILT_ANGLE_TO_CLEAR_ALARM ( 5.0F ) ///< Maximum tilt of system before alarm is cleared. /// Maximum time (in task intervals) that a tilt in excess of limit can persist before alarm. static const U32 MAX_TILT_PERSISTENCE = ( 1 * MS_PER_SECOND / TASK_PRIORITY_INTERVAL ); -#define MAX_SHOCK_ACCELERATION ( 2.5 ) ///< Maximum shock (acceleration) measured on any axis before alarm. -#define MAX_SHOCK_TO_CLEAR_ALARM ( 1.0 ) ///< Maximum shock (acceleration) measured on any axis in order to clear alarm. -#define MAX_TILT_G ( 1.0 ) ///< Maximum tilt (in g). -#define MAX_TILT_ANGLE_DEG ( 90.0 ) ///< Maximum tilt angle (in degrees). +#define MAX_SHOCK_ACCELERATION ( 2.5F ) ///< Maximum shock (acceleration) measured on any axis before alarm. +#define MAX_SHOCK_TO_CLEAR_ALARM ( 1.0F ) ///< Maximum shock (acceleration) measured on any axis in order to clear alarm. +#define MAX_TILT_G ( 1.0F ) ///< Maximum tilt (in g). +#define MAX_TILT_ANGLE_DEG ( 90.0F ) ///< Maximum tilt angle (in degrees). #define DATA_PUBLISH_COUNTER_START_COUNT 30 ///< Data publish counter start count. /// Enumeration of accelerometer monitor states. Index: Common.h =================================================================== diff -u -r66600859e4fb3036f48901aae8c9845f37e3e707 -re2611bd03c4a86fae5d4f525b91d6fbfb597a8e0 --- Common.h (.../Common.h) (revision 66600859e4fb3036f48901aae8c9845f37e3e707) +++ Common.h (.../Common.h) (revision e2611bd03c4a86fae5d4f525b91d6fbfb597a8e0) @@ -104,15 +104,15 @@ #define MAX_DOUBLE_DIGIT_DECIMAL 99U ///< Maximum value for a decimal byte #define MAX_SINGLE_DIGIT_DECIMAL 9U ///< Maximum value for a decimal nibble #define SHIFT_BITS_BY_4 4U ///< Number of bits to shift in order to shift a nibble -#define FLOAT_TO_INT_ROUNDUP_OFFSET 0.5 ///< Offset to add to a floating point value for rounding rounding when converting to integer +#define FLOAT_TO_INT_ROUNDUP_OFFSET 0.5F ///< Offset to add to a floating point value for rounding rounding when converting to integer #define ML_PER_LITER 1000 ///< Number of milliliters in a liter #define MA_PER_AMP 1000 ///< Number of milliamps in an amp #define MS_PER_SECOND 1000 ///< Number of milliseconds in a second #define US_PER_SECOND 1000000 ///< Number of microseconds in a millisecond #define SEC_PER_MIN 60 ///< Number of seconds in a minute -#define FRACTION_TO_PERCENT_FACTOR 100.0 ///< Percentage factor (100) +#define FRACTION_TO_PERCENT_FACTOR 100.0F ///< Percentage factor (100) #define MIN_PER_HOUR 60 ///< Number of minutes in an hour -#define PI 3.1415927 ///< PI +#define PI 3.1415927F ///< PI #define SECONDS_IN_A_DAY 86400 ///< Number of seconds in a day #define BITS_8_FULL_SCALE 256 ///< Full scale range for 8 bit ADC or DAC #define BITS_10_FULL_SCALE 1024 ///< Full scale range for 10 bit ADC or DAC @@ -122,7 +122,7 @@ // **** Common Macros **** -#define FLOAT_TO_INT_WITH_ROUND(f) ((f) < 0.0 ? (S32)((f) - FLOAT_TO_INT_ROUNDUP_OFFSET) : (S32)((f) + FLOAT_TO_INT_ROUNDUP_OFFSET)) ///< Macro converts a floating point value to an integer +#define FLOAT_TO_INT_WITH_ROUND(f) ((f) < 0.0F ? (S32)((f) - FLOAT_TO_INT_ROUNDUP_OFFSET) : (S32)((f) + FLOAT_TO_INT_ROUNDUP_OFFSET)) ///< Macro converts a floating point value to an integer #define CAP(v, u) ((v) > (u) ? (u) : (v)) ///< Macro caps a value to a maximum #define RANGE(v, l, u) ((v) > (u) ? (u) : ((v) < (l) ? (l) : (v))) ///< Macro enforces a range on a value #define INC_WRAP(v, l, u) ((v) >= (u) ? (l) : ((v) + 1)) ///< Macro increments a value and wraps to a minimum when a maximum is reached @@ -138,7 +138,7 @@ #define MAKE_LONG_OF_WORDS(h, l) ((((U32)(h) << SHIFT_16_BITS_FOR_WORD_SHIFT) & MASK_OFF_LSW) | ((U32)(l) & MASK_OFF_MSW)) ///< Macro merges two 2-byte words into a 4-byte word #define GET_TOGGLE(v, l, h) ((v) == (l) ? (h) : (l)) ///< Macro toggles a value #define BIT_BY_POS(p) (1U << (p)) ///< Macro returns a bit mask for a bit of given position -#define RAD2DEG(r) ((r) * 180.0 / PI) ///< Macro converts radians to degrees +#define RAD2DEG(r) ((r) * 180.0F / PI) ///< Macro converts radians to degrees /// Macro to set a specific alarm with 1 piece of unsigned 32-bit alarm data. #define SET_ALARM_WITH_1_U32_DATA(a,d1) { \ 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 Index: NVDataMgmt.h =================================================================== diff -u -r66600859e4fb3036f48901aae8c9845f37e3e707 -re2611bd03c4a86fae5d4f525b91d6fbfb597a8e0 --- NVDataMgmt.h (.../NVDataMgmt.h) (revision 66600859e4fb3036f48901aae8c9845f37e3e707) +++ NVDataMgmt.h (.../NVDataMgmt.h) (revision e2611bd03c4a86fae5d4f525b91d6fbfb597a8e0) @@ -115,7 +115,9 @@ BOOL getNVRecord2Driver( NV_DATA_T nvData, U08* bufferAddress, U32 bufferLength, U08 numOfSnsrs2Check, ALARM_ID_T nvAlarm ); +#ifndef _RELEASE_ U08 getSoftwareConfigStatus( SOFTWARE_CONFIG_T config ); +#endif #ifdef _DG_ BOOL setWaterConsumption ( U32 liters );