|
Re: Get_Analog_Value in an ISR
Thanks Larry. I've changed my code to process an interrupt count outside of the ISR, following the method in your earlier post of counting up interrupts in the ISR and counting them down in the main thread. Even with the jitter this introduces, the gyro is now performing very nicely.
We have been doing much in haste lately, and I multiplex across all the tasks on the build team. So I have not yet taken time to do much optimization of code, or to understand how we're managing to use 10ms. We do table lookup and interpolation for a couple of math functions (arctan and sqrt), but these are 64 entry tables and using a binary search (6 compares per lookup) so I don't think they're consuming a lot of time. The other thing is I do some arithmetic in 32 bits where I know with more careful planning, I could use smaller variables. This is clearly eating up some time too. Maybe after we ship tomorrow I'll have time to scrub the code good.
Bill
|