Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improved robustness of Printing menu during a dialog with Marlin #1922

Merged
merged 1 commit into from
May 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Copy to SD Card root directory to update/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
# Supported Marlin Firmware Versions
#--------------------------------------------------------------------
#
# Minimum Marlin firmware version: 2.0.5.4
# Distribution date: 2020-05-12
# Minimum Marlin firmware version: 2.0.8.1
# Distribution date: 2021-05-15
# Firmware source: https://github.com/MarlinFirmware/Marlin/releases
#
# In order the TFT firmware is able to provide all of its functionalities/features,
Expand Down
4 changes: 2 additions & 2 deletions Copy to SD Card root directory to update/config_rrf.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
# Supported Marlin Firmware Versions
#--------------------------------------------------------------------
#
# Minimum Marlin firmware version: 2.0.5.4
# Distribution date: 2020-05-12
# Minimum Marlin firmware version: 2.0.8.1
# Distribution date: 2021-05-15
# Firmware source: https://github.com/MarlinFirmware/Marlin/releases
#
# In order the TFT firmware is able to provide all of its functionalities/features,
Expand Down
8 changes: 8 additions & 0 deletions TFT/src/User/API/parseACK.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ static const char messagemagic[] = "message"; // RRF messag
static const char errorZProbe[] = "ZProbe triggered before move"; // smoothieware message

bool portSeen[_UART_CNT] = {false, false, false, false, false, false};
bool hostDialog = false;

struct HOST_ACTION
{
Expand Down Expand Up @@ -258,6 +259,11 @@ void hostActionCommands(void)
}
else if (ack_seen(":paused") || ack_seen(":pause"))
{
if (ack_seen(":paused")) // if paused with ADVANCED_PAUSE_FEATURE enabled in Marlin (:paused),
hostDialog = true; // disable Resume/Pause button in the Printing menu
//else // otherwise, if ADVANCED_PAUSE_FEATURE is disabled in Marlin (:pause),
// hostDialog = false; // enable Resume/Pause button in the Printing menu

// pass value "false" to let Marlin report when the host is not
// printing (when notification ack "Not SD printing" is caught)
setPrintPause(false, PAUSE_EXTERNAL);
Expand All @@ -269,6 +275,8 @@ void hostActionCommands(void)
}
else if (ack_seen(":resumed") || ack_seen(":resume"))
{
hostDialog = false; // enable Resume/Pause button in the Printing menu

// pass value "true" to report the host is printing without waiting
// from Marlin (when notification ack "SD printing byte" is caught)
setPrintResume(true);
Expand Down
3 changes: 3 additions & 0 deletions TFT/src/User/API/parseACK.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ extern "C" {

#define ACK_MAX_SIZE 512

extern bool hostDialog;

typedef enum // append at the end of this list the id of any new echo message for
{ // which a specific popup message type must be used to notify the user
ECHO_ID_BUSY_PAUSE = 0,
Expand Down Expand Up @@ -37,6 +39,7 @@ void setCurrentAckSrc(uint8_t src);
void parseACK(void);
void parseRcvGcode(void);

inline bool isHostDialog() {return hostDialog;}
void setIgnoreEcho(ECHO_ID msgId, bool state);

#ifdef __cplusplus
Expand Down
5 changes: 4 additions & 1 deletion TFT/src/User/Menu/PrintingMenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,10 @@ void menuPrinting(void)
case KEY_ICON_4:
if (isPrinting())
{
printPause(!isPaused(), PAUSE_NORMAL);
if (!isHostDialog())
printPause(!isPaused(), PAUSE_NORMAL);
else
addToast(DIALOG_TYPE_ERROR, (char *)textSelect(LABEL_BUSY));
}
#ifndef TFT70_V3_0
else
Expand Down
4 changes: 2 additions & 2 deletions TFT/src/User/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
# Supported Marlin Firmware Versions
#--------------------------------------------------------------------
#
# Minimum Marlin firmware version: 2.0.5.4
# Distribution date: 2020-05-12
# Minimum Marlin firmware version: 2.0.8.1
# Distribution date: 2021-05-15
# Firmware source: https://github.com/MarlinFirmware/Marlin/releases
#
# In order the TFT firmware is able to provide all of its functionalities/features,
Expand Down