Move cpuFrequencyDivider to config::stepTimerFrequencyDivider
parent
0c47d8f0d1
commit
066aab7adc
|
|
@ -44,6 +44,9 @@ static constexpr uint16_t minStepRate = 120;
|
|||
/// Size for the motion planner block buffer size
|
||||
static constexpr uint8_t blockBufferSize = 2;
|
||||
|
||||
/// Step timer frequency divider (F = F_CPU / divider)
|
||||
static constexpr uint8_t stepTimerFrequencyDivider = 8;
|
||||
|
||||
/// Idler configuration
|
||||
static constexpr AxisConfig idler = {
|
||||
.dirOn = true,
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ bool PulseGen::PlanMoveTo(pos_t target, steps_t feed_rate) {
|
|||
|
||||
// Acceleration of the segment, in steps/sec^2
|
||||
block->acceleration = acceleration;
|
||||
block->acceleration_rate = block->acceleration * (rate_t)((float)F_CPU / (F_CPU / speed_table::cpuFrequencyDivider));
|
||||
block->acceleration_rate = block->acceleration * (rate_t)((float)F_CPU / (F_CPU / config::stepTimerFrequencyDivider));
|
||||
|
||||
// Perform the trapezoid calculations
|
||||
CalculateTrapezoid(block, max_jerk, max_jerk);
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@ namespace speed_table {
|
|||
typedef uint16_t st_timer_t;
|
||||
|
||||
/// CPU timer frequency divider required for the speed tables
|
||||
static constexpr uint8_t cpuFrequencyDivider = 8;
|
||||
static_assert(F_CPU / cpuFrequencyDivider == 2000000,
|
||||
static_assert(F_CPU / config::stepTimerFrequencyDivider == 2000000,
|
||||
"speed tables not compatible for the requested frequency");
|
||||
|
||||
/// Lookup table for rates equal or higher than 8*256
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ using Catch::Matchers::Equals;
|
|||
using namespace modules::speed_table;
|
||||
|
||||
// The following reference values are calculated for 2MHz timer
|
||||
static_assert(F_CPU / cpuFrequencyDivider == 2000000,
|
||||
static_assert(F_CPU / config::stepTimerFrequencyDivider == 2000000,
|
||||
"speed tables not compatible for the requested frequency");
|
||||
|
||||
static const st_timer_t reference[][3] = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue