use abs on speed
This commit is contained in:
parent
1b848e77e5
commit
85075c1efb
@ -14,6 +14,7 @@
|
||||
#include <termios.h>
|
||||
#include <errno.h>
|
||||
#include <locale.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
const int digit_bitmaps[10][5][3] = {
|
||||
{{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:
|
||||
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;
|
||||
default:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user