Fix missing new line when ASCII protocol is used with checksums.

See https://github.com/odriverobotics/ODrive/issues/596
This commit is contained in:
Samuel Sadok
2021-07-22 11:01:14 +02:00
parent 30d453583c
commit e109d2d6b5
+1 -1
View File
@@ -53,7 +53,7 @@ void AsciiProtocol::respond(bool include_checksum, const char * fmt, TArgs&& ...
uint8_t checksum = 0;
for (size_t i = 0; i < len; ++i)
checksum ^= tx_buf[i];
len += snprintf(tx_buf + len, sizeof(tx_buf) - len, "*%u", checksum);
len += snprintf(tx_buf + len, sizeof(tx_buf) - len, "*%u\r\n", checksum);
} else {
len += snprintf(tx_buf + len, sizeof(tx_buf) - len, "\r\n");
}