From 9fd501b8f63ef4d8c484c1ad49478ca8d7bd593a Mon Sep 17 00:00:00 2001
From: Stanley Huang <stanleyhuangyc@gmail.com>
Date: Thu, 5 Jun 2014 11:01:20 +1000
Subject: Update OBD library for Arduino DUE

---
 libraries/OBD/OBD.h | 13 ++++++++-----
 1 file 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
 {
-- 
cgit v1.2.3