2019-02-12 21:55:47 +00:00
|
|
|
/**
|
|
|
|
* Marlin 3D Printer Firmware
|
2020-02-03 14:00:57 +00:00
|
|
|
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
2019-02-12 21:55:47 +00:00
|
|
|
*
|
|
|
|
* Based on Sprinter and grbl.
|
2019-06-28 04:57:50 +00:00
|
|
|
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
2019-02-12 21:55:47 +00:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2020-07-23 03:20:14 +00:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2019-02-12 21:55:47 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2020-05-12 03:15:19 +00:00
|
|
|
#include "../inc/MarlinConfigPre.h"
|
|
|
|
#include "../HAL/shared/Marduino.h"
|
2019-05-05 03:55:51 +00:00
|
|
|
|
2020-05-11 02:19:23 +00:00
|
|
|
void host_action(PGM_P const pstr, const bool eol=true);
|
2019-02-12 21:55:47 +00:00
|
|
|
|
|
|
|
#ifdef ACTION_ON_KILL
|
|
|
|
void host_action_kill();
|
|
|
|
#endif
|
|
|
|
#ifdef ACTION_ON_PAUSE
|
|
|
|
void host_action_pause(const bool eol=true);
|
|
|
|
#endif
|
|
|
|
#ifdef ACTION_ON_PAUSED
|
|
|
|
void host_action_paused(const bool eol=true);
|
|
|
|
#endif
|
|
|
|
#ifdef ACTION_ON_RESUME
|
|
|
|
void host_action_resume();
|
|
|
|
#endif
|
|
|
|
#ifdef ACTION_ON_RESUMED
|
|
|
|
void host_action_resumed();
|
|
|
|
#endif
|
|
|
|
#ifdef ACTION_ON_CANCEL
|
|
|
|
void host_action_cancel();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if ENABLED(HOST_PROMPT_SUPPORT)
|
|
|
|
|
2020-02-14 06:05:06 +00:00
|
|
|
extern const char CONTINUE_STR[], DISMISS_STR[];
|
2019-11-29 10:45:07 +00:00
|
|
|
|
2019-02-12 21:55:47 +00:00
|
|
|
enum PromptReason : uint8_t {
|
|
|
|
PROMPT_NOT_DEFINED,
|
|
|
|
PROMPT_FILAMENT_RUNOUT,
|
|
|
|
PROMPT_USER_CONTINUE,
|
|
|
|
PROMPT_FILAMENT_RUNOUT_REHEAT,
|
2019-09-27 22:06:26 +00:00
|
|
|
PROMPT_PAUSE_RESUME,
|
|
|
|
PROMPT_INFO
|
2019-02-12 21:55:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern PromptReason host_prompt_reason;
|
|
|
|
|
|
|
|
void host_response_handler(const uint8_t response);
|
2019-12-01 23:39:28 +00:00
|
|
|
void host_action_notify(const char * const message);
|
2020-05-11 02:19:23 +00:00
|
|
|
void host_action_notify_P(PGM_P const message);
|
|
|
|
void host_action_prompt_begin(const PromptReason reason, PGM_P const pstr, const char extra_char='\0');
|
|
|
|
void host_action_prompt_button(PGM_P const pstr);
|
2019-02-12 21:55:47 +00:00
|
|
|
void host_action_prompt_end();
|
|
|
|
void host_action_prompt_show();
|
2020-05-11 02:19:23 +00:00
|
|
|
void host_prompt_do(const PromptReason reason, PGM_P const pstr, PGM_P const btn1=nullptr, PGM_P const btn2=nullptr);
|
|
|
|
inline void host_prompt_open(const PromptReason reason, PGM_P const pstr, PGM_P const btn1=nullptr, PGM_P const btn2=nullptr) {
|
2020-02-14 05:39:27 +00:00
|
|
|
if (host_prompt_reason == PROMPT_NOT_DEFINED) host_prompt_do(reason, pstr, btn1, btn2);
|
2019-02-12 21:55:47 +00:00
|
|
|
}
|
|
|
|
|
2020-02-14 05:39:27 +00:00
|
|
|
void filament_load_host_prompt();
|
|
|
|
|
2019-02-12 21:55:47 +00:00
|
|
|
#endif
|