cvra / platform-abstraction

Platform abstraction layer for microcontrollers
3 stars 6 forks source link

Fix issue #11 (non-blocking pend / with timeout) #17

Closed froj closed 10 years ago

froj commented 10 years ago

I chose float milliseconds for the timeout as it seems to be the most readable.

antoinealb commented 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 ?

froj commented 10 years ago

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.

pierluca commented 10 years ago

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 .

froj commented 10 years ago

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

Stapelzeiger commented 10 years ago

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.

pierluca commented 10 years ago

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 .

antoinealb commented 10 years ago

What is the overflow of uc/OS-III ?

froj commented 10 years ago

What is the overflow of uc/OS-III ?

It's uint32 OS-ticks.

antoinealb commented 10 years ago

Ok, so we can safely allow uint32_t microseconds.