Skip to content

Commit 1457ce4

Browse files
committed
/ports/nrf/common-hal/microcontroller.c: correction
/ports/nrf/common-hal/microcontroller.c: corrected `raw_id[]` assignment per requested changes in PR adafruit#527
1 parent 3ef2077 commit 1457ce4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ports/nrf/common-hal/microcontroller/Processor.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) {
4040
uint32_t* id_addresses[2] = {(uint32_t *) 0x060, (uint32_t *) 0x064};
4141

4242
for (int i=0; i<2; i++) {
43-
raw_id[i] = *id_addresses[i];
43+
for (int k=0; k<4; k++) {
44+
raw_id[4 * i + k] = (*(id_addresses[i]) >> k * 8) & 0xf;
45+
}
4446
}
4547
}

0 commit comments

Comments
 (0)