Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: Intervall Timer - stop and resuming

  1. #1
    Junior Member
    Join Date
    Jan 2013
    Posts
    15

    Question Intervall Timer - stop and resuming

    Hey All

    I've a question about the interval timer library. Compared to the Teensy 2 compatible TimerOne Library I miss a resume option. I saw that there are two private methods called

    Code:
        static void enable_PIT();
        static void disable_PIT();
    Can I define them as public and call them to stop and resume my isr? or is this a bad idea? More details about the use case, I need to drive a clock spi line in a ISR - sometimes i need to shift out also data on the spi line and then I need to stop the ISR.

    Cheers and thanks for your work
    Michu

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,171
    Use the end() function to stop the timer. When you want to start it again, use begin().

  3. #3
    Junior Member
    Join Date
    Jan 2013
    Posts
    15
    Thanks for your reply paul. I saw that this are the regular begin / end calls - but I had to call those begin end calls often (up to 100 times per second) and I'm afraid using those calls will slow down my code. I just want to make sure the isr routine is not running during one function is called. to illustrate my use case, take a look at my code at https://github.com/neophob/PixelCont...PD6803.cpp#L83.

    Cheers
    Michu

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •