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 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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 <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #include "../gcode.h"
  23. #include "../../inc/MarlinConfig.h"
  24. #if ENABLED(M115_GEOMETRY_REPORT)
  25. #include "../../module/motion.h"
  26. #endif
  27. #if ENABLED(EXTENDED_CAPABILITIES_REPORT)
  28. static void cap_line(PGM_P const name, bool ena=false) {
  29. SERIAL_ECHOPGM("Cap:");
  30. serialprintPGM(name);
  31. SERIAL_CHAR(':');
  32. SERIAL_ECHOLN(int(ena ? 1 : 0));
  33. }
  34. #endif
  35. /**
  36. * M115: Capabilities string and extended capabilities report
  37. * If a capability is not reported, hosts should assume
  38. * the capability is not present.
  39. */
  40. void GcodeSuite::M115() {
  41. SERIAL_ECHOLNPGM(STR_M115_REPORT);
  42. #if ENABLED(EXTENDED_CAPABILITIES_REPORT)
  43. // PAREN_COMMENTS
  44. TERN_(PAREN_COMMENTS, cap_line(PSTR("PAREN_COMMENTS"), true));
  45. // QUOTED_STRINGS
  46. TERN_(GCODE_QUOTED_STRINGS, cap_line(PSTR("QUOTED_STRINGS"), true));
  47. // SERIAL_XON_XOFF
  48. cap_line(PSTR("SERIAL_XON_XOFF"), ENABLED(SERIAL_XON_XOFF));
  49. // BINARY_FILE_TRANSFER (M28 B1)
  50. cap_line(PSTR("BINARY_FILE_TRANSFER"), ENABLED(BINARY_FILE_TRANSFER));
  51. // EEPROM (M500, M501)
  52. cap_line(PSTR("EEPROM"), ENABLED(EEPROM_SETTINGS));
  53. // Volumetric Extrusion (M200)
  54. cap_line(PSTR("VOLUMETRIC"), DISABLED(NO_VOLUMETRICS));
  55. // AUTOREPORT_TEMP (M155)
  56. cap_line(PSTR("AUTOREPORT_TEMP"), ENABLED(AUTO_REPORT_TEMPERATURES));
  57. // PROGRESS (M530 S L, M531 <file>, M532 X L)
  58. cap_line(PSTR("PROGRESS"));
  59. // Print Job timer M75, M76, M77
  60. cap_line(PSTR("PRINT_JOB"), true);
  61. // AUTOLEVEL (G29)
  62. cap_line(PSTR("AUTOLEVEL"), ENABLED(HAS_AUTOLEVEL));
  63. // Z_PROBE (G30)
  64. cap_line(PSTR("Z_PROBE"), ENABLED(HAS_BED_PROBE));
  65. // MESH_REPORT (M420 V)
  66. cap_line(PSTR("LEVELING_DATA"), ENABLED(HAS_LEVELING));
  67. // BUILD_PERCENT (M73)
  68. cap_line(PSTR("BUILD_PERCENT"), ENABLED(LCD_SET_PROGRESS_MANUALLY));
  69. // SOFTWARE_POWER (M80, M81)
  70. cap_line(PSTR("SOFTWARE_POWER"), ENABLED(PSU_CONTROL));
  71. // CASE LIGHTS (M355)
  72. cap_line(PSTR("TOGGLE_LIGHTS"), ENABLED(HAS_CASE_LIGHT));
  73. cap_line(PSTR("CASE_LIGHT_BRIGHTNESS"), TERN0(HAS_CASE_LIGHT, PWM_PIN(CASE_LIGHT_PIN)));
  74. // EMERGENCY_PARSER (M108, M112, M410, M876)
  75. cap_line(PSTR("EMERGENCY_PARSER"), ENABLED(EMERGENCY_PARSER));
  76. // PROMPT SUPPORT (M876)
  77. cap_line(PSTR("PROMPT_SUPPORT"), ENABLED(HOST_PROMPT_SUPPORT));
  78. // SDCARD (M20, M23, M24, etc.)
  79. cap_line(PSTR("SDCARD"), ENABLED(SDSUPPORT));
  80. // AUTOREPORT_SD_STATUS (M27 extension)
  81. cap_line(PSTR("AUTOREPORT_SD_STATUS"), ENABLED(AUTO_REPORT_SD_STATUS));
  82. // LONG_FILENAME_HOST_SUPPORT (M33)
  83. cap_line(PSTR("LONG_FILENAME"), ENABLED(LONG_FILENAME_HOST_SUPPORT));
  84. // THERMAL_PROTECTION
  85. cap_line(PSTR("THERMAL_PROTECTION"), ENABLED(THERMALLY_SAFE));
  86. // MOTION_MODES (M80-M89)
  87. cap_line(PSTR("MOTION_MODES"), ENABLED(GCODE_MOTION_MODES));
  88. // ARC_SUPPORT (G2-G3)
  89. cap_line(PSTR("ARCS"), ENABLED(ARC_SUPPORT));
  90. // BABYSTEPPING (M290)
  91. cap_line(PSTR("BABYSTEPPING"), ENABLED(BABYSTEPPING));
  92. // CHAMBER_TEMPERATURE (M141, M191)
  93. cap_line(PSTR("CHAMBER_TEMPERATURE"), ENABLED(HAS_HEATED_CHAMBER));
  94. // Machine Geometry
  95. #if ENABLED(M115_GEOMETRY_REPORT)
  96. const xyz_pos_t dmin = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS },
  97. dmax = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS };
  98. xyz_pos_t cmin = dmin, cmax = dmax;
  99. apply_motion_limits(cmin);
  100. apply_motion_limits(cmax);
  101. const xyz_pos_t lmin = dmin.asLogical(), lmax = dmax.asLogical(),
  102. wmin = cmin.asLogical(), wmax = cmax.asLogical();
  103. SERIAL_ECHOLNPAIR(
  104. "area:{"
  105. "full:{"
  106. "min:{x:", lmin.x, ",y:", lmin.y, ",z:", lmin.z, "},"
  107. "max:{x:", lmax.x, ",y:", lmax.y, ",z:", lmax.z, "}"
  108. "},"
  109. "work:{"
  110. "min:{x:", wmin.x, ",y:", wmin.y, ",z:", wmin.z, "},"
  111. "max:{x:", wmax.x, ",y:", wmax.y, ",z:", wmax.z, "}",
  112. "}"
  113. "}"
  114. );
  115. #endif
  116. #endif // EXTENDED_CAPABILITIES_REPORT
  117. }