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.

host_actions.h 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. #pragma once
  23. #include "../inc/MarlinConfigPre.h"
  24. void host_action(const char * const pstr, const bool eol=true);
  25. #ifdef ACTION_ON_KILL
  26. void host_action_kill();
  27. #endif
  28. #ifdef ACTION_ON_PAUSE
  29. void host_action_pause(const bool eol=true);
  30. #endif
  31. #ifdef ACTION_ON_PAUSED
  32. void host_action_paused(const bool eol=true);
  33. #endif
  34. #ifdef ACTION_ON_RESUME
  35. void host_action_resume();
  36. #endif
  37. #ifdef ACTION_ON_RESUMED
  38. void host_action_resumed();
  39. #endif
  40. #ifdef ACTION_ON_CANCEL
  41. void host_action_cancel();
  42. #endif
  43. #if ENABLED(HOST_PROMPT_SUPPORT)
  44. extern const char CONTINUE_STR[], DISMISS_STR[];
  45. enum PromptReason : uint8_t {
  46. PROMPT_NOT_DEFINED,
  47. PROMPT_FILAMENT_RUNOUT,
  48. PROMPT_USER_CONTINUE,
  49. PROMPT_FILAMENT_RUNOUT_REHEAT,
  50. PROMPT_PAUSE_RESUME,
  51. PROMPT_INFO
  52. };
  53. extern PromptReason host_prompt_reason;
  54. void host_response_handler(const uint8_t response);
  55. void host_action_notify(const char * const message);
  56. void host_action_prompt_begin(const PromptReason reason, const char * const pstr, const char extra_char='\0');
  57. void host_action_prompt_button(const char * const pstr);
  58. void host_action_prompt_end();
  59. void host_action_prompt_show();
  60. void host_prompt_do(const PromptReason reason, const char * const pstr, const char * const btn1=nullptr, const char * const btn2=nullptr);
  61. inline void host_prompt_open(const PromptReason reason, const char * const pstr, const char * const btn1=nullptr, const char * const btn2=nullptr) {
  62. if (host_prompt_reason == PROMPT_NOT_DEFINED) host_prompt_do(reason, pstr, btn1, btn2);
  63. }
  64. void filament_load_host_prompt();
  65. #endif