Browse Source

STEPPER_TIMER_RATE might call a function

Scott Lahteine 5 years ago
parent
commit
4b35ff1f07
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      Marlin/src/module/stepper.cpp

+ 2
- 2
Marlin/src/module/stepper.cpp View File

416
 #endif
416
 #endif
417
 
417
 
418
 #define CYCLES_TO_NS(CYC) (1000UL * (CYC) / ((F_CPU) / 1000000))
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
 // Round up when converting from ns to timer ticks
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
 #define TIMER_SETUP_NS (CYCLES_TO_NS(TIMER_READ_ADD_AND_STORE_CYCLES))
424
 #define TIMER_SETUP_NS (CYCLES_TO_NS(TIMER_READ_ADD_AND_STORE_CYCLES))
425
 
425
 

Loading…
Cancel
Save