From 7616d0e389099b45fa09a6a28a99c9b5968f93d8 Mon Sep 17 00:00:00 2001 From: John Robertson Date: Sat, 23 Mar 2024 00:57:23 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20ESP32=20laser=20M4=20excep?= =?UTF-8?q?tion=20(#26884)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/stepper.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 70871632a9c8..171fb7e2eedf 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -2333,7 +2333,8 @@ uint32_t Stepper::block_phase_isr() { */ if (cutter.cutter_mode == CUTTER_MODE_DYNAMIC && planner.laser_inline.status.isPowered // isPowered flag set on any parsed G1, G2, G3, or G5 move; cleared on any others. - && cutter.last_block_power != current_block->laser.power // Prevent constant update without change + && current_block // Block may not be available if steps completed (see discard_current_block() above) + && cutter.last_block_power != current_block->laser.power // Only update if the power changed ) { cutter.apply_power(current_block->laser.power); cutter.last_block_power = current_block->laser.power;