* The main Marlin program loop * * - Call idle() to handle all tasks between G-code commands * Note that no G-codes from the queue can be executed during idle() * but many G-codes can be called directly anytime like macros. * - Check whether SD card auto-start is needed now. * - Check whether SD print finishing is needed now. * - Run one G-code command from the immediate or ma
| 1720 | * as long as idle() or manage_inactivity() are being called. |
| 1721 | */ |
| 1722 | void loop() { |
| 1723 | do { |
| 1724 | idle(); |
| 1725 | |
| 1726 | #if HAS_MEDIA |
| 1727 | if (card.flag.abort_sd_printing) abortSDPrinting(); |
| 1728 | if (marlin_state == MarlinState::MF_SD_COMPLETE) finishSDPrinting(); |
| 1729 | #endif |
| 1730 | |
| 1731 | queue.advance(); |
| 1732 | |
| 1733 | #if ANY(POWER_OFF_TIMER, POWER_OFF_WAIT_FOR_COOLDOWN) |
| 1734 | powerManager.checkAutoPowerOff(); |
| 1735 | #endif |
| 1736 | |
| 1737 | endstops.event_handler(); |
| 1738 | |
| 1739 | TERN_(HAS_TFT_LVGL_UI, printer_state_polling()); |
| 1740 | |
| 1741 | TERN_(MARLIN_TEST_BUILD, runPeriodicTests()); |
| 1742 | |
| 1743 | } while (ENABLED(__AVR__)); // Loop forever on slower (AVR) boards |
| 1744 | } |
no test coverage detected