usb_dfu: fix U_ID decoding
This commit is contained in:
parent
3cec6dfb79
commit
a689229acb
|
@ -328,11 +328,11 @@ void usb_dfu_setup(void)
|
||||||
for (uint8_t i = 0; i < LENGTH(usb_serial) - 1; i++) { // write the serial
|
for (uint8_t i = 0; i < LENGTH(usb_serial) - 1; i++) { // write the serial
|
||||||
uint32_t id; // current ID part
|
uint32_t id; // current ID part
|
||||||
if (i < 8) {
|
if (i < 8) {
|
||||||
id = DESIG_UNIQUE_ID0;
|
id = DESIG_UNIQUE_ID2;
|
||||||
} else if (i < 16) {
|
} else if (i < 16) {
|
||||||
id = DESIG_UNIQUE_ID1;
|
id = DESIG_UNIQUE_ID1;
|
||||||
} else {
|
} else {
|
||||||
id = DESIG_UNIQUE_ID2;
|
id = (DESIG_UNIQUE_ID0 << 16) + (DESIG_UNIQUE_ID0 >> 16);
|
||||||
}
|
}
|
||||||
// transform into character
|
// transform into character
|
||||||
char c = (id >> ((7 - (i % 8)) * 4)) & 0x0f; // get nibble
|
char c = (id >> ((7 - (i % 8)) * 4)) & 0x0f; // get nibble
|
||||||
|
|
Loading…
Reference in New Issue