Browse Source

Show raw steps in M114

This is a proposed change. This section of M114 output is a debug
extension according to RepRap wiki.
Scott Lahteine 8 years ago
parent
commit
83ffc9eb4f
2 changed files with 28 additions and 6 deletions
  1. 27
    6
      Marlin/Marlin_main.cpp
  2. 1
    0
      Marlin/language.h

+ 27
- 6
Marlin/Marlin_main.cpp View File

@@ -4283,12 +4283,33 @@ inline void gcode_M114() {
4283 4283
   SERIAL_PROTOCOLPGM(" E:");
4284 4284
   SERIAL_PROTOCOL(current_position[E_AXIS]);
4285 4285
 
4286
-  SERIAL_PROTOCOLPGM(MSG_COUNT_X);
4287
-  SERIAL_PROTOCOL(st_get_position_mm(X_AXIS));
4288
-  SERIAL_PROTOCOLPGM(" Y:");
4289
-  SERIAL_PROTOCOL(st_get_position_mm(Y_AXIS));
4290
-  SERIAL_PROTOCOLPGM(" Z:");
4291
-  SERIAL_PROTOCOL(st_get_position_mm(Z_AXIS));
4286
+  CRITICAL_SECTION_START;
4287
+  extern volatile long count_position[NUM_AXIS];
4288
+  long xpos = count_position[X_AXIS],
4289
+       ypos = count_position[Y_AXIS],
4290
+       zpos = count_position[Z_AXIS];
4291
+  CRITICAL_SECTION_END;
4292
+
4293
+  #if ENABLED(COREXY) || ENABLED(COREXZ)
4294
+    SERIAL_PROTOCOLPGM(MSG_COUNT_A);
4295
+  #else
4296
+    SERIAL_PROTOCOLPGM(MSG_COUNT_X);
4297
+  #endif
4298
+  SERIAL_PROTOCOL(xpos);
4299
+
4300
+  #if ENABLED(COREXY)
4301
+    SERIAL_PROTOCOLPGM(" B:");
4302
+  #else
4303
+    SERIAL_PROTOCOLPGM(" Y:");
4304
+  #endif
4305
+  SERIAL_PROTOCOL(ypos);
4306
+
4307
+  #if ENABLED(COREXZ)
4308
+    SERIAL_PROTOCOLPGM(" C:");
4309
+  #else
4310
+    SERIAL_PROTOCOLPGM(" Z:");
4311
+  #endif
4312
+  SERIAL_PROTOCOL(zpos);
4292 4313
 
4293 4314
   SERIAL_EOL;
4294 4315
 

+ 1
- 0
Marlin/language.h View File

@@ -124,6 +124,7 @@
124 124
 #define MSG_ERR_NO_THERMISTORS              "No thermistors - no temperature"
125 125
 #define MSG_M115_REPORT                     "FIRMWARE_NAME:Marlin " DETAILED_BUILD_VERSION " SOURCE_CODE_URL:" SOURCE_CODE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" UUID "\n"
126 126
 #define MSG_COUNT_X                         " Count X: "
127
+#define MSG_COUNT_A                         " Count A: "
127 128
 #define MSG_ERR_KILLED                      "Printer halted. kill() called!"
128 129
 #define MSG_ERR_STOPPED                     "Printer stopped due to errors. Fix the error and use M999 to restart. (Temperature is reset. Set it after restarting)"
129 130
 #define MSG_RESEND                          "Resend: "

Loading…
Cancel
Save