reviving usec_time?
Posted: Thu Mar 24, 2016 3:09 am
Hi all, I am new to the Crazyflie. I needed some sub-millisecond timing to benchmark my code. My colleague (whoenig on this forum) told me that the functions in /hal/usec_time.c worked on Crazyflie 1 but are now broken on Crazyflie 2. I found that moving the counter timer from TIM1 to "basic timer" TIM7 fixes the problem.
TIM6 would also work, but it shares an interrupt vector with something else. The other non-basic timers would work too, but they have nice features like PWM which would be wasted on this application. I only tested on Crazyflie 2 so far, but TIM7 is available on the STM32F103 too.
I would be happy to contribute this code to the main repo if desired. My changes are visible at https://github.com/jpreiss/crazyflie-firmware.
Really cool project by the way
, I found it very easy to learn my way around the firmware and make modifications.
TIM6 would also work, but it shares an interrupt vector with something else. The other non-basic timers would work too, but they have nice features like PWM which would be wasted on this application. I only tested on Crazyflie 2 so far, but TIM7 is available on the STM32F103 too.
I would be happy to contribute this code to the main repo if desired. My changes are visible at https://github.com/jpreiss/crazyflie-firmware.
Really cool project by the way
