1
0
mirror of https://github.com/gdsports/USBHost_t36 synced 2024-11-24 01:52:23 -05:00

Fix AntPlus transmit buffer wrap issue

This commit is contained in:
PaulStoffregen 2017-10-20 09:02:55 -07:00
parent 1613316f7c
commit d8c4d55dad

View File

@ -149,7 +149,9 @@ void AntPlus::tx_data(const Transfer_t *transfer)
//print(", tail=", (p-1) - txbuffer);
//println(", tail=", txtail);
uint32_t tail = txtail;
tail += *(p-1) + 1;
uint8_t size = *(p-1);
tail += size + 1;
if (tail >= sizeof(txbuffer)) tail -= sizeof(txbuffer);
txtail = tail;
//println("new tail=", tail);
txready = true;