Index: firmware/App/Common.h =================================================================== diff -u -rba60692a9ecaf59cb5cb8490f4276917f43bcd01 -r3a0dc476f0f42bb7ebadc7d6109a0b5b6581cce4 --- firmware/App/Common.h (.../Common.h) (revision ba60692a9ecaf59cb5cb8490f4276917f43bcd01) +++ firmware/App/Common.h (.../Common.h) (revision 3a0dc476f0f42bb7ebadc7d6109a0b5b6581cce4) @@ -8,14 +8,16 @@ #ifndef __COMMON_H__ #define __COMMON_H__ -#define NUM_OF_FW_STACKS 3 +#define NUM_OF_FW_STACKS 3 #define FIRMWARE_START_ADDRESS 0x00010000 #define FIRMWARE_CRC_TABLE_ADDRESS 0x10020 ///< The starting address of CRC table for firmware image. #define SW_UPDATE_FLASH_BUFFER_SIZE 128 #define MASK_OFF_MSB 0x00FF ///< Bits to mask off the most significant byte of a 2-byte word #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 MASK_OFF_NIBBLE_MSB 0x0F ///< Bits to mask off the most significant nibble of 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