Skip to content

Instantly share code, notes, and snippets.

@naka123
Created May 2, 2020 19:58
Show Gist options
  • Save naka123/0d1dca5178a75b846276db756b9bfa4b to your computer and use it in GitHub Desktop.
Save naka123/0d1dca5178a75b846276db756b9bfa4b to your computer and use it in GitHub Desktop.
From 11efa5000c76e091cd68fe2e68cc83e44ec3e529 Mon Sep 17 00:00:00 2001
From: naka123 <[email protected]>
Date: Sun, 3 May 2020 01:56:50 +0600
Subject: [PATCH] laser G0 fix
---
Marlin/src/module/stepper.cpp | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp
index 92ee75339..d5b7edec2 100644
--- a/Marlin/src/module/stepper.cpp
+++ b/Marlin/src/module/stepper.cpp
@@ -1874,7 +1874,9 @@ uint32_t Stepper::block_phase_isr() {
return interval; // No more queued movements!
}
- TERN_(HAS_CUTTER, cutter.apply_power(current_block->cutter_power));
+ #if DISABLED(LASER_POWER_INLINE)
+ TERN_(HAS_CUTTER, cutter.apply_power(current_block->cutter_power));
+ #endif
TERN_(POWER_LOSS_RECOVERY, recovery.info.sdpos = current_block->sdpos);
@@ -2043,7 +2045,7 @@ uint32_t Stepper::block_phase_isr() {
if (TEST(stat, 1)) // Laser is on
cutter.set_ocr_power(laser.cur_power);
else
- cutter.set_power(0);
+ cutter.set_ocr_power(0);
}
#else
if (TEST(stat, 0)) { // Planner controls the laser
@@ -2051,7 +2053,7 @@ uint32_t Stepper::block_phase_isr() {
if (TEST(stat, 1)) // Laser is on
cutter.set_ocr_power(current_block->laser.power);
else
- cutter.set_power(0);
+ cutter.set_ocr_power(0);
#else
cutter.set_enabled(TEST(stat, 1));
#endif
@@ -2100,7 +2102,7 @@ uint32_t Stepper::block_phase_isr() {
if (TEST(stat, 1)) // Laser is on
cutter.set_ocr_power(planner.settings.laser.power);
else
- cutter.set_power(0);
+ cutter.set_ocr_power(0);
#else
cutter.set_enabled(TEST(stat, 1));
#endif
--
2.23.0.windows.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment