Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STM32 UID followup #26727

Merged
merged 4 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Marlin/src/gcode/host/M115.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,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 @@ -72,15 +72,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 @@ -93,7 +93,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
4 changes: 2 additions & 2 deletions Marlin/src/libs/hex_print.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ char* _hex_word(const uint16_t w);
char* hex_address(const void * const w);
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_long(T w) { return hex_long((uint32_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); }

void print_hex_nybble(const uint8_t n);
void print_hex_byte(const uint8_t b);
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 @@ -111,7 +111,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 @@ -122,7 +122,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
Loading