Apply TERN

This commit is contained in:
Scott Lahteine 2020-04-24 17:41:20 -05:00
parent 94dd9ce73d
commit e25402b541
2 changed files with 8 additions and 25 deletions

View File

@ -135,19 +135,13 @@ float Planner::steps_to_mm[XYZE_N]; // (mm) Millimeters per step
#if HAS_JUNCTION_DEVIATION #if HAS_JUNCTION_DEVIATION
float Planner::junction_deviation_mm; // (mm) M205 J float Planner::junction_deviation_mm; // (mm) M205 J
#if ENABLED(LIN_ADVANCE) #if ENABLED(LIN_ADVANCE)
#if ENABLED(DISTINCT_E_FACTORS) float Planner::max_e_jerk // Calculated from junction_deviation_mm
float Planner::max_e_jerk[EXTRUDERS]; // Calculated from junction_deviation_mm TERN_(DISTINCT_E_FACTORS, [EXTRUDERS]);
#else
float Planner::max_e_jerk;
#endif
#endif #endif
#endif #endif
#if HAS_CLASSIC_JERK #if HAS_CLASSIC_JERK
#if HAS_LINEAR_E_JERK TERN(HAS_LINEAR_E_JERK, xyz_pos_t, xyze_pos_t) Planner::max_jerk;
xyz_pos_t Planner::max_jerk; // (mm/s^2) M205 XYZ - The largest speed change requiring no acceleration.
#else
xyze_pos_t Planner::max_jerk; // (mm/s^2) M205 XYZE - The largest speed change requiring no acceleration.
#endif
#endif #endif
#if ENABLED(SD_ABORT_ON_ENDSTOP_HIT) #if ENABLED(SD_ABORT_ON_ENDSTOP_HIT)
@ -2382,12 +2376,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
#endif #endif
uint8_t limited = 0; uint8_t limited = 0;
#if HAS_LINEAR_E_JERK TERN(HAS_LINEAR_E_JERK, LOOP_XYZ, LOOP_XYZE)(i) {
LOOP_XYZ(i)
#else
LOOP_XYZE(i)
#endif
{
const float jerk = ABS(current_speed[i]), // cs : Starting from zero, change in speed for this axis const float jerk = ABS(current_speed[i]), // cs : Starting from zero, change in speed for this axis
maxj = (max_jerk[i] + (i == X_AXIS || i == Y_AXIS ? extra_xyjerk : 0.0f)); // mj : The max jerk setting for this axis maxj = (max_jerk[i] + (i == X_AXIS || i == Y_AXIS ? extra_xyjerk : 0.0f)); // mj : The max jerk setting for this axis
if (jerk > maxj) { // cs > mj : New current speed too fast? if (jerk > maxj) { // cs > mj : New current speed too fast?

View File

@ -308,19 +308,13 @@ class Planner {
static float junction_deviation_mm; // (mm) M205 J static float junction_deviation_mm; // (mm) M205 J
#if ENABLED(LIN_ADVANCE) #if ENABLED(LIN_ADVANCE)
static float max_e_jerk // Calculated from junction_deviation_mm static float max_e_jerk // Calculated from junction_deviation_mm
#if ENABLED(DISTINCT_E_FACTORS) TERN_(DISTINCT_E_FACTORS, [EXTRUDERS]);
[EXTRUDERS]
#endif
;
#endif #endif
#endif #endif
#if HAS_CLASSIC_JERK #if HAS_CLASSIC_JERK
#if HAS_LINEAR_E_JERK // (mm/s^2) M205 XYZ(E) - The largest speed change requiring no acceleration.
static xyz_pos_t max_jerk; // (mm/s^2) M205 XYZ - The largest speed change requiring no acceleration. static TERN(HAS_LINEAR_E_JERK, xyz_pos_t, xyze_pos_t) max_jerk;
#else
static xyze_pos_t max_jerk; // (mm/s^2) M205 XYZE - The largest speed change requiring no acceleration.
#endif
#endif #endif
#if HAS_LEVELING #if HAS_LEVELING