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

Method M114

Marlin/src/gcode/host/M114.cpp:131–154  ·  view source on GitHub ↗

* M114: Get Current Position * * Report the current tool position to the host. * Since steppers are moving, the count positions are * projected by using planner calculations. * * With M114_DETAIL: * D - Report detailed information * E - Report E stepper position * * With M114_REALTIME: * R - Report real position information */

Source from the content-addressed store, hash-verified

129 * R - Report real position information
130 */
131void GcodeSuite::M114() {
132
133 #if ENABLED(M114_DETAIL)
134 if (parser.seen_test('D')) {
135 IF_DISABLED(M114_LEGACY, planner.synchronize());
136 report_current_position();
137 report_current_position_detail();
138 return;
139 }
140 #if HAS_EXTRUDERS
141 if (parser.seen_test('E')) {
142 SERIAL_ECHOLNPGM("Count E:", stepper.position(E_AXIS));
143 return;
144 }
145 #endif
146 #endif
147
148 TERN_(M114_REALTIME, if (parser.seen_test('R')) return report_real_position());
149
150 TERN_(M114_LEGACY, planner.synchronize());
151 report_current_position_projected();
152
153 TERN_(FULL_REPORT_TO_HOST_FEATURE, report_current_grblstate_moving());
154}

Callers

nothing calls this directly

Calls 9

report_current_positionFunction · 0.85
report_real_positionFunction · 0.85
seen_testMethod · 0.80
positionMethod · 0.80
ifFunction · 0.50
synchronizeMethod · 0.45

Tested by

no test coverage detected