Don't lose half of the processor's serial number

Before this change, `microcontroller.cpu.uid` returned values
where the top 4 bits of each byte were zero, because of
an incorrect bitmask used in this function.
This commit is contained in:
Jeff Epler 2018-03-25 12:57:43 -05:00
parent fa88446679
commit c0029e1d97
2 changed files with 2 additions and 2 deletions

View File

@ -243,7 +243,7 @@ void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) {
for (int i=0; i<4; i++) {
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;
}
}
}

View File

@ -76,7 +76,7 @@ void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) {
for (int i=0; i<2; i++) {
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;
}
}
}