Skip to content

Commit

Permalink
style tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Mar 26, 2023
1 parent a120dfe commit 4b1fee8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Marlin/src/HAL/AVR/timers.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ typedef uint16_t hal_timer_t;
#define MF_TIMER_TEMP 0
#endif

#define TEMP_TIMER_FREQUENCY ((F_CPU) / 64.0 / 256.0)
#define TEMP_TIMER_FREQUENCY (((F_CPU) + 0x2000) / 0x4000)

#define STEPPER_TIMER_RATE HAL_TIMER_RATE
#define STEPPER_TIMER_PRESCALE 8
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // Cannot be of type double
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000)

#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // frequency of pulse timer
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
#define PULSE_TIMER_RATE STEPPER_TIMER_RATE
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US

#define ENABLE_STEPPER_DRIVER_INTERRUPT() SBI(TIMSK1, OCIE1A)
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/module/stepper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2094,8 +2094,8 @@ hal_timer_t Stepper::calc_timer_interval(uint32_t step_rate) {

#ifdef CPU_32_BIT

if (step_rate != 0)
return uint32_t(STEPPER_TIMER_RATE) / step_rate; // A fast processor can just do integer division
// A fast processor can just do integer division
if (step_rate) return uint32_t(STEPPER_TIMER_RATE) / step_rate;

return HAL_TIMER_TYPE_MAX;

Expand Down

0 comments on commit 4b1fee8

Please sign in to comment.