You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
390 B

  1. // Copyright 2022 QMK
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #include <ch.h>
  4. #include "hardware_id.h"
  5. hardware_id_t get_hardware_id(void) {
  6. hardware_id_t id = {0};
  7. #ifdef UID_BASE
  8. id.data[0] = (uint32_t)(*((uint32_t *)UID_BASE));
  9. id.data[1] = (uint32_t)(*((uint32_t *)(UID_BASE + 4)));
  10. id.data[1] = (uint32_t)(*((uint32_t *)(UID_BASE + 8)));
  11. #endif
  12. return id;
  13. }