Skip to content

Commit 829812e

Browse files
committed
BaseMaster: Fix uint rollover
When a send till acknowledged message was recieved it would cause the request count to roll over backwards and transmit for 255 times even if the ack was received.
1 parent 2a07a9c commit 829812e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/BaseClasses/ANTPLUS_BaseMasterProfile.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ bool BaseMasterProfile::isRequestedPagePending() {
4141
}
4242

4343
uint8_t BaseMasterProfile::getRequestedPage() {
44-
_requestedCount--;
44+
if (_requestedCount > 0) {
45+
_requestedCount--;
46+
}
4547
return _requestedPage;
4648
}
4749

0 commit comments

Comments
 (0)