From 2d4eb1de72d1b5395d292188756441e34839a950 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Wed, 20 Aug 2014 01:44:21 +1000 Subject: [PATCH] Oximetry fix #372351 --- sleepyhead/SleepLib/loader_plugins/cms50f37_loader.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sleepyhead/SleepLib/loader_plugins/cms50f37_loader.cpp b/sleepyhead/SleepLib/loader_plugins/cms50f37_loader.cpp index 27dbaaa2..0c69e035 100644 --- a/sleepyhead/SleepLib/loader_plugins/cms50f37_loader.cpp +++ b/sleepyhead/SleepLib/loader_plugins/cms50f37_loader.cpp @@ -319,7 +319,6 @@ void CMS50F37Loader::processBytes(QByteArray bytes) int year, month, day; - quint8 msb; quint8 pulse; do { @@ -327,7 +326,7 @@ void CMS50F37Loader::processBytes(QByteArray bytes) len = lengths[res & 0x1f]; - if (len > size) + if (len >= size) break; if (len == 0) { @@ -440,8 +439,9 @@ void CMS50F37Loader::processBytes(QByteArray bytes) cb_reset = 1; - resetTimer.singleShot(2000,this,SLOT(resetImportTimeout())); } + killTimers(); + resetTimer.singleShot(2000,this,SLOT(resetImportTimeout())); break; default: @@ -598,6 +598,7 @@ void CMS50F37Loader::requestData() void CMS50F37Loader::killTimers() { if (resetTimer.isActive()) resetTimer.stop(); + if (startTimer.isActive()) startTimer.stop(); } void CMS50F37Loader::startImportTimeout()