From 09f1d85e9c47fbd73d37639d45c543554850c7cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Thu, 28 Mar 2024 23:36:23 +0000 Subject: [PATCH] MMU: Revert changes to execute_extruder_sequence loop The previous for-loop is more memory efficient and saves 20 bytes of Flash --- Firmware/mmu2.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Firmware/mmu2.cpp b/Firmware/mmu2.cpp index 1622fcf0f..c2203cdf9 100644 --- a/Firmware/mmu2.cpp +++ b/Firmware/mmu2.cpp @@ -948,8 +948,10 @@ void MMU2::execute_extruder_sequence(const E_Step *sequence, uint8_t stepCount) planner_synchronize(); // Plan the moves - for (const E_Step *step = sequence, *end = sequence + stepCount; step != end; step++) { + const E_Step *step = sequence; + for (uint8_t i = stepCount; i > 0; --i) { extruder_move(pgm_read_float(&(step->extrude)), pgm_read_float(&(step->feedRate))); + step++; } // Wait for the moves to finish