1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-30 07:17:59 +00:00

🎨 HAS_SHAPING => HAS_ZV_SHAPING

This commit is contained in:
Scott Lahteine 2023-03-31 20:26:49 -05:00
parent afb9ed73ac
commit 8cdf43f8fd
11 changed files with 29 additions and 29 deletions

View File

@ -22,7 +22,7 @@
#include "../../../inc/MarlinConfig.h"
#if HAS_SHAPING
#if HAS_ZV_SHAPING
#include "../../gcode.h"
#include "../../../module/stepper.h"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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())
);
}

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -189,7 +189,7 @@ HAS_DUPLICATION_MODE = src_filter=+<src/gcode/control/M605.cpp
LIN_ADVANCE = src_filter=+<src/gcode/feature/advance>
PHOTO_GCODE = src_filter=+<src/gcode/feature/camera>
CONTROLLER_FAN_EDITABLE = src_filter=+<src/gcode/feature/controllerfan>
HAS_SHAPING = src_filter=+<src/gcode/feature/input_shaping>
HAS_ZV_SHAPING = src_filter=+<src/gcode/feature/input_shaping>
GCODE_MACROS = src_filter=+<src/gcode/feature/macro>
GRADIENT_MIX = src_filter=+<src/gcode/feature/mixing/M166.cpp>
HAS_SAVED_POSITIONS = src_filter=+<src/gcode/feature/pause/G60.cpp> +<src/gcode/feature/pause/G61.cpp>