mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 09:16:07 +03:00
Fix VCP support for new Tx bytes free vtable entry
This commit is contained in:
parent
94affd5841
commit
ca2a6d9cdd
2 changed files with 11 additions and 3 deletions
|
@ -648,8 +648,11 @@ blackboxBufferReserveStatus_e blackboxDeviceReserveBufferSpace(int32_t bytes)
|
|||
// Handle failure:
|
||||
switch (masterConfig.blackbox_device) {
|
||||
case BLACKBOX_DEVICE_SERIAL:
|
||||
// One byte of the tx buffer isn't available for user data (due to its circular list implementation), hence the -1
|
||||
if (bytes > (int32_t) blackboxPort->txBufferSize - 1) {
|
||||
/*
|
||||
* One byte of the tx buffer isn't available for user data (due to its circular list implementation),
|
||||
* hence the -1. Note that the USB VCP implementation doesn't use a buffer and has txBufferSize set to zero.
|
||||
*/
|
||||
if (blackboxPort->txBufferSize && bytes > (int32_t) blackboxPort->txBufferSize - 1) {
|
||||
return BLACKBOX_RESERVE_PERMANENT_FAILURE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue