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.5KB

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