ivanseidel / DueTimer

⏳ Timer Library fully implemented for Arduino DUE
MIT License
212 stars 89 forks source link

Reading the current counter value #62

Open wizwik opened 6 years ago

wizwik commented 6 years ago

I had an application where I needed to read the current counter value. I added this function to the class. uint32_t DueTimer::getCV(void) const{ uint32_t result; // Get current timer configuration Timer t = Timers[timer]; result=TC_ReadCV(t.tc,t.channel); return result; }

The addition to the Header file in the public area is uint32_t getCV(void) const;

It seems to work ok.