Skip to content

Commit

Permalink
🔧 STM32 UID followup (#26727)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
  • Loading branch information
ellensp and thinkyhead committed Nov 16, 2024
1 parent 7d0c256 commit eed29ea
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 16 deletions.
8 changes: 4 additions & 4 deletions Marlin/src/gcode/host/M115.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "../../feature/caselight.h"
#endif

#if !defined(MACHINE_UUID) && HAS_STM32_UID
#if !defined(MACHINE_UUID) && ENABLED(HAS_STM32_UID)
#include "../../libs/hex_print.h"
#endif

Expand Down Expand Up @@ -69,15 +69,15 @@ void GcodeSuite::M115() {
#if NUM_AXES != XYZ
" AXIS_COUNT:" STRINGIFY(NUM_AXES)
#endif
#if defined(MACHINE_UUID) || HAS_STM32_UID
#if defined(MACHINE_UUID) || ENABLED(HAS_STM32_UID)
" UUID:"
#endif
#ifdef MACHINE_UUID
MACHINE_UUID
#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.
* Used by LumenPnP / OpenPNP to keep track of unique hardware/configurations.
Expand All @@ -90,7 +90,7 @@ void GcodeSuite::M115() {
#else
uint16_t * const UID = (uint16_t*)UID_BASE;
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])
);
#endif
Expand Down
5 changes: 0 additions & 5 deletions Marlin/src/pins/stm32f4/pins_OPULO_LUMEN_REV3.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@
// I2C MCP3426 (16-Bit, 240SPS, dual-channel ADC)
#define HAS_MCP3426_ADC

// Opulo Lumen uses the CPU serial number
#ifdef STM32F4
#define HAS_STM32_UID 1
#endif

//
// Servos
//
Expand Down
5 changes: 0 additions & 5 deletions Marlin/src/pins/stm32f4/pins_OPULO_LUMEN_REV4.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@
// I2C MCP3426 (16-Bit, 240SPS, dual-channel ADC)
#define HAS_MCP3426_ADC

// Opulo Lumen uses the CPU serial number
#ifdef STM32F4
#define HAS_STM32_UID 1
#endif

//
// Servos
//
Expand Down
4 changes: 2 additions & 2 deletions ini/stm32f4.ini
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ extends = stm32_variant
board = marlin_opulo_lumen_rev3
build_flags = ${stm32_variant.build_flags}
-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}

#
Expand All @@ -111,7 +111,7 @@ extends = stm32_variant
board = marlin_opulo_lumen_rev4
build_flags = ${stm32_variant.build_flags}
-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}

#
Expand Down

0 comments on commit eed29ea

Please sign in to comment.