Looking through previous posts, I note this issue of being able to reset the timer to form non-blocking version of CyDelay come sup time and again.
Has Cypress not come up with a non-blocking timer function yet? It seems to me that dropping down components and using control components and logic levels simply to get a non-blocking timeout funtion is convoluted.
It appears in my previous post, I would also need to stop the timer before setting counter value and then restart. So, to get a simple non-blocking timeout function I need to set up a volatile flag, create a timer interrupt that sets the flag and clears the interrupt then in code. I need to place a Timer, Low digital level, Clock and isr on the work sheet and then in the main code have to stop the timer, set counter value to 0, reset the timeout flag and start the time again.
Something real simple like below would seem more convenient to me...
Yes, you are quite right. This is the exactly the code I used for my own. I'm afraid Cypress cannot provide us with every solution, some we have to do ourselves. You may of course write your own timer/timeout components and use them where required.
I prefer the good ol' software solution...
You may even set the clock to MHz and get µs resolution
Example was compiled using Creator 3.1 beta release and a Pioneer BLE kit.
msTimer.cywrk.Archive01.zip 23.7 K