My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

M115.cpp 6.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #include "../gcode.h"
  23. #include "../../inc/MarlinConfig.h"
  24. #include "../queue.h" // for getting the command port
  25. #if ENABLED(M115_GEOMETRY_REPORT)
  26. #include "../../module/motion.h"
  27. #endif
  28. #if ENABLED(CASE_LIGHT_ENABLE)
  29. #include "../../feature/caselight.h"
  30. #endif
  31. //#define MINIMAL_CAP_LINES // Don't even mention the disabled capabilities
  32. #if ENABLED(EXTENDED_CAPABILITIES_REPORT)
  33. #if ENABLED(MINIMAL_CAP_LINES)
  34. #define cap_line(S,C) if (C) _cap_line(S)
  35. static void _cap_line(FSTR_P const name) {
  36. SERIAL_ECHOPGM("Cap:");
  37. SERIAL_ECHOF(name);
  38. SERIAL_ECHOLNPGM(":1");
  39. }
  40. #else
  41. #define cap_line(V...) _cap_line(V)
  42. static void _cap_line(FSTR_P const name, bool ena=false) {
  43. SERIAL_ECHOPGM("Cap:");
  44. SERIAL_ECHOF(name);
  45. SERIAL_CHAR(':', '0' + ena);
  46. SERIAL_EOL();
  47. }
  48. #endif
  49. #endif
  50. /**
  51. * M115: Capabilities string and extended capabilities report
  52. * If a capability is not reported, hosts should assume
  53. * the capability is not present.
  54. */
  55. void GcodeSuite::M115() {
  56. SERIAL_ECHOLNPGM(
  57. "FIRMWARE_NAME:Marlin " DETAILED_BUILD_VERSION " (" __DATE__ " " __TIME__ ") "
  58. "SOURCE_CODE_URL:" SOURCE_CODE_URL " "
  59. "PROTOCOL_VERSION:" PROTOCOL_VERSION " "
  60. "MACHINE_TYPE:" MACHINE_NAME " "
  61. "EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " "
  62. #if LINEAR_AXES != XYZ
  63. "AXIS_COUNT:" STRINGIFY(LINEAR_AXES) " "
  64. #endif
  65. #ifdef MACHINE_UUID
  66. "UUID:" MACHINE_UUID
  67. #endif
  68. );
  69. #if ENABLED(EXTENDED_CAPABILITIES_REPORT)
  70. // The port that sent M115
  71. serial_index_t port = queue.ring_buffer.command_port();
  72. // PAREN_COMMENTS
  73. TERN_(PAREN_COMMENTS, cap_line(F("PAREN_COMMENTS"), true));
  74. // QUOTED_STRINGS
  75. TERN_(GCODE_QUOTED_STRINGS, cap_line(F("QUOTED_STRINGS"), true));
  76. // SERIAL_XON_XOFF
  77. cap_line(F("SERIAL_XON_XOFF"), ENABLED(SERIAL_XON_XOFF));
  78. // BINARY_FILE_TRANSFER (M28 B1)
  79. cap_line(F("BINARY_FILE_TRANSFER"), ENABLED(BINARY_FILE_TRANSFER)); // TODO: Use SERIAL_IMPL.has_feature(port, SerialFeature::BinaryFileTransfer) once implemented
  80. // EEPROM (M500, M501)
  81. cap_line(F("EEPROM"), ENABLED(EEPROM_SETTINGS));
  82. // Volumetric Extrusion (M200)
  83. cap_line(F("VOLUMETRIC"), DISABLED(NO_VOLUMETRICS));
  84. // AUTOREPORT_POS (M154)
  85. cap_line(F("AUTOREPORT_POS"), ENABLED(AUTO_REPORT_POSITION));
  86. // AUTOREPORT_TEMP (M155)
  87. cap_line(F("AUTOREPORT_TEMP"), ENABLED(AUTO_REPORT_TEMPERATURES));
  88. // PROGRESS (M530 S L, M531 <file>, M532 X L)
  89. cap_line(F("PROGRESS"));
  90. // Print Job timer M75, M76, M77
  91. cap_line(F("PRINT_JOB"), true);
  92. // AUTOLEVEL (G29)
  93. cap_line(F("AUTOLEVEL"), ENABLED(HAS_AUTOLEVEL));
  94. // RUNOUT (M412, M600)
  95. cap_line(F("RUNOUT"), ENABLED(FILAMENT_RUNOUT_SENSOR));
  96. // Z_PROBE (G30)
  97. cap_line(F("Z_PROBE"), ENABLED(HAS_BED_PROBE));
  98. // MESH_REPORT (M420 V)
  99. cap_line(F("LEVELING_DATA"), ENABLED(HAS_LEVELING));
  100. // BUILD_PERCENT (M73)
  101. cap_line(F("BUILD_PERCENT"), ENABLED(LCD_SET_PROGRESS_MANUALLY));
  102. // SOFTWARE_POWER (M80, M81)
  103. cap_line(F("SOFTWARE_POWER"), ENABLED(PSU_CONTROL));
  104. // TOGGLE_LIGHTS (M355)
  105. cap_line(F("TOGGLE_LIGHTS"), ENABLED(CASE_LIGHT_ENABLE));
  106. cap_line(F("CASE_LIGHT_BRIGHTNESS"), TERN0(CASE_LIGHT_ENABLE, caselight.has_brightness()));
  107. // EMERGENCY_PARSER (M108, M112, M410, M876)
  108. cap_line(F("EMERGENCY_PARSER"), ENABLED(EMERGENCY_PARSER));
  109. // HOST ACTION COMMANDS (paused, resume, resumed, cancel, etc.)
  110. cap_line(F("HOST_ACTION_COMMANDS"), ENABLED(HOST_ACTION_COMMANDS));
  111. // PROMPT SUPPORT (M876)
  112. cap_line(F("PROMPT_SUPPORT"), ENABLED(HOST_PROMPT_SUPPORT));
  113. // SDCARD (M20, M23, M24, etc.)
  114. cap_line(F("SDCARD"), ENABLED(SDSUPPORT));
  115. // REPEAT (M808)
  116. cap_line(F("REPEAT"), ENABLED(GCODE_REPEAT_MARKERS));
  117. // SD_WRITE (M928, M28, M29)
  118. cap_line(F("SD_WRITE"), ENABLED(SDSUPPORT) && DISABLED(SDCARD_READONLY));
  119. // AUTOREPORT_SD_STATUS (M27 extension)
  120. cap_line(F("AUTOREPORT_SD_STATUS"), ENABLED(AUTO_REPORT_SD_STATUS));
  121. // LONG_FILENAME_HOST_SUPPORT (M33)
  122. cap_line(F("LONG_FILENAME"), ENABLED(LONG_FILENAME_HOST_SUPPORT));
  123. // EXTENDED_M20 (M20 L)
  124. cap_line(F("EXTENDED_M20"), ENABLED(LONG_FILENAME_HOST_SUPPORT));
  125. // THERMAL_PROTECTION
  126. cap_line(F("THERMAL_PROTECTION"), ENABLED(THERMALLY_SAFE));
  127. // MOTION_MODES (M80-M89)
  128. cap_line(F("MOTION_MODES"), ENABLED(GCODE_MOTION_MODES));
  129. // ARC_SUPPORT (G2-G3)
  130. cap_line(F("ARCS"), ENABLED(ARC_SUPPORT));
  131. // BABYSTEPPING (M290)
  132. cap_line(F("BABYSTEPPING"), ENABLED(BABYSTEPPING));
  133. // CHAMBER_TEMPERATURE (M141, M191)
  134. cap_line(F("CHAMBER_TEMPERATURE"), ENABLED(HAS_HEATED_CHAMBER));
  135. // COOLER_TEMPERATURE (M143, M193)
  136. cap_line(F("COOLER_TEMPERATURE"), ENABLED(HAS_COOLER));
  137. // MEATPACK Compression
  138. cap_line(F("MEATPACK"), SERIAL_IMPL.has_feature(port, SerialFeature::MeatPack));
  139. // CONFIG_EXPORT
  140. cap_line(F("CONFIG_EXPORT"), ENABLED(CONFIG_EMBED_AND_SAVE_TO_SD));
  141. // Machine Geometry
  142. #if ENABLED(M115_GEOMETRY_REPORT)
  143. const xyz_pos_t bmin = { 0, 0, 0 },
  144. bmax = { X_BED_SIZE , Y_BED_SIZE, Z_MAX_POS },
  145. dmin = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS },
  146. dmax = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS };
  147. xyz_pos_t cmin = bmin, cmax = bmax;
  148. apply_motion_limits(cmin);
  149. apply_motion_limits(cmax);
  150. const xyz_pos_t lmin = dmin.asLogical(), lmax = dmax.asLogical(),
  151. wmin = cmin.asLogical(), wmax = cmax.asLogical();
  152. SERIAL_ECHOLNPGM(
  153. "area:{"
  154. "full:{"
  155. "min:{x:", lmin.x, ",y:", lmin.y, ",z:", lmin.z, "},"
  156. "max:{x:", lmax.x, ",y:", lmax.y, ",z:", lmax.z, "}"
  157. "},"
  158. "work:{"
  159. "min:{x:", wmin.x, ",y:", wmin.y, ",z:", wmin.z, "},"
  160. "max:{x:", wmax.x, ",y:", wmax.y, ",z:", wmax.z, "}",
  161. "}"
  162. "}"
  163. );
  164. #endif
  165. #endif // EXTENDED_CAPABILITIES_REPORT
  166. }