diff --git a/src/counter.c b/src/counter.c index f84d739..aea59e0 100644 --- a/src/counter.c +++ b/src/counter.c @@ -79,13 +79,18 @@ int main (void) { uint8_t ledTick = 0; struct timespec timestamp; + uint32_t last_seconds = 0; + uint32_t last_milliseconds = 0; + while (1) { uint32_t period = ringbufferGet(); clock_gettime(CLOCK_REALTIME, ×tamp); + uint32_t current_seconds = timestamp.tv_sec; + uint32_t current_milliseconds = timestamp.tv_nsec / 1e6; // add averaging and forming the struct here - logmsg(LOG_DEBUG, "s: %lu, ns: %lu, p: %lu", timestamp.tv_sec, timestamp.tv_nsec, period); + logmsg(LOG_DEBUG, "s: %lu, ns: %lu, p: %lu", current_seconds, current_milliseconds, period); ledTick++; if (ledTick == 50) {