Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 5 months ago.
DigitalOut Concurrency Issues?
I just had a terrifying thought... Is it possible for there to be concurrency issues with driving multiple DigitalOut's that happen to be on the same port from different threads/ISRs?
Question relating to:
1 Answer
9 years, 5 months ago.
Wait, halloween is over, right? Stop trying to scare me :(.
I am afraid there is no special protection against this. Now writing should be fine I think, since every (or most?) target I am aware of uses a special set/clear register: So since it is just writing a bit it should go fine I think.
However for example switching from input to output, is reading a register, settnig a bit, and writing it again. If it interrupts between the reading and writing part, then yes it will go wrong.