Page 1 of 1

[DONE]Atomic IO operations

Posted: Fri Aug 02, 2013 8:38 am
by kjellhar
Hi,
I am a bit confused when reading the documentation on the PalWritePad (and the other Pad operations).
http://chibios.sourceforge.net/html/gro ... 34c5b42daa

In the Note, it says that the function is not guaranteed to be atomic, and it can be enclosed between chSysLock() and chSysUnlock() to ensure this. However, the Function Class is "Normal" which means it cannot be invoked within a lock zone.

So, which one is it?

I really need to make a small set of Pad write operations atomic in a PWM callback, but I'm not sure if it is allowed.

Best regards,
Kjell

Re: Atomic IO operations

Posted: Fri Aug 02, 2013 11:37 am
by Giovanni
It is allowed, it is a documentation error.

Giovanni

Re: Atomic IO operations

Posted: Fri Aug 02, 2013 1:19 pm
by kjellhar
Is it safe to assume that if using lock is mentioned in the comments, it is allowed even if the Function class says it's not?

Thanks,
Kjell

Re: Atomic IO operations

Posted: Fri Aug 02, 2013 2:31 pm
by Giovanni
Yes, it is safe.

Giovanni

Re: [TODO]Atomic IO operations

Posted: Thu Aug 15, 2013 9:45 am
by Giovanni
Fixed in repository, will be released in 2.6.1.

Giovanni