Making better use of BLUETOOTH_PACKET_SIZE
Using BLUETOOTH_PACKET_SIZE instead of literal in code.
This commit is contained in:
@@ -215,10 +215,10 @@ void Bluetooth::processTrainerByte(uint8_t data)
|
|||||||
|
|
||||||
if (bufferIndex >= BLUETOOTH_PACKET_SIZE) {
|
if (bufferIndex >= BLUETOOTH_PACKET_SIZE) {
|
||||||
uint8_t crc = 0x00;
|
uint8_t crc = 0x00;
|
||||||
for (int i=0; i<13; i++) {
|
for (int i=0; i<(BLUETOOTH_PACKET_SIZE-1); i++) {
|
||||||
crc ^= buffer[i];
|
crc ^= buffer[i];
|
||||||
}
|
}
|
||||||
if (crc == buffer[13]) {
|
if (crc == buffer[BLUETOOTH_PACKET_SIZE-1]) {
|
||||||
if (buffer[0] == 0x80) {
|
if (buffer[0] == 0x80) {
|
||||||
processTrainerFrame(buffer);
|
processTrainerFrame(buffer);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user