From 60947bc9dc59f0291b5360e2bf72a29ab0f0b626 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Wed, 16 Apr 2014 12:35:50 +0400 Subject: [PATCH] LPC11C24: Removed redundant comments --- libuavcan_drivers/lpc11c24/driver/src/clock.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/libuavcan_drivers/lpc11c24/driver/src/clock.cpp b/libuavcan_drivers/lpc11c24/driver/src/clock.cpp index 03460d8322..2f2ed414d3 100644 --- a/libuavcan_drivers/lpc11c24/driver/src/clock.cpp +++ b/libuavcan_drivers/lpc11c24/driver/src/clock.cpp @@ -59,26 +59,15 @@ void init() static uint64_t sampleFromCriticalSection(const volatile uint64_t* const value) { const uint32_t reload = SysTick->LOAD + 1; // SysTick counts downwards, hence the value subtracted from reload + volatile uint64_t time = *value; volatile uint32_t cycles = reload - SysTick->VAL; if ((SCB->ICSR & SCB_ICSR_PENDSTSET_Msk) == SCB_ICSR_PENDSTSET_Msk) { - /* - * The timer has overflowed either before or after CNT sample was obtained. - * We need to sample it once more to be sure that the obtained - * counter value has wrapped over zero. - */ cycles = reload - SysTick->VAL; - /* - * The timer interrupt was set, but not handled yet. - * Thus we need to adjust the tick counter manually. - */ time += USecPerOverflow; } - /* - * Raw counter value must be converted from core cycles to microseconds - */ return time + (cycles / (SystemCoreClock / 1000000)); }