Dennis-van-Gils / SAMD51_InterruptTimer

SAMD51 Interrupt Timer library for e.g. Adafruit M4 Metro/Feather/ItsyBitsy Express
MIT License
25 stars 7 forks source link

Stop Timer? #5

Closed RAyWB closed 4 years ago

RAyWB commented 4 years ago

Hi , as I´m not a professional coder just a question: How is it possible to stop the Timer? In my project I´m generating step pulses for a stepper motor but the question is how to stop the timer. i added :

void TC_Timer::stopTimer(){ TC3->COUNT16.CTRLA.bit.ENABLE = 0; TC3_wait_for_sync(); NVIC_DisableIRQ(TC3_IRQn); }

to my copy and it seems to work well , not shure if it´s correct to do it that way. May be you find the time to check and add the feature.

Thanks for your effort

Dennis-van-Gils commented 4 years ago

Dear Robert, Thanks for your interest in my code. I don't have the time to extend my code, unfortunately. But I do remember that someone forked my code to add the start/stop functionality that you request. Have a look at https://github.com/sennert/SAMD51_InterruptTimer.

Best, Dennis

RAyWB commented 4 years ago

Dear Dennis, Thanks for your really quick response ! That´s what i was looking for. Kind regards, Robert

Dennis-van-Gils commented 4 years ago

You're welcome. Actually, I just have merged Sennert's stop & restart functions into my branch. I haven't tested it myself, though.