mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-04 13:15:08 +08:00
Removing alternative io timer rate for CF2
This commit is contained in:
committed by
Lorenz Meier
parent
2d451991af
commit
bf9a1c5a18
@@ -38,4 +38,5 @@ fi
|
||||
set PWM_MIN none
|
||||
set PWM_MAX 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_LOWEST_MAX 255
|
||||
|
||||
/* Override the io timers to update at 328.125 kHz (recommended) */
|
||||
|
||||
#define PX4_IO_TIMER_ALTERNATE_RATE 255
|
||||
|
||||
|
||||
/* High-resolution timer */
|
||||
#define HRT_TIMER 8 /* use timer8 for the HRT */
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
#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 */
|
||||
|
||||
rARR(timer) = 1000000 / rate;
|
||||
#endif
|
||||
|
||||
/* generate an update event; reloads the counter and all registers */
|
||||
rEGR(timer) = GTIM_EGR_UG;
|
||||
|
||||
Reference in New Issue
Block a user