diff options
author | Stanley Huang <stanleyhuangyc@gmail.com> | 2014-06-05 11:01:20 +1000 |
---|---|---|
committer | Stanley Huang <stanleyhuangyc@gmail.com> | 2014-06-05 11:01:20 +1000 |
commit | 9fd501b8f63ef4d8c484c1ad49478ca8d7bd593a (patch) | |
tree | 9d7424ff24672872f80f7d3debdcec46da18f0a2 /libraries/OBD/OBD.h | |
parent | 75bd1ad5a7d4132b09475b327f4b511e658cae0b (diff) | |
download | 2021-arduino-obd-9fd501b8f63ef4d8c484c1ad49478ca8d7bd593a.tar.gz 2021-arduino-obd-9fd501b8f63ef4d8c484c1ad49478ca8d7bd593a.tar.bz2 2021-arduino-obd-9fd501b8f63ef4d8c484c1ad49478ca8d7bd593a.zip |
Update OBD library for Arduino DUE
Diffstat (limited to 'libraries/OBD/OBD.h')
-rw-r--r-- | libraries/OBD/OBD.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libraries/OBD/OBD.h b/libraries/OBD/OBD.h index f5cf78e..3086b4f 100644 --- a/libraries/OBD/OBD.h +++ b/libraries/OBD/OBD.h @@ -7,16 +7,19 @@ #include <Arduino.h>
+#define OBD_MODEL_UART 0
+#define OBD_MODEL_I2C 1
+
#define OBD_TIMEOUT_SHORT 2000 /* ms */
#define OBD_TIMEOUT_LONG 7000 /* ms */
#define OBD_SERIAL_BAUDRATE 38400
#define OBD_RECV_BUF_SIZE 128
#ifndef OBDUART
-#if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega644P__)
-#define OBDUART Serial1
-#else
+#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168P__)
#define OBDUART Serial
+#else
+#define OBDUART Serial1
#endif
#endif
@@ -51,8 +54,8 @@ #define OBD_CONNECTING 1
#define OBD_CONNECTED 2
-unsigned int hex2uint16(const char *p);
-unsigned char hex2uint8(const char *p);
+uint16_t hex2uint16(const char *p);
+uint8_t hex2uint8(const char *p);
class COBD
{
|