Browse Source

Fix AntPlus transmit buffer wrap issue

main
PaulStoffregen 7 years ago
parent
commit
d8c4d55dad
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      antplus.cpp

+ 3
- 1
antplus.cpp 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;

Loading…
Cancel
Save