Quote:
Originally Posted by MPaulHolmes
Holy hanna montana that's fast!
|
Well, it is just scheduling the adc conversions and returning. The adc conversions happen in the hardware and the main loop will march forward till the adc complete interrupt says ("OK, I read that last channel").
The top of the main loop halts interrupts briefly, makes its own copies of the interesting variables, then re-enables interrupts. It can't use the global versions directly because they could get updated in the middle of a computation.
Max ADC rate is about 10khz, and there is only one channel at a time, so a lot of the timer1 calls will auto-return, but it is what it is and the bulk of the processing (32 bit math?) can happen in the main loop outside of interrupts.