aboutsummaryrefslogtreecommitdiff
path: root/platforms
diff options
context:
space:
mode:
authorNick Brassel <[email protected]>2024-07-05 11:22:08 +1000
committerGitHub <[email protected]>2024-07-05 11:22:08 +1000
commit3a711f4cfa71419a22a22139d68c647ffa3f1fe4 (patch)
tree133c13e277b241646c32bd19d1305eeda5e219d3 /platforms
parentcd22b8a9458fbe17b68bdd360822db696b559dfe (diff)
downloadqmk_firmware-3a711f4cfa71419a22a22139d68c647ffa3f1fe4.tar.gz
qmk_firmware-3a711f4cfa71419a22a22139d68c647ffa3f1fe4.zip
Allow overriding `get_hardware_id()`. (#24051)
Diffstat (limited to 'platforms')
-rw-r--r--platforms/arm_atsam/hardware_id.c2
-rw-r--r--platforms/avr/hardware_id.c2
-rw-r--r--platforms/chibios/hardware_id.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/platforms/arm_atsam/hardware_id.c b/platforms/arm_atsam/hardware_id.c
index 8b3b35a492..fc193e46d8 100644
--- a/platforms/arm_atsam/hardware_id.c
+++ b/platforms/arm_atsam/hardware_id.c
@@ -3,7 +3,7 @@
#include "hardware_id.h"
-hardware_id_t get_hardware_id(void) {
+__attribute__((weak)) hardware_id_t get_hardware_id(void) {
hardware_id_t id = {0};
return id;
}
diff --git a/platforms/avr/hardware_id.c b/platforms/avr/hardware_id.c
index b61f0d92df..302a800e0b 100644
--- a/platforms/avr/hardware_id.c
+++ b/platforms/avr/hardware_id.c
@@ -10,7 +10,7 @@
#include <avr/boot.h>
#include "hardware_id.h"
-hardware_id_t get_hardware_id(void) {
+__attribute__((weak)) hardware_id_t get_hardware_id(void) {
hardware_id_t id = {0};
for (uint8_t i = 0; i < 10; i += 1) {
((uint8_t*)&id)[i] = boot_signature_byte_get(i + 0x0E);
diff --git a/platforms/chibios/hardware_id.c b/platforms/chibios/hardware_id.c
index 1097db5966..fb67a0a63e 100644
--- a/platforms/chibios/hardware_id.c
+++ b/platforms/chibios/hardware_id.c
@@ -4,7 +4,7 @@
#include <ch.h>
#include "hardware_id.h"
-hardware_id_t get_hardware_id(void) {
+__attribute__((weak)) hardware_id_t get_hardware_id(void) {
hardware_id_t id = {0};
#if defined(RP2040)
// Forward declare as including "hardware/flash.h" here causes more issues...