My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

M122.cpp 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 "../../../inc/MarlinConfig.h"
  23. #if HAS_TRINAMIC_CONFIG
  24. #include "../../gcode.h"
  25. #include "../../../feature/tmc_util.h"
  26. #include "../../../module/stepper/indirection.h" // for restore_stepper_drivers
  27. /**
  28. * M122: Debug TMC drivers
  29. */
  30. void GcodeSuite::M122() {
  31. xyze_bool_t print_axis = ARRAY_N_1(LOGICAL_AXES, false);
  32. bool print_all = true;
  33. LOOP_LOGICAL_AXES(i) if (parser.seen_test(AXIS_CHAR(i))) { print_axis[i] = true; print_all = false; }
  34. if (print_all) LOOP_LOGICAL_AXES(i) print_axis[i] = true;
  35. if (parser.boolval('I')) restore_stepper_drivers();
  36. #if ENABLED(TMC_DEBUG)
  37. #if ENABLED(MONITOR_DRIVER_STATUS)
  38. const bool sflag = parser.seen_test('S'), sval = sflag && parser.value_bool();
  39. if (sflag && !sval)
  40. tmc_set_report_interval(0);
  41. else if (parser.seenval('P'))
  42. tmc_set_report_interval(_MAX(250, parser.value_ushort()));
  43. else if (sval)
  44. tmc_set_report_interval(MONITOR_DRIVER_STATUS_INTERVAL_MS);
  45. #endif
  46. if (parser.seen_test('V'))
  47. tmc_get_registers(LOGICAL_AXIS_ELEM(print_axis));
  48. else
  49. tmc_report_all(LOGICAL_AXIS_ELEM(print_axis));
  50. #endif
  51. test_tmc_connection(LOGICAL_AXIS_ELEM(print_axis));
  52. }
  53. #endif // HAS_TRINAMIC_CONFIG