-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] (bugfix-2.0.9.x) 'E_AXIS' was not declared in this scope #22143
Comments
Looks like it's also doing similar things with I'm not sure if the E_AXIS stuff was all just missed, or like that for some reason? I believe the Let me know if that builds/works for you. I'll see if I can find any more invalid |
@slowbro there was a recent change in how EXTRUDERS 0 is handled. The goal is that no internal axis is maintained in that case. It looks like the parts you found were missed during the refactoring. I'm looking forward to your next PR. |
Cool, I wasn't sure if that was the case, or what - I saw the other thread about |
thinkyhead did the refactoring related to EXTRUDERS, he might know best. From my perspective, IJK axes should be rather treated like the Y axis in general. E axis might need guard conditions in other places than those axes. |
#22163 was merged. Closing. |
@thisiskeithb I don't think that PR addresses the whole issue; looks like it only changes one file - https://github.com/MarlinFirmware/Marlin/pull/22163/files I'm working on a PR for the rest, once I have a bit of free time. |
I just tested the latest bugfix-2.0.x.
|
Give this diff a try diff --git a/Marlin/src/gcode/feature/trinamic/M911-M914.cpp b/Marlin/src/gcode/feature/trinamic/M911-M914.cpp
index 747f1c9516..fc0c55155b 100644
--- a/Marlin/src/gcode/feature/trinamic/M911-M914.cpp
+++ b/Marlin/src/gcode/feature/trinamic/M911-M914.cpp
@@ -265,20 +265,22 @@
TERN_(Z3_HAS_STEALTCHOP, if (index == 0 || index == 3) TMC_SET_PWMTHRS(Z,Z3));
TERN_(Z4_HAS_STEALTCHOP, if (index == 0 || index == 4) TMC_SET_PWMTHRS(Z,Z4));
break;
- case E_AXIS: {
- #if E_STEPPERS
- const int8_t target_extruder = get_target_extruder_from_command();
- if (target_extruder < 0) return;
- TERN_(E0_HAS_STEALTHCHOP, else if (target_extruder == 0) TMC_SET_PWMTHRS_E(0));
- TERN_(E1_HAS_STEALTHCHOP, else if (target_extruder == 1) TMC_SET_PWMTHRS_E(1));
- TERN_(E2_HAS_STEALTHCHOP, else if (target_extruder == 2) TMC_SET_PWMTHRS_E(2));
- TERN_(E3_HAS_STEALTHCHOP, else if (target_extruder == 3) TMC_SET_PWMTHRS_E(3));
- TERN_(E4_HAS_STEALTHCHOP, else if (target_extruder == 4) TMC_SET_PWMTHRS_E(4));
- TERN_(E5_HAS_STEALTHCHOP, else if (target_extruder == 5) TMC_SET_PWMTHRS_E(5));
- TERN_(E6_HAS_STEALTHCHOP, else if (target_extruder == 6) TMC_SET_PWMTHRS_E(6));
- TERN_(E7_HAS_STEALTHCHOP, else if (target_extruder == 7) TMC_SET_PWMTHRS_E(7));
- #endif // E_STEPPERS
- } break;
+ #if HAS_EXTRUDERS
+ case E_AXIS: {
+ #if E_STEPPERS
+ const int8_t target_extruder = get_target_extruder_from_command();
+ if (target_extruder < 0) return;
+ TERN_(E0_HAS_STEALTHCHOP, else if (target_extruder == 0) TMC_SET_PWMTHRS_E(0));
+ TERN_(E1_HAS_STEALTHCHOP, else if (target_extruder == 1) TMC_SET_PWMTHRS_E(1));
+ TERN_(E2_HAS_STEALTHCHOP, else if (target_extruder == 2) TMC_SET_PWMTHRS_E(2));
+ TERN_(E3_HAS_STEALTHCHOP, else if (target_extruder == 3) TMC_SET_PWMTHRS_E(3));
+ TERN_(E4_HAS_STEALTHCHOP, else if (target_extruder == 4) TMC_SET_PWMTHRS_E(4));
+ TERN_(E5_HAS_STEALTHCHOP, else if (target_extruder == 5) TMC_SET_PWMTHRS_E(5));
+ TERN_(E6_HAS_STEALTHCHOP, else if (target_extruder == 6) TMC_SET_PWMTHRS_E(6));
+ TERN_(E7_HAS_STEALTHCHOP, else if (target_extruder == 7) TMC_SET_PWMTHRS_E(7));
+ #endif // E_STEPPERS
+ } break;
+ #endif
}
}
diff --git a/Marlin/src/gcode/host/M114.cpp b/Marlin/src/gcode/host/M114.cpp
index 2fdce1edfd..7d69033319 100644
--- a/Marlin/src/gcode/host/M114.cpp
+++ b/Marlin/src/gcode/host/M114.cpp
@@ -216,10 +216,12 @@ void GcodeSuite::M114() {
report_current_position_detail();
return;
}
- if (parser.seen_test('E')) {
- SERIAL_ECHOLNPAIR("Count E:", stepper.position(E_AXIS));
- return;
- }
+ #if HAS_EXTRUDERS
+ if (parser.seen_test('E')) {
+ SERIAL_ECHOLNPAIR("Count E:", stepper.position(E_AXIS));
+ return;
+ }
+ #endif
#endif
#if ENABLED(M114_REALTIME)
diff --git a/Marlin/src/gcode/parser.h b/Marlin/src/gcode/parser.h
index 5a1748cc4d..9350fa5584 100644
--- a/Marlin/src/gcode/parser.h
+++ b/Marlin/src/gcode/parser.h
@@ -311,7 +311,7 @@ public:
}
static inline float axis_unit_factor(const AxisEnum axis) {
- return (axis >= E_AXIS && volumetric_enabled ? volumetric_unit_factor : linear_unit_factor);
+ return (TERN(HAS_EXTRUDERS, axis >= E_AXIS && volumetric_enabled ? volumetric_unit_factor : linear_unit_factor, linear_unit_factor));
}
static inline float linear_value_to_mm(const_float_t v) { return v * linear_unit_factor; }
diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp
index b540c9a938..16f94d4df3 100644
--- a/Marlin/src/module/motion.cpp
+++ b/Marlin/src/module/motion.cpp
@@ -266,7 +266,7 @@ void report_current_position_projected() {
get_cartesian_from_steppers();
const xyz_pos_t lpos = cartes.asLogical();
- SERIAL_ECHOPAIR("X:", lpos.x, " Y:", lpos.y, " Z:", lpos.z, " E:", current_position.e);
+ SERIAL_ECHOPAIR("X:", lpos.x, " Y:", lpos.y, " Z:", lpos.z OPTARG(HAS_EXTRUDERS, " E:") OPTARG(HAS_EXTRUDERS, current_position.e));
stepper.report_positions();
#if IS_SCARA
@@ -1008,7 +1008,9 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) {
// If the move is very short, check the E move distance
// No E move either? Game over.
float cartesian_mm = diff.magnitude();
- if (UNEAR_ZERO(cartesian_mm)) cartesian_mm = ABS(diff.e);
+ #if HAS_EXTRUDERS
+ if (UNEAR_ZERO(cartesian_mm)) cartesian_mm = ABS(diff.e);
+ #endif
if (UNEAR_ZERO(cartesian_mm)) return;
// The length divided by the segment size
|
#22176 was just merged that should fix this. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Did you test the latest
bugfix-2.0.x
code?Yes, and the problem still exists.
Bug Description
Error while build with #define EXTRUDERS 0 (CNC config).
Steps to Reproduce
Try to build
Version of Marlin Firmware
Marlin-bugfix-2.0.9.x
Printer model
CNC
Electronics
BTT SKR 1.3 board
Additional information & file uploads
Configs_n_Diffs.zip
The text was updated successfully, but these errors were encountered: