use abs on speed

This commit is contained in:
smayzy 2026-05-07 12:31:10 +02:00
parent 1b848e77e5
commit 85075c1efb

View File

@ -14,6 +14,7 @@
#include <termios.h> #include <termios.h>
#include <errno.h> #include <errno.h>
#include <locale.h> #include <locale.h>
#include <stdlib.h>
const int digit_bitmaps[10][5][3] = { const int digit_bitmaps[10][5][3] = {
{{1,1,1},{1,0,1},{1,0,1},{1,0,1},{1,1,1}}, // 0 {{1,1,1},{1,0,1},{1,0,1},{1,0,1},{1,1,1}}, // 0
@ -138,7 +139,7 @@ void read_can(Tel *t, int soc) {
case 0x382: case 0x382:
if (frame.can_dlc >= 2) { if (frame.can_dlc >= 2) {
t->rpm.data = frame.data[0] | (frame.data[1] << 8); t->rpm.data = abs((int16_t)(frame.data[0] | (frame.data[1] << 8)));
} }
break; break;
default: default: