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