1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

OP-238 PiOS/USB: Fix for problem Ed's being see where being plugged into usb

but not having telemetry causes a reset.  If the buffer got full enough it
would never start to transmit again.

Note: also making Telemetry non-blocking

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2346 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
peabody124 2011-01-08 08:05:02 +00:00 committed by peabody124
parent 05de5492d9
commit d8022a320d
2 changed files with 4 additions and 4 deletions

View File

@ -320,9 +320,7 @@ static int32_t transmitData(uint8_t * data, int32_t length)
outputPort = telemetryPort;
}
// TODO: Update once the PIOS_COM is made blocking (it is implemented as a busy loop for now!)
//PIOS_LED_Toggle(LED2);
return PIOS_COM_SendBuffer(outputPort, data, length);
return PIOS_COM_SendBufferNonBlocking(outputPort, data, length);
}
/**

View File

@ -240,8 +240,10 @@ int32_t PIOS_USB_HID_TxBufferPutMoreNonBlocking(uint8_t id, const uint8_t * buff
if(!transfer_possible)
return -1;
if (len > fifoBuf_getFree(&tx_pios_fifo_buffer))
if (len > fifoBuf_getFree(&tx_pios_fifo_buffer)) {
sendChunk(); /* Try and send what's in the buffer though */
return -2; /* Cannot send all requested bytes */
}
/* don't check returned bytes because it should always succeed */
/* after previous thread and no meaningful way to deal with the */