Dual CANbus monitor and instrumentation cluster supporting ILI9341 display controller
Dependencies: SPI_TFTx2_ILI9341 TOUCH_TFTx2_ILI9341 TFT_fonts mbed
Fork of CANary by
Diff: utility.cpp
- Revision:
- 51:6187c5264a73
- Parent:
- 50:83d5864c64a0
- Child:
- 58:4d06288d75a2
diff -r 83d5864c64a0 -r 6187c5264a73 utility.cpp --- a/utility.cpp Sun Apr 07 16:34:12 2013 +0000 +++ b/utility.cpp Sun Apr 07 17:11:28 2013 +0000 @@ -132,6 +132,9 @@ } }else if((mType==1)&&(canRXmsg.id==0x1da)){ //Motor Speed imotorRPM=((canRXmsg.data[4]<<8)|(canRXmsg.data[5])); + if(imotorRPM<0){ // take absolute value + imotorRPM=-imotorRPM; + } motorRPM+=imotorRPM; numSsamples++; }