# HG changeset patch # User paul # Date 2016-02-09 14:26:32 # Node ID ae46bf907e3bb6a8adf028a612f093fad9622797 # Parent 98f943ec5c628aae4c65684022e4ed79f82a7b22 snapshot resynchronisation updated following #612 task diff --git a/src/wf_handler.c b/src/wf_handler.c --- a/src/wf_handler.c +++ b/src/wf_handler.c @@ -902,8 +902,6 @@ double computeCorrection( unsigned char deltaNext_ms = ((double) deltaNextTick) / 65536. * 1000.; PRINTF2(" delta previous = %.3f ms, delta next = %.2f ms\n", deltaPrevious_ms, deltaNext_ms); -// PRINTF2(" delta previous = %llu fine time ticks, delta next = %llu fine time ticks\n", -// deltaPreviousTick, deltaNextTick); // which tick is the closest? if (deltaPreviousTick > deltaNextTick) @@ -926,9 +924,9 @@ void applyCorrection( double correction { int correctionInt; - if (correction>=0.) + if (correction >= 0.) { - if ( correction > 0.5 ) + if ( (1. > correction) && (correction > 0.5) ) { correctionInt = 1; } @@ -939,7 +937,7 @@ void applyCorrection( double correction } else { - if ( correction < -0.5) + if ( (correction < -1.) && (correction < -0.5) ) { correctionInt = -1; }