Prusa MINI Firmware overview
host_actions.h
Go to the documentation of this file.
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 #pragma once
23 
24 #include "../inc/MarlinConfigPre.h"
25 
26 void host_action(const char * const pstr, const bool eol=true);
27 
28 #ifdef ACTION_ON_SAFETY_TIMER_EXPIRED
30 #endif
31 #ifdef ACTION_ON_KILL
32  void host_action_kill();
33 #endif
34 #ifdef ACTION_ON_PAUSE
35  void host_action_pause(const bool eol=true);
36 #endif
37 #ifdef ACTION_ON_PAUSED
38  void host_action_paused(const bool eol=true);
39 #endif
40 #ifdef ACTION_ON_RESUME
41  void host_action_resume();
42 #endif
43 #ifdef ACTION_ON_RESUMED
44  void host_action_resumed();
45 #endif
46 #ifdef ACTION_ON_CANCEL
47  void host_action_cancel();
48 #endif
49 
50 #if ENABLED(HOST_PROMPT_SUPPORT)
51 
52  enum PromptReason : uint8_t {
53  PROMPT_NOT_DEFINED,
54  PROMPT_FILAMENT_RUNOUT,
55  PROMPT_USER_CONTINUE,
56  PROMPT_FILAMENT_RUNOUT_REHEAT,
57  PROMPT_PAUSE_RESUME,
58  PROMPT_INFO
59  };
60 
61  extern PromptReason host_prompt_reason;
62 
63  void host_response_handler(const uint8_t response);
64  void host_action_prompt_begin(const char * const pstr, const bool eol=true);
65  void host_action_prompt_button(const char * const pstr);
68  void host_prompt_do(const PromptReason type, const char * const pstr, const char * const pbtn=nullptr);
69  inline void host_prompt_open(const PromptReason reason, const char * const pstr, const char * const pbtn=nullptr) {
70  if (host_prompt_reason == PROMPT_NOT_DEFINED) host_prompt_do(reason, pstr, pbtn);
71  }
72 
73 #endif
SERIAL_CHAR
#define SERIAL_CHAR(x)
Definition: serial.h:69
host_action_prompt_end
void host_action_prompt_end()
Definition: marlin_server.cpp:1047
runout.h
host_response_handler
void host_response_handler(const uint8_t response)
Definition: marlin_server.cpp:1029
host_action_resumed
void host_action_resumed()
Definition: marlin_server.cpp:1025
queue
GCodeQueue queue
Definition: queue.cpp:28
host_action
void host_action(const char *const pstr, const bool eol=true)
Definition: marlin_server.cpp:959
host_prompt_do
void host_prompt_do(const PromptReason type, const char *const pstr, const char *const pbtn)
Definition: marlin_server.cpp:1103
type
uint8_t type
Definition: UsbCore.h:184
FilamentMonitorBase::filament_ran_out
static bool filament_ran_out
Definition: runout.h:53
host_action_safety_timer_expired
void host_action_safety_timer_expired()
Definition: marlin_server.cpp:1004
wait_for_user
bool wait_for_user
Definition: Marlin.cpp:188
PSTR
#define PSTR(str)
Definition: pgmspace.h:31
host_action_cancel
void host_action_cancel()
Definition: marlin_server.cpp:1017
runout
FilamentMonitor runout
TFilamentMonitor::reset
static void reset()
Definition: runout.h:76
HAS_FILAMENT_SENSOR
#define HAS_FILAMENT_SENSOR
Definition: Conditionals_LCD.h:535
SERIAL_ECHOPGM
#define SERIAL_ECHOPGM(S)
Definition: serial.h:173
SERIAL_ECHOLNPAIR
#define SERIAL_ECHOLNPAIR(V...)
Definition: serial.h:144
uint8_t
const uint8_t[]
Definition: 404_html.c:3
host_action_kill
void host_action_kill()
Definition: marlin_server.cpp:996
pause.h
host_action_prompt_button
void host_action_prompt_button(const char *const pstr)
Definition: marlin_server.cpp:1039
SERIAL_EOL
#define SERIAL_EOL()
Definition: serial.h:181
host_actions.h
host_action_paused
void host_action_paused(const bool eol)
Definition: marlin_server.cpp:1021
FilamentMonitorBase::enabled
static bool enabled
Definition: runout.h:53
host_action_pause
void host_action_pause(const bool eol)
Definition: marlin_server.cpp:1009
GCodeQueue::inject_P
static void inject_P(PGM_P const pgcode)
Definition: queue.cpp:206
serialprintPGM
void serialprintPGM(PGM_P str)
Definition: serial.cpp:35
host_action_prompt_show
void host_action_prompt_show()
Definition: marlin_server.cpp:1053
host_action_resume
void host_action_resume()
Definition: marlin_server.cpp:1013
host_action_prompt_begin
void host_action_prompt_begin(const char *const pstr, const bool eol)
Definition: marlin_server.cpp:1033
host_prompt_reason
PromptReason host_prompt_reason
Definition: marlin_server.cpp:77