Merge pull request #708 from jepler/cpu-uid-nibbles

Don't lose half of the processor's serial number
This commit is contained in:
Dan Halbert 2018-03-25 23:53:02 -04:00 committed by GitHub
commit df731884a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 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;
} }
} }
} }

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 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;
} }
} }
} }