From b88e9351dcf242709d7dff56d45da10cdf376f46 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Fri, 22 Aug 2014 02:53:07 +1000 Subject: [PATCH] CMS50i PI test6 --- sleepyhead/Graphs/gSummaryChart.cpp | 2 +- sleepyhead/SleepLib/loader_plugins/cms50f37_loader.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sleepyhead/Graphs/gSummaryChart.cpp b/sleepyhead/Graphs/gSummaryChart.cpp index 36afb29e..fbd88b1e 100644 --- a/sleepyhead/Graphs/gSummaryChart.cpp +++ b/sleepyhead/Graphs/gSummaryChart.cpp @@ -600,7 +600,7 @@ void SummaryChart::paint(QPainter &painter, gGraph &w, const QRegion ®ion) if (d != m_values.end()) { day = m_days[zd]; - bool summary_only = day->summaryOnly(); + bool summary_only = day && day->summaryOnly(); if (!m_hours.contains(zd)) { diff --git a/sleepyhead/SleepLib/loader_plugins/cms50f37_loader.cpp b/sleepyhead/SleepLib/loader_plugins/cms50f37_loader.cpp index 162c967e..a10669ac 100644 --- a/sleepyhead/SleepLib/loader_plugins/cms50f37_loader.cpp +++ b/sleepyhead/SleepLib/loader_plugins/cms50f37_loader.cpp @@ -460,7 +460,7 @@ void CMS50F37Loader::processBytes(QByteArray bytes) quint8 msb = buf[1]; for (int i = 2; i < len-1; i++, msb >>= 1) { - buf[i] = (buf[i] & 0x7f) | (msb & 0x01) ? 0x80 : 0; + buf[i] = (buf[i] & 0x7f) | ((msb & 0x01) ? 0x80 : 0); } quint16 pi = buf[4] | buf[5] << 8;