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.

M710.cpp 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 "../../../inc/MarlinConfigPre.h"
  23. #if ENABLED(CONTROLLER_FAN_EDITABLE)
  24. #include "../../gcode.h"
  25. #include "../../../feature/controllerfan.h"
  26. void M710_report(const bool forReplay) {
  27. if (!forReplay) { SERIAL_ECHOLNPGM("; Controller Fan"); SERIAL_ECHO_START(); }
  28. SERIAL_ECHOLNPAIR(" M710"
  29. " S", int(controllerFan.settings.active_speed),
  30. " I", int(controllerFan.settings.idle_speed),
  31. " A", int(controllerFan.settings.auto_mode),
  32. " D", controllerFan.settings.duration,
  33. " ; (", (int(controllerFan.settings.active_speed) * 100) / 255, "%"
  34. " ", (int(controllerFan.settings.idle_speed) * 100) / 255, "%)"
  35. );
  36. }
  37. /**
  38. * M710: Set controller fan settings
  39. *
  40. * R : Reset to defaults
  41. * S[0-255] : Fan speed when motors are active
  42. * I[0-255] : Fan speed when motors are idle
  43. * A[0|1] : Turn auto mode on or off
  44. * D : Set auto mode idle duration
  45. *
  46. * Examples:
  47. * M710 ; Report current Settings
  48. * M710 R ; Reset SIAD to defaults
  49. * M710 I64 ; Set controller fan Idle Speed to 25%
  50. * M710 S255 ; Set controller fan Active Speed to 100%
  51. * M710 S0 ; Set controller fan Active Speed to OFF
  52. * M710 I255 A0 ; Set controller fan Idle Speed to 100% with Auto Mode OFF
  53. * M710 I127 A1 S255 D160 ; Set controller fan idle speed 50%, AutoMode On, Fan speed 100%, duration to 160 Secs
  54. */
  55. void GcodeSuite::M710() {
  56. const bool seenR = parser.seen('R');
  57. if (seenR) controllerFan.reset();
  58. const bool seenS = parser.seenval('S');
  59. if (seenS) controllerFan.settings.active_speed = parser.value_byte();
  60. const bool seenI = parser.seenval('I');
  61. if (seenI) controllerFan.settings.idle_speed = parser.value_byte();
  62. const bool seenA = parser.seenval('A');
  63. if (seenA) controllerFan.settings.auto_mode = parser.value_bool();
  64. const bool seenD = parser.seenval('D');
  65. if (seenD) controllerFan.settings.duration = parser.value_ushort();
  66. if (!(seenR || seenS || seenI || seenA || seenD))
  67. M710_report(false);
  68. }
  69. #endif // CONTROLLER_FAN_EDITABLE