From 8cdf43f8fdf8900ad903d094d1aeb5dc651b324b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 31 Mar 2023 20:26:49 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20=20HAS=5FSHAPING=20=3D>=20HAS=5F?= =?UTF-8?q?ZV=5FSHAPING?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/gcode/feature/input_shaping/M593.cpp | 2 +- Marlin/src/gcode/gcode.cpp | 2 +- Marlin/src/gcode/gcode.h | 2 +- Marlin/src/inc/Conditionals_adv.h | 2 +- Marlin/src/inc/SanityCheck.h | 2 +- Marlin/src/inc/Warnings.cpp | 2 +- Marlin/src/module/planner.cpp | 2 +- Marlin/src/module/settings.cpp | 6 +++--- Marlin/src/module/stepper.cpp | 18 +++++++++--------- Marlin/src/module/stepper.h | 18 +++++++++--------- ini/features.ini | 2 +- 11 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Marlin/src/gcode/feature/input_shaping/M593.cpp b/Marlin/src/gcode/feature/input_shaping/M593.cpp index a4b3cd3fee..1b6a43f9dd 100644 --- a/Marlin/src/gcode/feature/input_shaping/M593.cpp +++ b/Marlin/src/gcode/feature/input_shaping/M593.cpp @@ -22,7 +22,7 @@ #include "../../../inc/MarlinConfig.h" -#if HAS_SHAPING +#if HAS_ZV_SHAPING #include "../../gcode.h" #include "../../../module/stepper.h" diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 1eaf4dcd39..1752ae8a18 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -933,7 +933,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 575: M575(); break; // M575: Set serial baudrate #endif - #if HAS_SHAPING + #if HAS_ZV_SHAPING case 593: M593(); break; // M593: Set Input Shaping parameters #endif diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 48e6fd2da8..cc3f221a82 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -1084,7 +1084,7 @@ private: static void M575(); #endif - #if HAS_SHAPING + #if HAS_ZV_SHAPING static void M593(); static void M593_report(const bool forReplay=true); #endif diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index c3f244b6bb..3295626722 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -1248,7 +1248,7 @@ // Input shaping #if EITHER(INPUT_SHAPING_X, INPUT_SHAPING_Y) - #define HAS_SHAPING 1 + #define HAS_ZV_SHAPING 1 #endif // Toolchange Event G-code diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index c25be192e2..f718846bff 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -4513,7 +4513,7 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); /** * Input Shaping requirements */ -#if HAS_SHAPING +#if HAS_ZV_SHAPING #if ENABLED(DELTA) #error "Input Shaping is not compatible with DELTA kinematics." #elif ENABLED(SCARA) diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index e9d3f42388..0204c3fab0 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -801,7 +801,7 @@ /** * Input Shaping */ -#if HAS_SHAPING && ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) +#if HAS_ZV_SHAPING && ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) #warning "Input Shaping for CORE / MARKFORGED kinematic axes is still experimental." #endif diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 8e77a7c979..552d212e2e 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -1728,7 +1728,7 @@ float Planner::triggered_position_mm(const AxisEnum axis) { bool Planner::busy() { return (has_blocks_queued() || cleaning_buffer_counter || TERN0(EXTERNAL_CLOSED_LOOP_CONTROLLER, CLOSED_LOOP_WAITING()) - || TERN0(HAS_SHAPING, stepper.input_shaping_busy()) + || TERN0(HAS_ZV_SHAPING, stepper.input_shaping_busy()) ); } diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 8b615f2faf..0be7f965a4 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -1638,7 +1638,7 @@ void MarlinSettings::postprocess() { // // Input Shaping /// - #if HAS_SHAPING + #if HAS_ZV_SHAPING #if ENABLED(INPUT_SHAPING_X) EEPROM_WRITE(stepper.get_shaping_frequency(X_AXIS)); EEPROM_WRITE(stepper.get_shaping_damping_ratio(X_AXIS)); @@ -3429,7 +3429,7 @@ void MarlinSettings::reset() { // // Input Shaping // - #if HAS_SHAPING + #if HAS_ZV_SHAPING #if ENABLED(INPUT_SHAPING_X) stepper.set_shaping_frequency(X_AXIS, SHAPING_FREQ_X); stepper.set_shaping_damping_ratio(X_AXIS, SHAPING_ZETA_X); @@ -3690,7 +3690,7 @@ void MarlinSettings::reset() { // // Input Shaping // - TERN_(HAS_SHAPING, gcode.M593_report(forReplay)); + TERN_(HAS_ZV_SHAPING, gcode.M593_report(forReplay)); // // Linear Advance diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index f7436e51d5..34a5ca28a3 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -240,7 +240,7 @@ uint32_t Stepper::advance_divisor = 0, bool Stepper::la_active = false; #endif -#if HAS_SHAPING +#if HAS_ZV_SHAPING shaping_time_t ShapingQueue::now = 0; shaping_time_t ShapingQueue::times[shaping_echoes]; shaping_echo_axis_t ShapingQueue::echo_axes[shaping_echoes]; @@ -1494,7 +1494,7 @@ void Stepper::isr() { // Enable ISRs to reduce USART processing latency hal.isr_on(); - TERN_(HAS_SHAPING, shaping_isr()); // Do Shaper stepping, if needed + TERN_(HAS_ZV_SHAPING, shaping_isr()); // Do Shaper stepping, if needed if (!nextMainISR) pulse_phase_isr(); // 0 = Do coordinated axes Stepper pulses @@ -1542,7 +1542,7 @@ void Stepper::isr() { // nextMainISR -= interval; - TERN_(HAS_SHAPING, ShapingQueue::decrement_delays(interval)); + TERN_(HAS_ZV_SHAPING, ShapingQueue::decrement_delays(interval)); TERN_(LIN_ADVANCE, if (nextAdvanceISR != LA_ADV_NEVER) nextAdvanceISR -= interval); TERN_(INTEGRATED_BABYSTEPPING, if (nextBabystepISR != BABYSTEP_NEVER) nextBabystepISR -= interval); @@ -1663,7 +1663,7 @@ void Stepper::pulse_phase_isr() { abort_current_block = false; if (current_block) { discard_current_block(); - #if HAS_SHAPING + #if HAS_ZV_SHAPING ShapingQueue::purge(); #if ENABLED(INPUT_SHAPING_X) shaping_x.delta_error = 0; @@ -1921,7 +1921,7 @@ void Stepper::pulse_phase_isr() { #endif #endif - #if HAS_SHAPING + #if HAS_ZV_SHAPING // record an echo if a step is needed in the primary bresenham const bool x_step = TERN0(INPUT_SHAPING_X, step_needed.x && shaping_x.enabled), y_step = TERN0(INPUT_SHAPING_Y, step_needed.y && shaping_y.enabled); @@ -2035,7 +2035,7 @@ void Stepper::pulse_phase_isr() { } while (--events_to_do); } -#if HAS_SHAPING +#if HAS_ZV_SHAPING void Stepper::shaping_isr() { AxisFlags step_needed{0}; @@ -2087,7 +2087,7 @@ void Stepper::pulse_phase_isr() { } } -#endif // HAS_SHAPING +#endif // HAS_ZV_SHAPING // Calculate timer interval, with all limits applied. hal_timer_t Stepper::calc_timer_interval(uint32_t step_rate) { @@ -3108,7 +3108,7 @@ void Stepper::init() { #endif } -#if HAS_SHAPING +#if HAS_ZV_SHAPING /** * Calculate a fixed point factor to apply to the signal and its echo @@ -3179,7 +3179,7 @@ void Stepper::init() { return -1; } -#endif // HAS_SHAPING +#endif // HAS_ZV_SHAPING /** * Set the stepper positions directly in steps diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index 704805464c..4adbb01991 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -94,7 +94,7 @@ #endif // Input shaping base time - #if HAS_SHAPING + #if HAS_ZV_SHAPING #define ISR_SHAPING_BASE_CYCLES 180UL #else #define ISR_SHAPING_BASE_CYCLES 0UL @@ -128,7 +128,7 @@ #endif // Input shaping base time - #if HAS_SHAPING + #if HAS_ZV_SHAPING #define ISR_SHAPING_BASE_CYCLES 290UL #else #define ISR_SHAPING_BASE_CYCLES 0UL @@ -217,7 +217,7 @@ #define ISR_LOOP_CYCLES(R) ((ISR_LOOP_BASE_CYCLES + MIN_ISR_LOOP_CYCLES + MIN_STEPPER_PULSE_CYCLES) * ((1UL << R) - 1) + _MAX(MIN_ISR_LOOP_CYCLES, MIN_STEPPER_PULSE_CYCLES)) // Model input shaping as an extra loop call -#define ISR_SHAPING_LOOP_CYCLES(R) (TERN0(HAS_SHAPING, (ISR_LOOP_BASE_CYCLES + TERN0(INPUT_SHAPING_X, ISR_X_STEPPER_CYCLES) + TERN0(INPUT_SHAPING_Y, ISR_Y_STEPPER_CYCLES)) << R)) +#define ISR_SHAPING_LOOP_CYCLES(R) (TERN0(HAS_ZV_SHAPING, (ISR_LOOP_BASE_CYCLES + TERN0(INPUT_SHAPING_X, ISR_X_STEPPER_CYCLES) + TERN0(INPUT_SHAPING_Y, ISR_Y_STEPPER_CYCLES)) << R)) // If linear advance is enabled, then it is handled separately #if ENABLED(LIN_ADVANCE) @@ -315,7 +315,7 @@ constexpr ena_mask_t enable_overlap[] = { //static_assert(!any_enable_overlap(), "There is some overlap."); -#if HAS_SHAPING +#if HAS_ZV_SHAPING #ifdef SHAPING_MAX_STEPRATE constexpr float max_step_rate = SHAPING_MAX_STEPRATE; @@ -463,7 +463,7 @@ constexpr ena_mask_t enable_overlap[] = { int32_t last_block_end_pos = 0; }; -#endif // HAS_SHAPING +#endif // HAS_ZV_SHAPING // // Stepper class definition @@ -577,7 +577,7 @@ class Stepper { static bool bezier_2nd_half; // If Bézier curve has been initialized or not #endif - #if HAS_SHAPING + #if HAS_ZV_SHAPING #if ENABLED(INPUT_SHAPING_X) static ShapeParams shaping_x; #endif @@ -646,7 +646,7 @@ class Stepper { // The stepper block processing ISR phase static hal_timer_t block_phase_isr(); - #if HAS_SHAPING + #if HAS_ZV_SHAPING static void shaping_isr(); #endif @@ -669,7 +669,7 @@ class Stepper { // Check if the given block is busy or not - Must not be called from ISR contexts static bool is_block_busy(const block_t * const block); - #if HAS_SHAPING + #if HAS_ZV_SHAPING // Check whether the stepper is processing any input shaping echoes static bool input_shaping_busy() { const bool was_on = hal.isr_state(); @@ -817,7 +817,7 @@ class Stepper { set_directions(); } - #if HAS_SHAPING + #if HAS_ZV_SHAPING static void set_shaping_damping_ratio(const AxisEnum axis, const_float_t zeta); static float get_shaping_damping_ratio(const AxisEnum axis); static void set_shaping_frequency(const AxisEnum axis, const_float_t freq); diff --git a/ini/features.ini b/ini/features.ini index 11ffca6ba6..4e378a8eaf 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -189,7 +189,7 @@ HAS_DUPLICATION_MODE = src_filter=+ PHOTO_GCODE = src_filter=+ CONTROLLER_FAN_EDITABLE = src_filter=+ -HAS_SHAPING = src_filter=+ +HAS_ZV_SHAPING = src_filter=+ GCODE_MACROS = src_filter=+ GRADIENT_MIX = src_filter=+ HAS_SAVED_POSITIONS = src_filter=+ +