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.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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. #if ENABLED(EXTENDED_CAPABILITIES_REPORT)
  32. static void cap_line(PGM_P const name, bool ena=false) {
  33. SERIAL_ECHOPGM("Cap:");
  34. SERIAL_ECHOPGM_P(name);
  35. SERIAL_CHAR(':', '0' + ena);
  36. SERIAL_EOL();
  37. }
  38. #endif
  39. /**
  40. * M115: Capabilities string and extended capabilities report
  41. * If a capability is not reported, hosts should assume
  42. * the capability is not present.
  43. */
  44. void GcodeSuite::M115() {
  45. SERIAL_ECHOLNPGM(
  46. "FIRMWARE_NAME:Marlin " DETAILED_BUILD_VERSION " (" __DATE__ " " __TIME__ ") "
  47. "SOURCE_CODE_URL:" SOURCE_CODE_URL " "
  48. "PROTOCOL_VERSION:" PROTOCOL_VERSION " "
  49. "MACHINE_TYPE:" MACHINE_NAME " "
  50. "EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " "
  51. #if LINEAR_AXES != XYZ
  52. "AXIS_COUNT:" STRINGIFY(LINEAR_AXES) " "
  53. #endif
  54. #ifdef MACHINE_UUID
  55. "UUID:" MACHINE_UUID
  56. #endif
  57. );
  58. #if ENABLED(EXTENDED_CAPABILITIES_REPORT)
  59. // The port that sent M115
  60. serial_index_t port = queue.ring_buffer.command_port();
  61. // PAREN_COMMENTS
  62. TERN_(PAREN_COMMENTS, cap_line(PSTR("PAREN_COMMENTS"), true));
  63. // QUOTED_STRINGS
  64. TERN_(GCODE_QUOTED_STRINGS, cap_line(PSTR("QUOTED_STRINGS"), true));
  65. // SERIAL_XON_XOFF
  66. cap_line(PSTR("SERIAL_XON_XOFF"), ENABLED(SERIAL_XON_XOFF));
  67. // BINARY_FILE_TRANSFER (M28 B1)
  68. cap_line(PSTR("BINARY_FILE_TRANSFER"), ENABLED(BINARY_FILE_TRANSFER)); // TODO: Use SERIAL_IMPL.has_feature(port, SerialFeature::BinaryFileTransfer) once implemented
  69. // EEPROM (M500, M501)
  70. cap_line(PSTR("EEPROM"), ENABLED(EEPROM_SETTINGS));
  71. // Volumetric Extrusion (M200)
  72. cap_line(PSTR("VOLUMETRIC"), DISABLED(NO_VOLUMETRICS));
  73. // AUTOREPORT_POS (M154)
  74. cap_line(PSTR("AUTOREPORT_POS"), ENABLED(AUTO_REPORT_POSITION));
  75. // AUTOREPORT_TEMP (M155)
  76. cap_line(PSTR("AUTOREPORT_TEMP"), ENABLED(AUTO_REPORT_TEMPERATURES));
  77. // PROGRESS (M530 S L, M531 <file>, M532 X L)
  78. cap_line(PSTR("PROGRESS"));
  79. // Print Job timer M75, M76, M77
  80. cap_line(PSTR("PRINT_JOB"), true);
  81. // AUTOLEVEL (G29)
  82. cap_line(PSTR("AUTOLEVEL"), ENABLED(HAS_AUTOLEVEL));
  83. // RUNOUT (M412, M600)
  84. cap_line(PSTR("RUNOUT"), ENABLED(FILAMENT_RUNOUT_SENSOR));
  85. // Z_PROBE (G30)
  86. cap_line(PSTR("Z_PROBE"), ENABLED(HAS_BED_PROBE));
  87. // MESH_REPORT (M420 V)
  88. cap_line(PSTR("LEVELING_DATA"), ENABLED(HAS_LEVELING));
  89. // BUILD_PERCENT (M73)
  90. cap_line(PSTR("BUILD_PERCENT"), ENABLED(LCD_SET_PROGRESS_MANUALLY));
  91. // SOFTWARE_POWER (M80, M81)
  92. cap_line(PSTR("SOFTWARE_POWER"), ENABLED(PSU_CONTROL));
  93. // TOGGLE_LIGHTS (M355)
  94. cap_line(PSTR("TOGGLE_LIGHTS"), ENABLED(CASE_LIGHT_ENABLE));
  95. cap_line(PSTR("CASE_LIGHT_BRIGHTNESS"), TERN0(CASE_LIGHT_ENABLE, caselight.has_brightness()));
  96. // EMERGENCY_PARSER (M108, M112, M410, M876)
  97. cap_line(PSTR("EMERGENCY_PARSER"), ENABLED(EMERGENCY_PARSER));
  98. // HOST ACTION COMMANDS (paused, resume, resumed, cancel, etc.)
  99. cap_line(PSTR("HOST_ACTION_COMMANDS"), ENABLED(HOST_ACTION_COMMANDS));
  100. // PROMPT SUPPORT (M876)
  101. cap_line(PSTR("PROMPT_SUPPORT"), ENABLED(HOST_PROMPT_SUPPORT));
  102. // SDCARD (M20, M23, M24, etc.)
  103. cap_line(PSTR("SDCARD"), ENABLED(SDSUPPORT));
  104. // REPEAT (M808)
  105. cap_line(PSTR("REPEAT"), ENABLED(GCODE_REPEAT_MARKERS));
  106. // SD_WRITE (M928, M28, M29)
  107. cap_line(PSTR("SD_WRITE"), ENABLED(SDSUPPORT) && DISABLED(SDCARD_READONLY));
  108. // AUTOREPORT_SD_STATUS (M27 extension)
  109. cap_line(PSTR("AUTOREPORT_SD_STATUS"), ENABLED(AUTO_REPORT_SD_STATUS));
  110. // LONG_FILENAME_HOST_SUPPORT (M33)
  111. cap_line(PSTR("LONG_FILENAME"), ENABLED(LONG_FILENAME_HOST_SUPPORT));
  112. // THERMAL_PROTECTION
  113. cap_line(PSTR("THERMAL_PROTECTION"), ENABLED(THERMALLY_SAFE));
  114. // MOTION_MODES (M80-M89)
  115. cap_line(PSTR("MOTION_MODES"), ENABLED(GCODE_MOTION_MODES));
  116. // ARC_SUPPORT (G2-G3)
  117. cap_line(PSTR("ARCS"), ENABLED(ARC_SUPPORT));
  118. // BABYSTEPPING (M290)
  119. cap_line(PSTR("BABYSTEPPING"), ENABLED(BABYSTEPPING));
  120. // CHAMBER_TEMPERATURE (M141, M191)
  121. cap_line(PSTR("CHAMBER_TEMPERATURE"), ENABLED(HAS_HEATED_CHAMBER));
  122. // COOLER_TEMPERATURE (M143, M193)
  123. cap_line(PSTR("COOLER_TEMPERATURE"), ENABLED(HAS_COOLER));
  124. // MEATPACK Compression
  125. cap_line(PSTR("MEATPACK"), SERIAL_IMPL.has_feature(port, SerialFeature::MeatPack));
  126. // Machine Geometry
  127. #if ENABLED(M115_GEOMETRY_REPORT)
  128. const xyz_pos_t bmin = { 0, 0, 0 },
  129. bmax = { X_BED_SIZE , Y_BED_SIZE, Z_MAX_POS },
  130. dmin = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS },
  131. dmax = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS };
  132. xyz_pos_t cmin = bmin, cmax = bmax;
  133. apply_motion_limits(cmin);
  134. apply_motion_limits(cmax);
  135. const xyz_pos_t lmin = dmin.asLogical(), lmax = dmax.asLogical(),
  136. wmin = cmin.asLogical(), wmax = cmax.asLogical();
  137. SERIAL_ECHOLNPGM(
  138. "area:{"
  139. "full:{"
  140. "min:{x:", lmin.x, ",y:", lmin.y, ",z:", lmin.z, "},"
  141. "max:{x:", lmax.x, ",y:", lmax.y, ",z:", lmax.z, "}"
  142. "},"
  143. "work:{"
  144. "min:{x:", wmin.x, ",y:", wmin.y, ",z:", wmin.z, "},"
  145. "max:{x:", wmax.x, ",y:", wmax.y, ",z:", wmax.z, "}",
  146. "}"
  147. "}"
  148. );
  149. #endif
  150. #endif // EXTENDED_CAPABILITIES_REPORT
  151. }