Skip to content

Commit 8cdf43f

Browse files
committed
🎨 HAS_SHAPING => HAS_ZV_SHAPING
1 parent afb9ed7 commit 8cdf43f

File tree

11 files changed

+29
-29
lines changed

11 files changed

+29
-29
lines changed

Marlin/src/gcode/feature/input_shaping/M593.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#include "../../../inc/MarlinConfig.h"
2424

25-
#if HAS_SHAPING
25+
#if HAS_ZV_SHAPING
2626

2727
#include "../../gcode.h"
2828
#include "../../../module/stepper.h"

Marlin/src/gcode/gcode.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
933933
case 575: M575(); break; // M575: Set serial baudrate
934934
#endif
935935

936-
#if HAS_SHAPING
936+
#if HAS_ZV_SHAPING
937937
case 593: M593(); break; // M593: Set Input Shaping parameters
938938
#endif
939939

Marlin/src/gcode/gcode.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ class GcodeSuite {
10841084
static void M575();
10851085
#endif
10861086

1087-
#if HAS_SHAPING
1087+
#if HAS_ZV_SHAPING
10881088
static void M593();
10891089
static void M593_report(const bool forReplay=true);
10901090
#endif

Marlin/src/inc/Conditionals_adv.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1248,7 +1248,7 @@
12481248

12491249
// Input shaping
12501250
#if EITHER(INPUT_SHAPING_X, INPUT_SHAPING_Y)
1251-
#define HAS_SHAPING 1
1251+
#define HAS_ZV_SHAPING 1
12521252
#endif
12531253

12541254
// Toolchange Event G-code

Marlin/src/inc/SanityCheck.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -4513,7 +4513,7 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
45134513
/**
45144514
* Input Shaping requirements
45154515
*/
4516-
#if HAS_SHAPING
4516+
#if HAS_ZV_SHAPING
45174517
#if ENABLED(DELTA)
45184518
#error "Input Shaping is not compatible with DELTA kinematics."
45194519
#elif ENABLED(SCARA)

Marlin/src/inc/Warnings.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@
801801
/**
802802
* Input Shaping
803803
*/
804-
#if HAS_SHAPING && ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
804+
#if HAS_ZV_SHAPING && ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
805805
#warning "Input Shaping for CORE / MARKFORGED kinematic axes is still experimental."
806806
#endif
807807

Marlin/src/module/planner.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1728,7 +1728,7 @@ float Planner::triggered_position_mm(const AxisEnum axis) {
17281728
bool Planner::busy() {
17291729
return (has_blocks_queued() || cleaning_buffer_counter
17301730
|| TERN0(EXTERNAL_CLOSED_LOOP_CONTROLLER, CLOSED_LOOP_WAITING())
1731-
|| TERN0(HAS_SHAPING, stepper.input_shaping_busy())
1731+
|| TERN0(HAS_ZV_SHAPING, stepper.input_shaping_busy())
17321732
);
17331733
}
17341734

Marlin/src/module/settings.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1638,7 +1638,7 @@ void MarlinSettings::postprocess() {
16381638
//
16391639
// Input Shaping
16401640
///
1641-
#if HAS_SHAPING
1641+
#if HAS_ZV_SHAPING
16421642
#if ENABLED(INPUT_SHAPING_X)
16431643
EEPROM_WRITE(stepper.get_shaping_frequency(X_AXIS));
16441644
EEPROM_WRITE(stepper.get_shaping_damping_ratio(X_AXIS));
@@ -3429,7 +3429,7 @@ void MarlinSettings::reset() {
34293429
//
34303430
// Input Shaping
34313431
//
3432-
#if HAS_SHAPING
3432+
#if HAS_ZV_SHAPING
34333433
#if ENABLED(INPUT_SHAPING_X)
34343434
stepper.set_shaping_frequency(X_AXIS, SHAPING_FREQ_X);
34353435
stepper.set_shaping_damping_ratio(X_AXIS, SHAPING_ZETA_X);
@@ -3690,7 +3690,7 @@ void MarlinSettings::reset() {
36903690
//
36913691
// Input Shaping
36923692
//
3693-
TERN_(HAS_SHAPING, gcode.M593_report(forReplay));
3693+
TERN_(HAS_ZV_SHAPING, gcode.M593_report(forReplay));
36943694

36953695
//
36963696
// Linear Advance

Marlin/src/module/stepper.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ uint32_t Stepper::advance_divisor = 0,
240240
bool Stepper::la_active = false;
241241
#endif
242242

243-
#if HAS_SHAPING
243+
#if HAS_ZV_SHAPING
244244
shaping_time_t ShapingQueue::now = 0;
245245
shaping_time_t ShapingQueue::times[shaping_echoes];
246246
shaping_echo_axis_t ShapingQueue::echo_axes[shaping_echoes];
@@ -1494,7 +1494,7 @@ void Stepper::isr() {
14941494
// Enable ISRs to reduce USART processing latency
14951495
hal.isr_on();
14961496

1497-
TERN_(HAS_SHAPING, shaping_isr()); // Do Shaper stepping, if needed
1497+
TERN_(HAS_ZV_SHAPING, shaping_isr()); // Do Shaper stepping, if needed
14981498

14991499
if (!nextMainISR) pulse_phase_isr(); // 0 = Do coordinated axes Stepper pulses
15001500

@@ -1542,7 +1542,7 @@ void Stepper::isr() {
15421542
//
15431543

15441544
nextMainISR -= interval;
1545-
TERN_(HAS_SHAPING, ShapingQueue::decrement_delays(interval));
1545+
TERN_(HAS_ZV_SHAPING, ShapingQueue::decrement_delays(interval));
15461546
TERN_(LIN_ADVANCE, if (nextAdvanceISR != LA_ADV_NEVER) nextAdvanceISR -= interval);
15471547
TERN_(INTEGRATED_BABYSTEPPING, if (nextBabystepISR != BABYSTEP_NEVER) nextBabystepISR -= interval);
15481548

@@ -1663,7 +1663,7 @@ void Stepper::pulse_phase_isr() {
16631663
abort_current_block = false;
16641664
if (current_block) {
16651665
discard_current_block();
1666-
#if HAS_SHAPING
1666+
#if HAS_ZV_SHAPING
16671667
ShapingQueue::purge();
16681668
#if ENABLED(INPUT_SHAPING_X)
16691669
shaping_x.delta_error = 0;
@@ -1921,7 +1921,7 @@ void Stepper::pulse_phase_isr() {
19211921
#endif
19221922
#endif
19231923

1924-
#if HAS_SHAPING
1924+
#if HAS_ZV_SHAPING
19251925
// record an echo if a step is needed in the primary bresenham
19261926
const bool x_step = TERN0(INPUT_SHAPING_X, step_needed.x && shaping_x.enabled),
19271927
y_step = TERN0(INPUT_SHAPING_Y, step_needed.y && shaping_y.enabled);
@@ -2035,7 +2035,7 @@ void Stepper::pulse_phase_isr() {
20352035
} while (--events_to_do);
20362036
}
20372037

2038-
#if HAS_SHAPING
2038+
#if HAS_ZV_SHAPING
20392039

20402040
void Stepper::shaping_isr() {
20412041
AxisFlags step_needed{0};
@@ -2087,7 +2087,7 @@ void Stepper::pulse_phase_isr() {
20872087
}
20882088
}
20892089

2090-
#endif // HAS_SHAPING
2090+
#endif // HAS_ZV_SHAPING
20912091

20922092
// Calculate timer interval, with all limits applied.
20932093
hal_timer_t Stepper::calc_timer_interval(uint32_t step_rate) {
@@ -3108,7 +3108,7 @@ void Stepper::init() {
31083108
#endif
31093109
}
31103110

3111-
#if HAS_SHAPING
3111+
#if HAS_ZV_SHAPING
31123112

31133113
/**
31143114
* Calculate a fixed point factor to apply to the signal and its echo
@@ -3179,7 +3179,7 @@ void Stepper::init() {
31793179
return -1;
31803180
}
31813181

3182-
#endif // HAS_SHAPING
3182+
#endif // HAS_ZV_SHAPING
31833183

31843184
/**
31853185
* Set the stepper positions directly in steps

Marlin/src/module/stepper.h

+9-9
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
#endif
9595

9696
// Input shaping base time
97-
#if HAS_SHAPING
97+
#if HAS_ZV_SHAPING
9898
#define ISR_SHAPING_BASE_CYCLES 180UL
9999
#else
100100
#define ISR_SHAPING_BASE_CYCLES 0UL
@@ -128,7 +128,7 @@
128128
#endif
129129

130130
// Input shaping base time
131-
#if HAS_SHAPING
131+
#if HAS_ZV_SHAPING
132132
#define ISR_SHAPING_BASE_CYCLES 290UL
133133
#else
134134
#define ISR_SHAPING_BASE_CYCLES 0UL
@@ -217,7 +217,7 @@
217217
#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))
218218

219219
// Model input shaping as an extra loop call
220-
#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))
220+
#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))
221221

222222
// If linear advance is enabled, then it is handled separately
223223
#if ENABLED(LIN_ADVANCE)
@@ -315,7 +315,7 @@ constexpr ena_mask_t enable_overlap[] = {
315315

316316
//static_assert(!any_enable_overlap(), "There is some overlap.");
317317

318-
#if HAS_SHAPING
318+
#if HAS_ZV_SHAPING
319319

320320
#ifdef SHAPING_MAX_STEPRATE
321321
constexpr float max_step_rate = SHAPING_MAX_STEPRATE;
@@ -463,7 +463,7 @@ constexpr ena_mask_t enable_overlap[] = {
463463
int32_t last_block_end_pos = 0;
464464
};
465465

466-
#endif // HAS_SHAPING
466+
#endif // HAS_ZV_SHAPING
467467

468468
//
469469
// Stepper class definition
@@ -577,7 +577,7 @@ class Stepper {
577577
static bool bezier_2nd_half; // If Bézier curve has been initialized or not
578578
#endif
579579

580-
#if HAS_SHAPING
580+
#if HAS_ZV_SHAPING
581581
#if ENABLED(INPUT_SHAPING_X)
582582
static ShapeParams shaping_x;
583583
#endif
@@ -646,7 +646,7 @@ class Stepper {
646646
// The stepper block processing ISR phase
647647
static hal_timer_t block_phase_isr();
648648

649-
#if HAS_SHAPING
649+
#if HAS_ZV_SHAPING
650650
static void shaping_isr();
651651
#endif
652652

@@ -669,7 +669,7 @@ class Stepper {
669669
// Check if the given block is busy or not - Must not be called from ISR contexts
670670
static bool is_block_busy(const block_t * const block);
671671

672-
#if HAS_SHAPING
672+
#if HAS_ZV_SHAPING
673673
// Check whether the stepper is processing any input shaping echoes
674674
static bool input_shaping_busy() {
675675
const bool was_on = hal.isr_state();
@@ -817,7 +817,7 @@ class Stepper {
817817
set_directions();
818818
}
819819

820-
#if HAS_SHAPING
820+
#if HAS_ZV_SHAPING
821821
static void set_shaping_damping_ratio(const AxisEnum axis, const_float_t zeta);
822822
static float get_shaping_damping_ratio(const AxisEnum axis);
823823
static void set_shaping_frequency(const AxisEnum axis, const_float_t freq);

ini/features.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ HAS_DUPLICATION_MODE = src_filter=+<src/gcode/control/M605.cpp
189189
LIN_ADVANCE = src_filter=+<src/gcode/feature/advance>
190190
PHOTO_GCODE = src_filter=+<src/gcode/feature/camera>
191191
CONTROLLER_FAN_EDITABLE = src_filter=+<src/gcode/feature/controllerfan>
192-
HAS_SHAPING = src_filter=+<src/gcode/feature/input_shaping>
192+
HAS_ZV_SHAPING = src_filter=+<src/gcode/feature/input_shaping>
193193
GCODE_MACROS = src_filter=+<src/gcode/feature/macro>
194194
GRADIENT_MIX = src_filter=+<src/gcode/feature/mixing/M166.cpp>
195195
HAS_SAVED_POSITIONS = src_filter=+<src/gcode/feature/pause/G60.cpp> +<src/gcode/feature/pause/G61.cpp>

0 commit comments

Comments
 (0)