Skip to content
Permalink
Browse files

Detect USB Printing

Detect USB printing occuring to prevent safety shutdown
  • Loading branch information...
lawrence-jeff committed Jun 9, 2019
1 parent 672e19b commit e5ddd2882a79816e9858d8311143a1b4d9109811
Showing with 18 additions and 0 deletions.
  1. +18 −0 Marlin/src/lcd/malyanlcd.cpp
@@ -451,6 +451,24 @@ void MarlinUI::update() {
}
}

// Detect USB Print jobs
// Probably a better way myabe is_usb_priting query
// Only apply for the first few seconds of detection otherwise you keep resetting screen to build
// Also don't send each time update is called -too frequent
static uint16_t last_elseconds = 0;
duration_t elapsed2;
elapsed2 = print_job_timer.duration();
uint16_t elseconds = elapsed2.second();
if (elseconds > 0 && elseconds <10 && Serial)
{
if (elseconds != last_elseconds)
{
// Switch to build screen
write_to_lcd_P(PSTR("{SYS:BUILD}"));
last_elseconds=elseconds;
}
}

#if ENABLED(WIFI_PRINTING)
// TODO - don't do this a byte at a time.
while (PASSTHROUGHSERIAL.available()) {

0 comments on commit e5ddd28

Please sign in to comment.
You can’t perform that action at this time.