mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 23:13:34 +08:00
Attach the interrupt before powering on the HRT timer.
This commit is contained in:
@@ -386,12 +386,12 @@ static void hrt_ppm_decode(uint32_t status);
|
|||||||
static void
|
static void
|
||||||
hrt_tim_init(void)
|
hrt_tim_init(void)
|
||||||
{
|
{
|
||||||
/* clock/power on our timer */
|
|
||||||
modifyreg32(HRT_TIMER_POWER_REG, 0, HRT_TIMER_POWER_BIT);
|
|
||||||
|
|
||||||
/* claim our interrupt vector */
|
/* claim our interrupt vector */
|
||||||
irq_attach(HRT_TIMER_VECTOR, hrt_tim_isr);
|
irq_attach(HRT_TIMER_VECTOR, hrt_tim_isr);
|
||||||
|
|
||||||
|
/* clock/power on our timer */
|
||||||
|
modifyreg32(HRT_TIMER_POWER_REG, 0, HRT_TIMER_POWER_BIT);
|
||||||
|
|
||||||
/* disable and configure the timer */
|
/* disable and configure the timer */
|
||||||
rCR1 = 0;
|
rCR1 = 0;
|
||||||
rCR2 = 0;
|
rCR2 = 0;
|
||||||
@@ -582,7 +582,7 @@ hrt_absolute_time(void)
|
|||||||
{
|
{
|
||||||
hrt_abstime abstime;
|
hrt_abstime abstime;
|
||||||
uint32_t count;
|
uint32_t count;
|
||||||
uint32_t flags;
|
irqstate_t flags;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Counter state. Marked volatile as they may change
|
* Counter state. Marked volatile as they may change
|
||||||
|
|||||||
Reference in New Issue
Block a user