From 2399bbe45bfa5a330bef2d4bb63de3af25fe4ad9 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Wed, 4 Jan 2012 03:46:06 +0100 Subject: finally enable NVALs, seems that they work with 0.8.2 --- metawatch/metawatch.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/metawatch/metawatch.cpp b/metawatch/metawatch.cpp index a5836ad..a9718ec 100644 --- a/metawatch/metawatch.cpp +++ b/metawatch/metawatch.cpp @@ -554,7 +554,7 @@ void MetaWatch::handleNvalOperationMessage(const Message& msg) uint id = ((msg.data[1] & 0xFF) << 8) | (msg.data[0] & 0xFF); NvalValue value = static_cast(id); - qDebug() << "nval operation response for value" << value; + qDebug() << "nval operation response for value" << hex << value; switch (msg.options) { case 0: // Success @@ -579,9 +579,11 @@ void MetaWatch::handleNvalOperationMessage(const Message& msg) // Check if there's a pending write for this nval. if (_nvals.contains(value)) { int new_data = _nvals[value]; - qDebug() << "nval" << value << "currently =" << data << "is pending write to =" << new_data; + qDebug() << "nval" << hex << value << "currently =" << dec << data << "is pending write to =" << new_data; if (new_data != data) { realNvalWrite(value, _nvals[value]); + } else { + qDebug() << " not rewriting it"; } _nvals.remove(value); } @@ -666,10 +668,9 @@ void MetaWatch::socketConnected() _currentMode = IdleMode; _paintMode = IdleMode; -#if FIRMWARE_NOT_BUGGY // Configure the watch according to user preferences - //nvalWrite(TimeFormat, _24hMode ? 1 : 0); -#endif + nvalWrite(TimeFormat, _24hMode ? 1 : 0); + nvalWrite(DateFormat, _dayMonthOrder ? 1 : 0); // Sync watch date & time setDateTime(QDateTime::currentDateTime()); @@ -761,7 +762,7 @@ void MetaWatch::realNvalWrite(NvalValue value, int data) uint id = static_cast(value); Message msg(NvalOperation, QByteArray(3 + size, 0), 2); - qDebug() << "nval" << value << "will be written with" << data; + qDebug() << "nval" << hex << value << "will be written with" << dec << data; msg.data[0] = id & 0xFF; msg.data[1] = id >> 8; -- cgit v1.2.3