Index: Common.h =================================================================== diff -u -r291e22d0afa53ac43999b6270800077e37f1d991 -r6b11ea4a37a54cd47af543900dfa68dac27c8c7e --- Common.h (.../Common.h) (revision 291e22d0afa53ac43999b6270800077e37f1d991) +++ Common.h (.../Common.h) (revision 6b11ea4a37a54cd47af543900dfa68dac27c8c7e) @@ -8,7 +8,7 @@ * @file Common.h * * @author (last) Dara Navaei -* @date (last) 03-Mar-2022 +* @date (last) 03-Aug-2022 * * @author (original) Sean * @date (original) 04-Feb-2020 @@ -86,7 +86,7 @@ // **** Common Definitions **** #define NEARLY_INFINITY 1.0E20 ///< Value that is nearly infinity. -#define NEARLY_ZERO 0.00000001 ///< Value that is nearly zero. Used for floating point zero comparisons (e.g. divide by zero checks) +#define NEARLY_ZERO 0.00000001F ///< Value that is nearly zero. Used for floating point zero comparisons (e.g. divide by zero checks) #define HEX_64_K 0x10000 ///< 64K (65536 in decimal) #define HEX_32_BIT_FULL_SCALE 0xFFFFFFFF ///< 32-bit full scale value #define MASK_OFF_MSB 0x00FF ///< Bits to mask off the most significant byte of a 2-byte word @@ -104,6 +104,7 @@ #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 SHIFT_BITS_BY_31 31 ///< Shift bits by 31 #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 @@ -119,6 +120,7 @@ #define BITS_12_FULL_SCALE 4096 ///< Full scale range for 12 bit ADC or DAC #define BITS_14_FULL_SCALE 16384 ///< Full scale range for 14 bit ADC or DAC #define BITS_16_FULL_SCALE 65536 ///< Full scale range for 16 bit ADC or DAC +#define HALF 0.5F ///< Half // **** Common Macros ****