Apply fixes for DUE

Alternative to #7882. If F_CPU is greater than 1000 it can be evenly divided by 8. Over 10000, 16; over 100000, 32; over 1 million, 64; etc.
This commit is contained in:
Scott Lahteine
2017-10-07 13:34:25 -05:00
parent 4b36a542e0
commit 8315a8a716
8 changed files with 20 additions and 21 deletions

View File

@ -102,10 +102,10 @@ extern "C" {
#define TEMP_TIMER_NUM 0
#define TEMP_TIMER_FREQUENCY (F_CPU / 64.0 / 256.0)
#define HAL_TIMER_RATE ((F_CPU) / 8.0)
#define HAL_STEPPER_TIMER_RATE HAL_TIMER_RATE
#define STEPPER_TIMER_PRESCALE INT0_PRESCALER
#define HAL_TICKS_PER_US (((F_CPU) / 8) / 1000000) // Can not be of type double
#define HAL_TIMER_RATE ((F_CPU) / 8) // i.e., 2MHz or 2.5MHz
#define HAL_STEPPER_TIMER_RATE HAL_TIMER_RATE
#define STEPPER_TIMER_PRESCALE INT0_PRESCALER
#define HAL_TICKS_PER_US ((HAL_STEPPER_TIMER_RATE) / 1000000) // Cannot be of type double
#define ENABLE_STEPPER_DRIVER_INTERRUPT() SBI(TIMSK1, OCIE1A)
#define DISABLE_STEPPER_DRIVER_INTERRUPT() CBI(TIMSK1, OCIE1A)