1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-17 02:52:12 +01:00

com: Use all bytes in Tx buffer

Code would previously fail Tx if we happen to send data
that happened to be exactly the size of the available space
in the tx buffer.
This commit is contained in:
Stacey Sheldon 2011-12-26 17:11:50 -05:00
parent 34af9ac92d
commit 2040645171

View File

@ -285,7 +285,7 @@ int32_t PIOS_COM_SendBufferNonBlocking(uint32_t com_id, const uint8_t *buffer, u
PIOS_Assert(com_dev->has_tx);
if (len >= fifoBuf_getFree(&com_dev->tx)) {
if (len > fifoBuf_getFree(&com_dev->tx)) {
/* Buffer cannot accept all requested bytes (retry) */
return -2;
}