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.

menu_service.cpp 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2019 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. //
  23. // Service Menus
  24. //
  25. #include "../../inc/MarlinConfigPre.h"
  26. #if HAS_LCD_MENU && HAS_SERVICE_INTERVALS && ENABLED(PRINTCOUNTER)
  27. #include "menu.h"
  28. #include "../../module/printcounter.h"
  29. inline void _menu_service(const int index, PGM_P const name) {
  30. char sram[30];
  31. strncpy_P(sram, name, 29);
  32. do_select_screen(
  33. PSTR(MSG_BUTTON_RESET), PSTR(MSG_BUTTON_CANCEL),
  34. []{
  35. print_job_timer.resetServiceInterval(index);
  36. #if HAS_BUZZER
  37. ui.completion_feedback();
  38. #endif
  39. ui.reset_status();
  40. ui.return_to_status();
  41. },
  42. ui.goto_previous_screen,
  43. PSTR(MSG_SERVICE_RESET), sram, PSTR("?")
  44. );
  45. }
  46. #if SERVICE_INTERVAL_1 > 0
  47. void menu_service1() { _menu_service(1, PSTR(SERVICE_NAME_1)); }
  48. #endif
  49. #if SERVICE_INTERVAL_2 > 0
  50. void menu_service2() { _menu_service(2, PSTR(SERVICE_NAME_2)); }
  51. #endif
  52. #if SERVICE_INTERVAL_3 > 0
  53. void menu_service3() { _menu_service(3, PSTR(SERVICE_NAME_3)); }
  54. #endif
  55. #endif // HAS_LCD_MENU && HAS_SERVICE_INTERVALS && PRINTCOUNTER