From 20406451714ced1c8434755771bbed442cf04a08 Mon Sep 17 00:00:00 2001 From: Stacey Sheldon Date: Mon, 26 Dec 2011 17:11:50 -0500 Subject: [PATCH] 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. --- flight/PiOS/Common/pios_com.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flight/PiOS/Common/pios_com.c b/flight/PiOS/Common/pios_com.c index 739329f15..c7f252973 100644 --- a/flight/PiOS/Common/pios_com.c +++ b/flight/PiOS/Common/pios_com.c @@ -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; }