From f1ee6f1d3f900ec094f7009a539b0b28ef643bb1 Mon Sep 17 00:00:00 2001 From: Stanley Huang Date: Tue, 20 Oct 2015 22:29:56 +1100 Subject: Workaround for initialization timeout issue --- libraries/OBD/OBD.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libraries/OBD/OBD.cpp b/libraries/OBD/OBD.cpp index 2689498..c571be9 100644 --- a/libraries/OBD/OBD.cpp +++ b/libraries/OBD/OBD.cpp @@ -348,8 +348,13 @@ bool COBD::init(OBD_PROTOCOLS protocol) #endif write(initcmd[i]); if (receive(buffer, OBD_TIMEOUT_LONG) == 0) { - m_state = OBD_DISCONNECTED; - return false; + if (i == 0) { + // workaround for longer initialization time + delay(2000); + } else { + m_state = OBD_DISCONNECTED; + return false; + } } delay(50); } -- cgit v1.2.3