🔧 STM32 UID followup (#26727)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
parent
a2228276bb
commit
e668d5afd7
|
@ -35,7 +35,7 @@
|
||||||
#include "../../feature/caselight.h"
|
#include "../../feature/caselight.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(MACHINE_UUID) && HAS_STM32_UID
|
#if !defined(MACHINE_UUID) && ENABLED(HAS_STM32_UID)
|
||||||
#include "../../libs/hex_print.h"
|
#include "../../libs/hex_print.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ void GcodeSuite::M115() {
|
||||||
#if NUM_AXES != XYZ
|
#if NUM_AXES != XYZ
|
||||||
" AXIS_COUNT:" STRINGIFY(NUM_AXES)
|
" AXIS_COUNT:" STRINGIFY(NUM_AXES)
|
||||||
#endif
|
#endif
|
||||||
#if defined(MACHINE_UUID) || HAS_STM32_UID
|
#if defined(MACHINE_UUID) || ENABLED(HAS_STM32_UID)
|
||||||
" UUID:"
|
" UUID:"
|
||||||
#endif
|
#endif
|
||||||
#ifdef MACHINE_UUID
|
#ifdef MACHINE_UUID
|
||||||
|
@ -80,7 +80,7 @@ void GcodeSuite::M115() {
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
|
||||||
#if !defined(MACHINE_UUID) && HAS_STM32_UID
|
#if !defined(MACHINE_UUID) && ENABLED(HAS_STM32_UID)
|
||||||
/**
|
/**
|
||||||
* STM32-based devices have a 96-bit CPU device serial number.
|
* STM32-based devices have a 96-bit CPU device serial number.
|
||||||
* Used by LumenPnP / OpenPNP to keep track of unique hardware/configurations.
|
* Used by LumenPnP / OpenPNP to keep track of unique hardware/configurations.
|
||||||
|
@ -93,7 +93,7 @@ void GcodeSuite::M115() {
|
||||||
#else
|
#else
|
||||||
uint16_t * const UID = (uint16_t*)UID_BASE;
|
uint16_t * const UID = (uint16_t*)UID_BASE;
|
||||||
SERIAL_ECHO(
|
SERIAL_ECHO(
|
||||||
F("CEDE2A2F-"), hex_word(UID[0]), '-', hex_word(UID[1]), '-', hex_word(UID[2]), '-',
|
F("CEDE2A2F-"), hex_word(UID[0]), C('-'), hex_word(UID[1]), C('-'), hex_word(UID[2]), C('-'),
|
||||||
hex_word(UID[3]), hex_word(UID[4]), hex_word(UID[5])
|
hex_word(UID[3]), hex_word(UID[4]), hex_word(UID[5])
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -35,8 +35,8 @@ char* _hex_word(const uint16_t w);
|
||||||
char* hex_address(const void * const w);
|
char* hex_address(const void * const w);
|
||||||
char* _hex_long(const uintptr_t l);
|
char* _hex_long(const uintptr_t l);
|
||||||
|
|
||||||
template<typename T> char* hex_word(T w) { return hex_word((uint16_t)w); }
|
template<typename T> char* hex_word(T w) { return _hex_word((uint16_t)w); }
|
||||||
template<typename T> char* hex_long(T w) { return hex_long((uint32_t)w); }
|
template<typename T> char* hex_long(T w) { return _hex_long((uint32_t)w); }
|
||||||
|
|
||||||
void print_hex_nybble(const uint8_t n);
|
void print_hex_nybble(const uint8_t n);
|
||||||
void print_hex_byte(const uint8_t b);
|
void print_hex_byte(const uint8_t b);
|
||||||
|
|
|
@ -45,11 +45,6 @@
|
||||||
// I2C MCP3426 (16-Bit, 240SPS, dual-channel ADC)
|
// I2C MCP3426 (16-Bit, 240SPS, dual-channel ADC)
|
||||||
#define HAS_MCP3426_ADC
|
#define HAS_MCP3426_ADC
|
||||||
|
|
||||||
// Opulo Lumen uses the CPU serial number
|
|
||||||
#ifdef STM32F4
|
|
||||||
#define HAS_STM32_UID 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Servos
|
// Servos
|
||||||
//
|
//
|
||||||
|
|
|
@ -45,11 +45,6 @@
|
||||||
// I2C MCP3426 (16-Bit, 240SPS, dual-channel ADC)
|
// I2C MCP3426 (16-Bit, 240SPS, dual-channel ADC)
|
||||||
#define HAS_MCP3426_ADC
|
#define HAS_MCP3426_ADC
|
||||||
|
|
||||||
// Opulo Lumen uses the CPU serial number
|
|
||||||
#ifdef STM32F4
|
|
||||||
#define HAS_STM32_UID 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Servos
|
// Servos
|
||||||
//
|
//
|
||||||
|
|
|
@ -111,7 +111,7 @@ extends = stm32_variant
|
||||||
board = marlin_opulo_lumen_rev3
|
board = marlin_opulo_lumen_rev3
|
||||||
build_flags = ${stm32_variant.build_flags}
|
build_flags = ${stm32_variant.build_flags}
|
||||||
-DARDUINO_BLACK_F407VE
|
-DARDUINO_BLACK_F407VE
|
||||||
-DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS
|
-DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS -DHAS_STM32_UID
|
||||||
extra_scripts = ${stm32_variant.extra_scripts}
|
extra_scripts = ${stm32_variant.extra_scripts}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -122,7 +122,7 @@ extends = stm32_variant
|
||||||
board = marlin_opulo_lumen_rev4
|
board = marlin_opulo_lumen_rev4
|
||||||
build_flags = ${stm32_variant.build_flags}
|
build_flags = ${stm32_variant.build_flags}
|
||||||
-DARDUINO_BLACK_F407VE
|
-DARDUINO_BLACK_F407VE
|
||||||
-DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS
|
-DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS -DHAS_STM32_UID
|
||||||
extra_scripts = ${stm32_variant.extra_scripts}
|
extra_scripts = ${stm32_variant.extra_scripts}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue