We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3cad30d + 4291571 commit e33ec1fCopy full SHA for e33ec1f
cores/arduino/Adafruit_TinyUSB_Core/Adafruit_TinyUSB_Core.cpp
@@ -99,7 +99,7 @@ uint8_t load_serial_number(uint16_t* serial_str)
99
100
for (int i=0; i<4; i++) {
101
for (int k=0; k<4; k++) {
102
- raw_id[4 * i + k] = (*(id_addresses[i]) >> k * 8) & 0xff;
+ raw_id[4 * i + (3 - k)] = (*(id_addresses[i]) >> k * 8) & 0xff;
103
}
104
105
@@ -109,7 +109,7 @@ uint8_t load_serial_number(uint16_t* serial_str)
109
for (int j = 0; j < 2; j++) {
110
uint8_t nibble = (raw_id[i] >> (j * 4)) & 0xf;
111
// Strings are UTF-16-LE encoded.
112
- serial_str[i * 2 + j] = nibble_to_hex[nibble];
+ serial_str[i * 2 + (1 - j)] = nibble_to_hex[nibble];
113
114
115
0 commit comments