From ae31c0ec31f0360787c5c4efbb0034b66e630ec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 6 Jan 2024 00:19:15 +0000 Subject: [PATCH] optimisation: used expired() instead of elapsed() If the timer is expired, then the timer is stopped. This is OK since we are starting the timer again anyway Change in memory: Flash: -14 bytes SRAM: 0 bytes --- Firmware/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index b2d4cd2ab..186b111a2 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -9600,7 +9600,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument s get_command(); } - if (blocks_queued() && GetPrinterState() == PrinterState::IsHostPrinting && usb_timer.elapsed() > ((USB_TIMER_TIMEOUT) / 2)) + if (blocks_queued() && GetPrinterState() == PrinterState::IsHostPrinting && usb_timer.expired((USB_TIMER_TIMEOUT) / 2)) { // Handle the case where planned moves may take a longer time to execute than the USB timer period. // An example is the toolchange unload sequence generated by PrusaSlicer with default settings.