Function to loop for a specific time.

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Good afternoon all!

 

Is there an ASF library module to use a counter timer to control a while loop?

Or is the an even better way to implement a time out?

 

I am using a SAM4E.

 

// setup counter with preset and start the count down to zero.

While (counter_value > zero)
}
    // Do some stuff until we timeout.
}

// WE TIMED OUT !!

 

Whaa ?,.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Durarara wrote:
Is there an ASF library module to use a counter timer to control a while loop?

I very much doubt it.

 

ASF would let you control the timer.

 

What you then do with that timer would be entirely up to you - nothing to do with ASF

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So I see this TC driver for the SAM4E ... I added it and found the API docs.

 

I guess I need to use my original idea of a counter timer?

 

I just wanted to make sure I was not re-inventing the wheel.

Wasn't sure if they was a simpler way.

 

 

Whaa ?,.