Merge pull request #708 from jepler/cpu-uid-nibbles
Don't lose half of the processor's serial number
This commit is contained in:
commit
df731884a6
@ -243,7 +243,7 @@ void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) {
|
|||||||
|
|
||||||
for (int i=0; i<4; i++) {
|
for (int i=0; i<4; i++) {
|
||||||
for (int k=0; k<4; k++) {
|
for (int k=0; k<4; k++) {
|
||||||
raw_id[4 * i + k] = (*(id_addresses[i]) >> k * 8) & 0xf;
|
raw_id[4 * i + k] = (*(id_addresses[i]) >> k * 8) & 0xff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) {
|
|||||||
|
|
||||||
for (int i=0; i<2; i++) {
|
for (int i=0; i<2; i++) {
|
||||||
for (int k=0; k<4; k++) {
|
for (int k=0; k<4; k++) {
|
||||||
raw_id[4 * i + k] = (*(id_addresses[i]) >> k * 8) & 0xf;
|
raw_id[4 * i + k] = (*(id_addresses[i]) >> k * 8) & 0xff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user