Removing alternative io timer rate for CF2

This commit is contained in:
Dennis Shtatnov
2016-11-03 08:11:45 -04:00
committed by Lorenz Meier
parent 2d451991af
commit bf9a1c5a18
3 changed files with 2 additions and 13 deletions
+2 -1
View File
@@ -38,4 +38,5 @@ fi
set PWM_MIN none set PWM_MIN none
set PWM_MAX none set PWM_MAX none
set PWM_DISARMED none set PWM_DISARMED none
set PWM_RATE 500 # Will run the motors at 328.125 kHz (recommended)
set PWM_RATE 3921
@@ -173,10 +173,6 @@
#define PWM_DEFAULT_MAX 255 #define PWM_DEFAULT_MAX 255
#define PWM_LOWEST_MAX 255 #define PWM_LOWEST_MAX 255
/* Override the io timers to update at 328.125 kHz (recommended) */
#define PX4_IO_TIMER_ALTERNATE_RATE 255
/* High-resolution timer */ /* High-resolution timer */
#define HRT_TIMER 8 /* use timer8 for the HRT */ #define HRT_TIMER 8 /* use timer8 for the HRT */
-8
View File
@@ -379,17 +379,9 @@ static int allocate_channel(unsigned channel, io_timer_channel_mode_t mode)
static int timer_set_rate(unsigned timer, unsigned rate) static int timer_set_rate(unsigned timer, unsigned rate)
{ {
#if defined(PX4_IO_TIMER_ALTERNATE_RATE)
/* Override the rate to a constant that could be provided by the board */
rARR(timer) = PX4_IO_TIMER_ALTERNATE_RATE;
#else
/* configure the timer to update at the desired rate */ /* configure the timer to update at the desired rate */
rARR(timer) = 1000000 / rate; rARR(timer) = 1000000 / rate;
#endif
/* generate an update event; reloads the counter and all registers */ /* generate an update event; reloads the counter and all registers */
rEGR(timer) = GTIM_EGR_UG; rEGR(timer) = GTIM_EGR_UG;