STM32: New clock sync algorithm

This commit is contained in:
Pavel Kirienko
2014-04-26 17:48:42 +04:00
parent 430776469f
commit 803222dcc3
3 changed files with 150 additions and 108 deletions
@@ -181,10 +181,10 @@ int main()
}
const uavcan::UtcTime utc = uavcan_stm32::clock::getUtc();
lowsyslog("UTC %lu sec Absolute correction: %li usec Speed correction: %liPPM Jumps: %lu\n",
lowsyslog("UTC %lu sec Rate corr: %fPPM Jumps: %lu Locked: %i\n",
static_cast<unsigned long>(utc.toMSec() / 1000),
static_cast<long>(uavcan_stm32::clock::getPrevUtcAdjustment().toUSec()),
uavcan_stm32::clock::getUtcSpeedCorrectionPPM(),
uavcan_stm32::clock::getUtcAjdustmentJumpCount());
uavcan_stm32::clock::getUtcRateCorrectionPPM(),
uavcan_stm32::clock::getUtcJumpCount(),
int(uavcan_stm32::clock::isUtcLocked()));
}
}