您可以使用按位运算符:
uint16_t wd = ((uint16_t)d2 << 8) | d1;
因为:
(0x0002 << 8) | 0x01 = 0x0200 | 0x0001 = 0x0201
uint16_t wd = ((uint16_t)d2 << 8) | d1;
因为:
(0x0002 << 8) | 0x01 = 0x0200 | 0x0001 = 0x0201