|
|
@@ -174,8 +174,9 @@ bool DataFrame::AddFloat(float f)
|
|
|
uint8_t DataFrame::Commit(void)
|
|
|
{
|
|
|
// compute _length
|
|
|
- _frame[1] = _length;
|
|
|
- _frame[_length--] = crc8(0, _length-2, _frame);
|
|
|
+ _length++;
|
|
|
+ _frame[1] = _length - 2;
|
|
|
+ _frame[_length - 1] = crc8(0, _length-1, _frame);
|
|
|
// length of payload: from byte 2 to CRC byte (the last)
|
|
|
return _length;
|
|
|
|