Skip to content

Commit

Permalink
Uppercase id
Browse files Browse the repository at this point in the history
  • Loading branch information
peterharperuk committed Aug 15, 2024
1 parent 298ef26 commit ed65b18
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/rp2_common/pico_unique_id/unique_id.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ static void __attribute__((constructor)) _retrieve_unique_id_on_boot(void) {
#elif (PICO_UNIQUE_BOARD_ID_SIZE_BYTES == FLASH_UNIQUE_ID_SIZE_BYTES)
flash_get_unique_id(retrieved_id.id);
#elif (PICO_UNIQUE_BOARD_ID_SIZE_BYTES < FLASH_UNIQUE_ID_SIZE_BYTES)
// The flash id is >8 bytes (e.g. IS25LP016D) but we want to keep the
// pico unique board id as 8 bytes, just use the last 8 bytes which are likely to change
// The flash ID is >8 bytes (e.g. IS25LP016D) but we want to keep the
// pico unique board ID as 8 bytes, just use the last 8 bytes which are likely to change
uint8_t flash_id[FLASH_UNIQUE_ID_SIZE_BYTES];
flash_get_unique_id(flash_id);
memcpy(retrieved_id.id, flash_id + FLASH_UNIQUE_ID_SIZE_BYTES - PICO_UNIQUE_BOARD_ID_SIZE_BYTES, PICO_UNIQUE_BOARD_ID_SIZE_BYTES);
#else
#error unique board id size is greater than flash unique id size
#error unique board ID size is greater than flash unique ID size
#endif
#else
rom_get_sys_info_fn func = (rom_get_sys_info_fn) rom_func_lookup(ROM_FUNC_GET_SYS_INFO);
Expand Down

0 comments on commit ed65b18

Please sign in to comment.