Atomic Test-and-Clear on the 8051
When running multiple tasks simultaneously on an embedded system using cooperative task scheduling you might run into situations (at least I did 😁) where these tasks might need to access the same hardware peripheral. Not all peripherals can be shared easily due to their configuration or some other kind of internal …