|
@@ -416,10 +416,10 @@ xyze_int8_t Stepper::count_direction{0};
|
416
|
416
|
#endif
|
417
|
417
|
|
418
|
418
|
#define CYCLES_TO_NS(CYC) (1000UL * (CYC) / ((F_CPU) / 1000000))
|
419
|
|
-constexpr uint32_t NS_PER_PULSE_TIMER_TICK = 1000000000UL / (STEPPER_TIMER_RATE);
|
|
419
|
+#define NS_PER_PULSE_TIMER_TICK (1000000000UL / (STEPPER_TIMER_RATE))
|
420
|
420
|
|
421
|
421
|
// Round up when converting from ns to timer ticks
|
422
|
|
-constexpr uint32_t NS_TO_PULSE_TIMER_TICKS(uint32_t NS) { return (NS + (NS_PER_PULSE_TIMER_TICK) / 2) / (NS_PER_PULSE_TIMER_TICK); }
|
|
422
|
+#define NS_TO_PULSE_TIMER_TICKS(NS) (((NS) + (NS_PER_PULSE_TIMER_TICK) / 2) / (NS_PER_PULSE_TIMER_TICK))
|
423
|
423
|
|
424
|
424
|
#define TIMER_SETUP_NS (CYCLES_TO_NS(TIMER_READ_ADD_AND_STORE_CYCLES))
|
425
|
425
|
|