|
@@ -32,6 +32,10 @@
|
32
|
32
|
#include "../../feature/caselight.h"
|
33
|
33
|
#endif
|
34
|
34
|
|
|
35
|
+#if ENABLED(HAS_STM32_UID) && !defined(MACHINE_UUID)
|
|
36
|
+ #include "../../libs/hex_print.h"
|
|
37
|
+#endif
|
|
38
|
+
|
35
|
39
|
//#define MINIMAL_CAP_LINES // Don't even mention the disabled capabilities
|
36
|
40
|
|
37
|
41
|
#if ENABLED(EXTENDED_CAPABILITIES_REPORT)
|
|
@@ -59,20 +63,37 @@
|
59
|
63
|
* the capability is not present.
|
60
|
64
|
*/
|
61
|
65
|
void GcodeSuite::M115() {
|
62
|
|
- SERIAL_ECHOLNPGM(
|
63
|
|
- "FIRMWARE_NAME:Marlin " DETAILED_BUILD_VERSION " (" __DATE__ " " __TIME__ ") "
|
64
|
|
- "SOURCE_CODE_URL:" SOURCE_CODE_URL " "
|
65
|
|
- "PROTOCOL_VERSION:" PROTOCOL_VERSION " "
|
66
|
|
- "MACHINE_TYPE:" MACHINE_NAME " "
|
67
|
|
- "EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " "
|
|
66
|
+ SERIAL_ECHOPGM("FIRMWARE_NAME:Marlin"
|
|
67
|
+ " " DETAILED_BUILD_VERSION " (" __DATE__ " " __TIME__ ")"
|
|
68
|
+ " SOURCE_CODE_URL:" SOURCE_CODE_URL
|
|
69
|
+ " PROTOCOL_VERSION:" PROTOCOL_VERSION
|
|
70
|
+ " MACHINE_TYPE:" MACHINE_NAME
|
|
71
|
+ " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS)
|
68
|
72
|
#if NUM_AXES != XYZ
|
69
|
|
- "AXIS_COUNT:" STRINGIFY(NUM_AXES) " "
|
|
73
|
+ " AXIS_COUNT:" STRINGIFY(NUM_AXES)
|
70
|
74
|
#endif
|
71
|
75
|
#ifdef MACHINE_UUID
|
72
|
|
- "UUID:" MACHINE_UUID
|
|
76
|
+ " UUID:" MACHINE_UUID
|
73
|
77
|
#endif
|
74
|
78
|
);
|
75
|
79
|
|
|
80
|
+ // STM32UID:111122223333
|
|
81
|
+ #if ENABLED(HAS_STM32_UID) && !defined(MACHINE_UUID)
|
|
82
|
+ // STM32 based devices output the CPU device serial number
|
|
83
|
+ // Used by LumenPnP / OpenPNP to keep track of unique hardware/configurations
|
|
84
|
+ // https://github.com/opulo-inc/lumenpnp
|
|
85
|
+ // Although this code should work on all STM32 based boards
|
|
86
|
+ SERIAL_ECHOPGM(" UUID:");
|
|
87
|
+ uint32_t *uid_address = (uint32_t*)UID_BASE;
|
|
88
|
+ LOOP_L_N(i, 3) {
|
|
89
|
+ const uint32_t UID = uint32_t(READ_REG(*(uid_address)));
|
|
90
|
+ uid_address += 4U;
|
|
91
|
+ for (int B = 24; B >= 0; B -= 8) print_hex_byte(UID >> B);
|
|
92
|
+ }
|
|
93
|
+ #endif
|
|
94
|
+
|
|
95
|
+ SERIAL_EOL();
|
|
96
|
+
|
76
|
97
|
#if ENABLED(EXTENDED_CAPABILITIES_REPORT)
|
77
|
98
|
|
78
|
99
|
// The port that sent M115
|