diff --git a/src/counter.c b/src/counter.c index 640b2ea..f84d739 100644 --- a/src/counter.c +++ b/src/counter.c @@ -6,6 +6,7 @@ #include #include #include +#include #include "LS7366R.h" #include "ringbuffer.h" @@ -77,12 +78,14 @@ int main (void) { start(); uint8_t ledTick = 0; + struct timespec timestamp; while (1) { uint32_t period = ringbufferGet(); + clock_gettime(CLOCK_REALTIME, ×tamp); // add averaging and forming the struct here - logmsg(LOG_DEBUG, "Period: %lu", period); + logmsg(LOG_DEBUG, "s: %lu, ns: %lu, p: %lu", timestamp.tv_sec, timestamp.tv_nsec, period); ledTick++; if (ledTick == 50) {