Skip to content

Commit

Permalink
silly constexpr rule
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Dec 7, 2022
1 parent 19d26ce commit 2a63956
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 0 additions & 2 deletions Marlin/src/module/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ 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
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
Expand Down
5 changes: 3 additions & 2 deletions Marlin/src/module/stepper.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@ constexpr ena_mask_t enable_overlap[] = {
#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.");

#if HAS_SHAPING
Expand All @@ -342,8 +345,6 @@ constexpr ena_mask_t enable_overlap[] = {
#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
template<int INDEX=DISTINCT_AXES> constexpr float max_isr_rate() {
constexpr feedRate_t _DMF[] = DEFAULT_MAX_FEEDRATE;
constexpr float _DASU[] = DEFAULT_AXIS_STEPS_PER_UNIT;
return _MAX(_DMF[INDEX - 1] * _DASU[INDEX - 1], max_isr_rate<INDEX - 1>());
}
template<> constexpr float max_isr_rate<0>() {
Expand Down

0 comments on commit 2a63956

Please sign in to comment.