FastSerial: added tx_pending() method

this allows the caller to wait for the tx buffer to drain
This commit is contained in:
Andrew Tridgell 2012-06-15 15:52:01 +10:00
parent d4056213ad
commit b7e807cd58
1 changed files with 5 additions and 0 deletions

View File

@ -165,6 +165,11 @@ public:
_nonblocking_writes = !blocking; _nonblocking_writes = !blocking;
} }
// return true if there are bytes pending transmission
bool tx_pending(void) {
return (_txBuffer->head != _txBuffer->tail);
}
private: private:
/// Bit mask for initialized ports /// Bit mask for initialized ports