From 864fc10d3aefca8711275e8e8b366584283f1774 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Thu, 19 Dec 2013 10:39:42 -0800 Subject: [PATCH] debug cleanup and change to Particle::update() to handle clock skew slightly better --- libraries/particles/src/Particle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/particles/src/Particle.cpp b/libraries/particles/src/Particle.cpp index e4afcd90e7..83d313c95f 100644 --- a/libraries/particles/src/Particle.cpp +++ b/libraries/particles/src/Particle.cpp @@ -424,7 +424,7 @@ bool Particle::encodeParticleEditMessageDetails(PACKET_TYPE command, int count, void Particle::update() { uint64_t now = usecTimestampNow(); - uint64_t elapsed = now - _lastUpdated; + int elapsed = now - _lastUpdated; // making this signed slightly improves clock skew behavior float timeElapsed = (float)((float)elapsed/(float)USECS_PER_SECOND); @@ -438,7 +438,7 @@ void Particle::update() { bool shouldDie = !isInHand && !isStillMoving && isReallyOld; setShouldDie(shouldDie); - bool wantDebug = false; + const bool wantDebug = false; if (wantDebug) { printf("Particle::update()... timeElapsed: %f lifeTime:%f editedAgo:%f " "isInHand:%s isStillMoveing:%s isReallyOld:%s shouldDie:%s\n",