Hi Rocco,
I have been playing with your functions and trying to add Magnetometer functions to it, looks like you are going faster then I am!!
For real time duration between calls to AHRS routines you can use halGetCounterValue().
Just get the time at the start of your routine, compare it to the time last time you started
your routine and calculate the time.
There are a few things to be aware of about this, however. This is a free running counter and
can overflow.
I think the counter is 32 bits and is clocked at 72Mhz on the stm32f3.
counter size clocked @ == overflow @ seconds
4294967296 / 72000000 = 59.6523236
It may be better to use a virtual timer and clock it slower. I doubt you need
timing down the 1/72,000,000
Maybe create a Virtual Timer that clocks about 1mhz or so with a callback that
bumps a 32bit counter. Then you can read that timer to get a high resolution
time interval.
counter size clocked @ == overflow @ seconds
4,294,967,296 / 1,000,000 = 4294.9673 = 71.58 hours
You can play with the timer clocking speed to get different values of resolution
and period between overflows.
If you have any questions about any of this I will be more then happy to help.
Your libraries are looking better then mine!!!
-John Scott
http://www.atl123.com