Index: firmware/App/Common.h =================================================================== diff -u -rfc4f469fe234371e8f2b9a0625acc66faa6899de -rba60692a9ecaf59cb5cb8490f4276917f43bcd01 --- firmware/App/Common.h (.../Common.h) (revision fc4f469fe234371e8f2b9a0625acc66faa6899de) +++ firmware/App/Common.h (.../Common.h) (revision ba60692a9ecaf59cb5cb8490f4276917f43bcd01) @@ -16,6 +16,12 @@ #define MASK_OFF_LSB 0xFF00 ///< Bits to mask off the least significant byte of a 2-byte word #define SHIFT_8_BITS_FOR_BYTE_SHIFT 8 ///< Number of bits to shift in order to shift a byte +#define GET_LSB_OF_WORD(w) ((U08)((w) & MASK_OFF_MSB)) ///< Macro returns the least signficant byte of a 2-byte word +#define GET_MSB_OF_WORD(w) ((U08)(((w) >> SHIFT_8_BITS_FOR_BYTE_SHIFT) & MASK_OFF_MSB)) ///< Macro returns the most signficant byte of a 2-byte word +#define MAKE_WORD_OF_BYTES(h, l) ((((U16)(h) << SHIFT_8_BITS_FOR_BYTE_SHIFT) & MASK_OFF_LSB) | ((U16)(l) & MASK_OFF_MSB)) ///< Macro merges two bytes into a 2-byte word +#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 + + // **** Types **** typedef float F32; ///< 32-bit floating point type