/* Swap 16bit value - let compiler figure out the best way  */
static uint16_t swap16(uint16_t a)
/* Swap 16bit value - let compiler figure out the best way  */
static uint16_t swap16(uint16_t a)
{
    return ((a & 0x00ff) << 8) | ((a & 0xff00) >> 8);
}