- if (call Registers.getCtl0(UCMST)) {
- while (!call Registers.getIfgRx() && !call Registers.getCtl1(UCSWRST));
- return TRUE;
- } else {
- /* If SPI slave, the host could quit clocking any time, so we need a
- * timeout.
- */
- unsigned i = 0;
-
- while (++i) {
- if (call Registers.getIfgRx())
- return TRUE;
- if (call Registers.getCtl1(UCSWRST))
- return FALSE;
- }
- return FALSE;