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:
parent
05de5492d9
commit
d8022a320d
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user