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

//print(", tail=", (p-1) - txbuffer); //print(", tail=", (p-1) - txbuffer);
//println(", tail=", txtail); //println(", tail=", txtail);
uint32_t 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; txtail = tail;
//println("new tail=", tail); //println("new tail=", tail);
txready = true; txready = true;

Loading…
Cancel
Save