Compare commits

..
2 Commits
Author SHA1 Message Date
smayzy 45bad91ba7 clear uart parity 2026-04-27 14:58:12 +02:00
smayzy d44ecffb41 prevent can from parsing partial frames 2026-04-27 14:39:05 +02:00
+3
View File
@@ -120,6 +120,8 @@ void read_can(Tel *t, int soc) {
if (nbytes < 0) return; // -1 EAGAIN means empty
if (nbytes != sizeof(struct can_frame)) return;
if (nbytes > 0) {
switch (frame.can_id) {
@@ -522,6 +524,7 @@ int main(int argc, char **argv) {
uart_str.c_cflag &= ~CSIZE; // clear bit size
uart_str.c_cflag |= (CLOCAL | CREAD | CS8);
uart_str.c_cflag &= ~PARENB;
cfsetispeed(&uart_str, B115200);
cfsetospeed(&uart_str, B115200);