/* Obtains a 16-bit value from a byte buffer taking into account Intel or Motorola byte ordering.  */
static uint16_t XcpLoaderGetOrderedWord(uint8_t const *data)
/* Obtains a 16-bit value from a byte buffer taking into account Intel or Motorola byte ordering.  */
static uint16_t XcpLoaderGetOrderedWord(uint8_t const *data)
{
  uint16_t result = 0;
  assert(data != NULL);
  if (data != NULL)
  {
    if (xcpSlaveIsIntel)
    {
      result |= (uint16_t)data[0];
      result |= (uint16_t)(data[1] << 8);
    }
    else
    {
      result |= (uint16_t)data[1];
      result |= (uint16_t)(data[0] << 8);
    }
  }
  return result;
}