Minor tweaks for usb printing

This commit is contained in:
leptun 2019-09-20 21:07:20 +03:00
parent fd01942db8
commit 2363f19a62
3 changed files with 10 additions and 6 deletions

View File

@ -240,11 +240,6 @@ void prepare_move();
void kill(const char *full_screen_message = NULL, unsigned char id = 0); void kill(const char *full_screen_message = NULL, unsigned char id = 0);
void Stop(); void Stop();
#define PRINTING_TYPE_SD 0
#define PRINTING_TYPE_USB 1
#define PRINTING_TYPE_NONE 2
extern uint8_t saved_printing_type;
bool IsStopped(); bool IsStopped();
//put an ASCII command at the end of the current buffer. //put an ASCII command at the end of the current buffer.
@ -381,6 +376,10 @@ extern char dir_names[3][9];
extern int8_t lcd_change_fil_state; extern int8_t lcd_change_fil_state;
// save/restore printing // save/restore printing
extern bool saved_printing; extern bool saved_printing;
extern uint8_t saved_printing_type;
#define PRINTING_TYPE_SD 0
#define PRINTING_TYPE_USB 1
#define PRINTING_TYPE_NONE 2
//save/restore printing in case that mmu is not responding //save/restore printing in case that mmu is not responding
extern bool mmu_print_saved; extern bool mmu_print_saved;

View File

@ -1747,6 +1747,10 @@ void loop()
{ {
is_usb_printing = false; is_usb_printing = false;
} }
if (isPrintPaused && saved_printing_type == PRINTING_TYPE_USB) //keep believing that usb is being printed. Prevents accessing dangerous menus while pausing.
{
is_usb_printing = true;
}
#ifdef FANCHECK #ifdef FANCHECK
if ((saved_printing_type == PRINTING_TYPE_USB) && fan_check_error) if ((saved_printing_type == PRINTING_TYPE_USB) && fan_check_error)
@ -3463,7 +3467,7 @@ void process_commands()
// SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_PAUSED); // SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_PAUSED);
lcd_pause_print(); lcd_pause_print();
} // otherwise it has already been reported, so just ignore further processing } // otherwise it has already been reported, so just ignore further processing
if(saved_printing_type == PRINTING_TYPE_USB) return; //ignore usb stream. return; //ignore usb stream. It is reenabled by selecting resume from the lcd.
} }
#endif #endif

View File

@ -6847,6 +6847,7 @@ void lcd_print_stop()
SERIAL_ECHOLNPGM("// action:cancel"); // for Octoprint SERIAL_ECHOLNPGM("// action:cancel"); // for Octoprint
} }
saved_printing = false; saved_printing = false;
saved_printing_type = PRINTING_TYPE_NONE;
cancel_heatup = true; cancel_heatup = true;
#ifdef MESH_BED_LEVELING #ifdef MESH_BED_LEVELING
mbl.active = false; mbl.active = false;