async command uint8_t SpiByte.write(uint8_t byte)
{
- if (isBusy())
- return 0;
- else {
- waitOnTx();
- call Registers.setTxbuf(byte);
- waitOnRx();
- return call Registers.getRxbuf();
+ atomic {
+ if (isBusy())
+ return 0;
+ else {
+ waitOnTx();
+ call Registers.setTxbuf(byte);
+ waitOnRx();
+ return call Registers.getRxbuf();
+ }
}
}