How to deal with a wrapping counter in embedded C
问题 I need to deal with a counter that gives me ticks for my application. The counter is 32bits so what i need to know is how to deal with it when it wraps. for example: I have a function that returns a (timestamp + shifttime) and i have another function that will return 1 or 0 depending whether or not the time has elapsed, but there could a possibility that that my counter will wrap how do I deal with this ?. Thanks Thanks a lot for all the responses guys. I will give more detail in this edit. I