cvra / platform-abstraction

Platform abstraction layer for microcontrollers
3 stars 6 forks source link

Add local timestamp functions (fix issue #42) #43

Closed antoinealb closed 10 years ago

antoinealb commented 10 years ago

So it implements the function we talked about in #42 with mock support (see the tests for info on how to use this). I did not implement it for uc/OS-III yet, because I don't have a working system with me now. @nuft could do it maybe ?

I would prefer to have the ucOS implementation before merge, to avoid splitting the functionality list between the test version and the real version.

msplr commented 10 years ago

Ok, added the timestamp implementation. You can pull from my fork: https://github.com/nuft/platform-abstraction/ First I had to move some interrupt handler code from the uCOS Port to the threading implementation.

antoinealb commented 10 years ago

Wouldn't using OSTimeGet be easier ? https://doc.micrium.com/display/osiiidoc/OSTimeGet

Stapelzeiger commented 10 years ago

the uptime OSTimeGet() returns can be reset by OSTimeSet() which makes the timestamp not monotonic.

antoinealb commented 10 years ago

Except if we decide that OSTimeSet is not OK to use and don't provide abstraction for it.

antoinealb commented 10 years ago

but since we must do some additional computations using systick, I don't mind the code as is.

antoinealb commented 10 years ago

I am happy with the status of this PR, so feel free to review / merge it.