summaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
authorStanley Huang <stanleyhuangyc@gmail.com>2013-09-06 12:11:57 +0800
committerStanley Huang <stanleyhuangyc@gmail.com>2013-09-06 12:11:57 +0800
commitadd8ebb1deeedd236af741f9455164c10f88f61e (patch)
tree5d78d82187b8c8d51e6a85adb8667c42ba9bab2a /libraries
parent1e98599609d92ce1e209ccd9d872a5a3f1f2158d (diff)
download2021-arduino-obd-add8ebb1deeedd236af741f9455164c10f88f61e.tar.gz
2021-arduino-obd-add8ebb1deeedd236af741f9455164c10f88f61e.tar.bz2
2021-arduino-obd-add8ebb1deeedd236af741f9455164c10f88f61e.zip
fix RPM value overflow issue
Diffstat (limited to 'libraries')
-rw-r--r--libraries/OBD/OBD.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/libraries/OBD/OBD.h b/libraries/OBD/OBD.h
index cd67192..b13056d 100644
--- a/libraries/OBD/OBD.h
+++ b/libraries/OBD/OBD.h
@@ -12,7 +12,7 @@
#define OBD_RECV_BUF_SIZE 64
#ifndef OBDUART
-#if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__)
+#if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega644P__)
#define OBDUART Serial1
#else
#define OBDUART Serial
@@ -55,6 +55,8 @@ public:
bool getResponseParsed(byte& pid, int& result);
byte dataMode;
byte errors;
+ byte pidmap[4 * 4];
+ byte vin[17];
//char recvBuf[OBD_RECV_BUF_SIZE];
protected:
static int normalizeData(byte pid, char* data);
@@ -62,7 +64,7 @@ protected:
{
return (int)hex2uint8(data) * 100 / 255;
}
- static int getLargeValue(char* data)
+ static unsigned int getLargeValue(char* data)
{
return hex2uint16(data);
}
@@ -80,6 +82,4 @@ protected:
virtual void write(const char c);
virtual void initIdleLoop() {}
virtual void dataIdleLoop() {}
- byte pidmap[4 * 4];
- byte vin[17];
};