summaryrefslogtreecommitdiff
path: root/platforms/chibios/hardware_id.c
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2022-11-28 07:54:00 +1100
committerNick Brassel <nick@tzarc.org>2022-11-28 07:54:00 +1100
commit4020674163fc80914059c4c9c3be5c0ae00bd150 (patch)
tree6f4187d72b04d03572adf507502afbda9726d696 /platforms/chibios/hardware_id.c
parent8f9b49dc5b05fd3421e47aa76822a5b2199dfca6 (diff)
parent9e78e65a566487b2f4fe7b663971a01deb6ddad2 (diff)
Merge remote-tracking branch 'upstream/develop'
Diffstat (limited to 'platforms/chibios/hardware_id.c')
-rw-r--r--platforms/chibios/hardware_id.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/platforms/chibios/hardware_id.c b/platforms/chibios/hardware_id.c
index 888a275465..1097db5966 100644
--- a/platforms/chibios/hardware_id.c
+++ b/platforms/chibios/hardware_id.c
@@ -6,10 +6,15 @@
hardware_id_t get_hardware_id(void) {
hardware_id_t id = {0};
-#ifdef UID_BASE
+#if defined(RP2040)
+ // Forward declare as including "hardware/flash.h" here causes more issues...
+ void flash_get_unique_id(uint8_t *);
+
+ flash_get_unique_id((uint8_t *)&id);
+#elif defined(UID_BASE)
id.data[0] = (uint32_t)(*((uint32_t *)UID_BASE));
id.data[1] = (uint32_t)(*((uint32_t *)(UID_BASE + 4)));
- id.data[1] = (uint32_t)(*((uint32_t *)(UID_BASE + 8)));
+ id.data[2] = (uint32_t)(*((uint32_t *)(UID_BASE + 8)));
#endif
return id;
}