Motion: add assertions for stepTimerQuantum

pull/47/head
Yuri D'Elia 2021-07-13 19:40:00 +02:00
parent 324fb92fd5
commit eec95d6fb7
1 changed files with 6 additions and 0 deletions

View File

@ -14,6 +14,12 @@ using pulse_gen::pos_t;
using pulse_gen::st_timer_t;
using pulse_gen::steps_t;
// Check for configuration invariants
static_assert(
(1. / (F_CPU / config::stepTimerFrequencyDivider) * config::stepTimerQuantum)
< (1. / config::maxStepFrequency / 2),
"stepTimerQuantum must be smaller than the maximal stepping frequency interval");
/// Main axis enumeration
enum Axis : uint8_t {
Pulley,