Skip to content

Commit

Permalink
Add screen state to gcode_M600()
Browse files Browse the repository at this point in the history
- Allowing resume after M600 via on screen button:

- Adding check for TFT state status
- Setting flag when print was started via TFT
  • Loading branch information
davidramiro committed Feb 18, 2019
1 parent 2bd6f2f commit b447245
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Marlin/AnycubicTFT.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ class AnycubicTFTClass {
void HeatingStart();
void FilamentRunout();
void KillTFT();
char TFTstate=ANYCUBIC_TFT_STATE_IDLE;
bool PausedByRunout=false;
bool PausedByFilamentChange=false;

private:
char TFTcmdbuffer[TFTBUFSIZE][TFT_MAX_CMD_SIZE];
Expand All @@ -64,16 +67,13 @@ class AnycubicTFTClass {
char serial3_char;
int serial3_count = 0;
char *TFTstrchr_pointer;
char TFTstate=ANYCUBIC_TFT_STATE_IDLE;
char FlagResumFromOutage=0;
uint16_t filenumber=0;
unsigned long starttime=0;
unsigned long stoptime=0;
uint8_t tmp_extruder=0;
char LastSDstatus=0;
uint16_t HeaterCheckCount=0;
bool PausedByRunout=false;
bool PausedByFilamentChange=false;

struct OutageDataStruct {
char OutageDataVersion;
Expand Down
6 changes: 6 additions & 0 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10992,6 +10992,12 @@ inline void gcode_M502() {
* Default values are used for omitted arguments.
*/
inline void gcode_M600() {
#ifdef SDSUPPORT
if ((AnycubicTFT.TFTstate==ANYCUBIC_TFT_STATE_SDPRINT)){
AnycubicTFT.TFTstate=ANYCUBIC_TFT_STATE_SDPAUSE_REQ;
AnycubicTFT.PausedByFilamentChange=true;
}
#endif
point_t park_point = NOZZLE_PARK_POINT;

if (get_target_extruder_from_command(600)) return;
Expand Down

0 comments on commit b447245

Please sign in to comment.