MCPcopy Create free account
hub / github.com/MarlinFirmware/Marlin / M115

Method M115

Marlin/src/gcode/host/M115.cpp:66–301  ·  view source on GitHub ↗

* M115: Firmware Info * * Capabilities string and extended capabilities report. * If a capability is not reported, hosts should assume * the capability is not present. * * NOTE: Always make sure to add new capabilities to the RepRap Wiki * at https://reprap.org/wiki/Firmware_Capabilities_Protocol */

Source from the content-addressed store, hash-verified

64 * at https://reprap.org/wiki/Firmware_Capabilities_Protocol
65 */
66void GcodeSuite::M115() {
67
68 // Hosts should match one of these
69 #define MACHINE_KINEMATICS "" \
70 TERN_(COREXY, "COREXY") TERN_(COREYX, "COREYX") \
71 TERN_(COREXZ, "COREXZ") TERN_(COREZX, "COREZX") \
72 TERN_(COREYZ, "COREYZ") TERN_(COREZY, "COREZY") \
73 TERN_(MARKFORGED_XY, "MARKFORGED_XY") TERN_(MARKFORGED_YX, "MARKFORGED_YX") \
74 TERN_(POLARGRAPH, "POLARGRAPH") \
75 TERN_(POLAR, "POLAR") \
76 TERN_(DELTA, "DELTA") \
77 TERN_(IS_SCARA, "SCARA") \
78 TERN_(IS_CARTESIAN, "Cartesian") \
79 TERN_(BELTPRINTER, " BELTPRINTER")
80
81 SERIAL_ECHOPGM("FIRMWARE_NAME:Marlin"
82 " " DETAILED_BUILD_VERSION " (" __DATE__ " " __TIME__ ")"
83 " SOURCE_CODE_URL:" SOURCE_CODE_URL
84 " PROTOCOL_VERSION:" PROTOCOL_VERSION
85 " MACHINE_TYPE:" MACHINE_NAME
86 " KINEMATICS:" MACHINE_KINEMATICS
87 " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS)
88 #if NUM_AXES != XYZ
89 " AXIS_COUNT:" STRINGIFY(NUM_AXES)
90 #endif
91 #if defined(MACHINE_UUID) || ENABLED(HAS_STM32_UID)
92 " UUID:"
93 #endif
94 #ifdef MACHINE_UUID
95 MACHINE_UUID
96 #endif
97 );
98
99 #if !defined(MACHINE_UUID) && ENABLED(HAS_STM32_UID)
100 /**
101 * STM32-based devices have a 96-bit CPU device serial number.
102 * Used by LumenPnP / OpenPNP to keep track of unique hardware/configurations.
103 * https://github.com/opulo-inc/lumenpnp
104 * This code should work on all STM32-based boards.
105 */
106 #if ENABLED(STM32_UID_SHORT_FORM)
107 const uint32_t * const UID = (uint32_t*)UID_BASE;
108 for (uint8_t i = 0; i < 3; i++) print_hex_long(UID[i]);
109 #else
110 const uint16_t * const UID = (uint16_t*)UID_BASE; // Little-endian!
111 SERIAL_ECHO(F("CEDE2A2F-"));
112 for (uint8_t i = 1; i <= 6; i++) {
113 print_hex_word(UID[(i % 2) ? i : i - 2]); // 1111-0000-3333-222255554444
114 if (i <= 3) SERIAL_CHAR('-');
115 }
116 #endif
117 #endif
118
119 SERIAL_EOL();
120
121 #if ENABLED(EXTENDED_CAPABILITIES_REPORT)
122
123 // The port that sent M115

Callers

nothing calls this directly

Calls 13

print_hex_longFunction · 0.85
print_hex_wordFunction · 0.85
SERIAL_EOLFunction · 0.85
cap_lineFunction · 0.85
apply_motion_limitsFunction · 0.85
command_portMethod · 0.80
has_brightnessMethod · 0.80
has_featureMethod · 0.80
SERIAL_ECHOFunction · 0.50
FFunction · 0.50
SERIAL_CHARFunction · 0.50
DISABLEDFunction · 0.50

Tested by

no test coverage detected