🩹 Fix M502 init of default motion

Fix regression from #25035
This commit is contained in:
Scott Lahteine 2022-12-12 16:46:50 -06:00
parent 8bafc1d9ae
commit ffbf6acd6c
2 changed files with 7 additions and 6 deletions

View File

@ -193,6 +193,8 @@ typedef struct { bool NUM_AXIS_LIST(X:1, Y:1, Z:1, I:1, J:1, K:1, U:1, V:1,
// Defaults for reset / fill in on load // Defaults for reset / fill in on load
static const uint32_t _DMA[] PROGMEM = DEFAULT_MAX_ACCELERATION; static const uint32_t _DMA[] PROGMEM = DEFAULT_MAX_ACCELERATION;
static const float _DASU[] PROGMEM = DEFAULT_AXIS_STEPS_PER_UNIT;
static const feedRate_t _DMF[] PROGMEM = DEFAULT_MAX_FEEDRATE;
/** /**
* Current EEPROM Layout * Current EEPROM Layout

View File

@ -326,9 +326,6 @@ constexpr ena_mask_t enable_overlap[] = {
#endif #endif
}; };
constexpr float _DASU[] = DEFAULT_AXIS_STEPS_PER_UNIT;
constexpr feedRate_t _DMF[] = DEFAULT_MAX_FEEDRATE;
//static_assert(!any_enable_overlap(), "There is some overlap."); //static_assert(!any_enable_overlap(), "There is some overlap.");
#if HAS_SHAPING #if HAS_SHAPING
@ -336,12 +333,14 @@ constexpr feedRate_t _DMF[] = DEFAULT_MAX_FEEDRATE;
#ifdef SHAPING_MAX_STEPRATE #ifdef SHAPING_MAX_STEPRATE
constexpr float max_step_rate = SHAPING_MAX_STEPRATE; constexpr float max_step_rate = SHAPING_MAX_STEPRATE;
#else #else
constexpr float max_shaped_rate = TERN0(INPUT_SHAPING_X, _DMF[X_AXIS] * _DASU[X_AXIS]) + constexpr float _ISDASU[] = DEFAULT_AXIS_STEPS_PER_UNIT;
TERN0(INPUT_SHAPING_Y, _DMF[Y_AXIS] * _DASU[Y_AXIS]); constexpr feedRate_t _ISDMF[] = DEFAULT_MAX_FEEDRATE;
constexpr float max_shaped_rate = TERN0(INPUT_SHAPING_X, _ISDMF[X_AXIS] * _ISDASU[X_AXIS]) +
TERN0(INPUT_SHAPING_Y, _ISDMF[Y_AXIS] * _ISDASU[Y_AXIS]);
#if defined(__AVR__) || !defined(ADAPTIVE_STEP_SMOOTHING) #if defined(__AVR__) || !defined(ADAPTIVE_STEP_SMOOTHING)
// MIN_STEP_ISR_FREQUENCY is known at compile time on AVRs and any reduction in SRAM is welcome // MIN_STEP_ISR_FREQUENCY is known at compile time on AVRs and any reduction in SRAM is welcome
template<int INDEX=DISTINCT_AXES> constexpr float max_isr_rate() { template<int INDEX=DISTINCT_AXES> constexpr float max_isr_rate() {
return _MAX(_DMF[INDEX - 1] * _DASU[INDEX - 1], max_isr_rate<INDEX - 1>()); return _MAX(_ISDMF[INDEX - 1] * _ISDASU[INDEX - 1], max_isr_rate<INDEX - 1>());
} }
template<> constexpr float max_isr_rate<0>() { template<> constexpr float max_isr_rate<0>() {
return TERN0(ADAPTIVE_STEP_SMOOTHING, MIN_STEP_ISR_FREQUENCY); return TERN0(ADAPTIVE_STEP_SMOOTHING, MIN_STEP_ISR_FREQUENCY);