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.

M75-M78.cpp 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 "../../module/printcounter.h"
  24. #include "../../lcd/marlinui.h"
  25. #if ENABLED(HOST_PAUSE_M76)
  26. #include "../../feature/host_actions.h"
  27. #endif
  28. #include "../../MarlinCore.h" // for startOrResumeJob
  29. #if ENABLED(DWIN_LCD_PROUI)
  30. #include "../../lcd/e3v2/proui/dwin.h"
  31. #endif
  32. /**
  33. * M75: Start print timer
  34. */
  35. void GcodeSuite::M75() {
  36. startOrResumeJob();
  37. #if ENABLED(DWIN_LCD_PROUI)
  38. DWIN_Print_Header(parser.string_arg && parser.string_arg[0] ? parser.string_arg : GET_TEXT(MSG_HOST_START_PRINT));
  39. DWIN_Print_Started(false);
  40. #endif
  41. }
  42. /**
  43. * M76: Pause print timer
  44. */
  45. void GcodeSuite::M76() {
  46. print_job_timer.pause();
  47. TERN_(HOST_PAUSE_M76, hostui.pause());
  48. }
  49. /**
  50. * M77: Stop print timer
  51. */
  52. void GcodeSuite::M77() {
  53. print_job_timer.stop();
  54. TERN_(DWIN_LCD_PROUI, DWIN_Print_Finished());
  55. }
  56. #if ENABLED(PRINTCOUNTER)
  57. /**
  58. * M78: Show print statistics
  59. */
  60. void GcodeSuite::M78() {
  61. if (parser.intval('S') == 78) { // "M78 S78" will reset the statistics
  62. print_job_timer.initStats();
  63. ui.reset_status();
  64. return;
  65. }
  66. #if HAS_SERVICE_INTERVALS
  67. if (parser.seenval('R')) {
  68. print_job_timer.resetServiceInterval(parser.value_int());
  69. ui.reset_status();
  70. return;
  71. }
  72. #endif
  73. print_job_timer.showStats();
  74. }
  75. #endif // PRINTCOUNTER