My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

menu_service.cpp 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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
  27. #include "menu.h"
  28. #include "../../module/printcounter.h"
  29. inline void _service_reset(const int index) {
  30. print_job_timer.resetServiceInterval(index);
  31. #if HAS_BUZZER
  32. ui.completion_feedback();
  33. #endif
  34. ui.reset_status();
  35. ui.return_to_status();
  36. }
  37. #if SERVICE_INTERVAL_1 > 0
  38. void menu_service1() {
  39. char sram[30];
  40. strncpy_P(sram, PSTR(SERVICE_NAME_1), 29);
  41. do_select_screen(
  42. GET_TEXT(MSG_BUTTON_RESET), GET_TEXT(MSG_BUTTON_CANCEL),
  43. []{ _service_reset(1); },
  44. ui.goto_previous_screen,
  45. GET_TEXT(MSG_SERVICE_RESET), sram, PSTR("?")
  46. );
  47. }
  48. #endif
  49. #if SERVICE_INTERVAL_2 > 0
  50. void menu_service2() {
  51. char sram[30];
  52. strncpy_P(sram, PSTR(SERVICE_NAME_2), 29);
  53. do_select_screen(
  54. GET_TEXT(MSG_BUTTON_RESET), GET_TEXT(MSG_BUTTON_CANCEL),
  55. []{ _service_reset(2); },
  56. ui.goto_previous_screen,
  57. GET_TEXT(MSG_SERVICE_RESET), sram, PSTR("?")
  58. );
  59. }
  60. #endif
  61. #if SERVICE_INTERVAL_3 > 0
  62. void menu_service3() {
  63. char sram[30];
  64. strncpy_P(sram, PSTR(SERVICE_NAME_3), 29);
  65. do_select_screen(
  66. GET_TEXT(MSG_BUTTON_RESET), GET_TEXT(MSG_BUTTON_CANCEL),
  67. []{ _service_reset(3); },
  68. ui.goto_previous_screen,
  69. GET_TEXT(MSG_SERVICE_RESET), sram, PSTR("?")
  70. );
  71. }
  72. #endif
  73. #endif // HAS_LCD_MENU && HAS_SERVICE_INTERVALS