Closed froj closed 10 years ago
Code looks good to me. Maybe the design decisions to handle negative timeout value as just a try feels a bit weird but ok.
Maybe add a line or two to the README about non-blocking functions ?
Maybe the design decisions to handle negative timeout value as just a try feels a bit weird but ok.
It's either that or hard fail, I guess.
Does negative time-out ever make sense? If not, fail hard (in mock)
PS: where can I find the uC/OS-III documentation? I'd need to read some of it to be more relevant with my remarks.
On Fri, Jun 13, 2014 at 1:11 PM, froj notifications@github.com wrote:
Maybe the design decisions to handle negative timeout value as just a try feels a bit weird but ok.
It's either that or hard fail, I guess.
— Reply to this email directly or view it on GitHub https://github.com/cvra/platform-abstraction/pull/17#issuecomment-45999727 .
Does negative time-out ever make sense? If not, fail hard (in mock)
OK, we'll let it fail hard.
@pierluca uC/OS-III doc
I'm against using float milliseconds for the timeout. If we use float, then it should consistently be in SI units so we never need to convert units. I would prefer to use an uint32_t in microseconds since this is much less overhead on systems without an FPU.
uint32_t in microseconds seems reasonable. That means an overflow after about 72 minutes. We're not going that far, are we ? ;-)
On Fri, Jun 13, 2014 at 2:38 PM, Patrick Spieler notifications@github.com wrote:
I'm against using float milliseconds for the timeout. If we use float, then it should consistently be in SI units so we never need to convert units. I would prefer to use an uint32_t in microseconds since this is much less overhead on systems without an FPU.
— Reply to this email directly or view it on GitHub https://github.com/cvra/platform-abstraction/pull/17#issuecomment-46006168 .
What is the overflow of uc/OS-III ?
What is the overflow of uc/OS-III ?
It's uint32
OS-ticks.
Ok, so we can safely allow uint32_t
microseconds.
I chose
float
milliseconds for the timeout as it seems to be the most readable.