This commit is contained in:
2021-03-04 15:02:44 +01:00
parent bb3b626db1
commit 49b0974022

View File

@ -6,6 +6,7 @@
#include <unistd.h> #include <unistd.h>
#include <libconfig.h> #include <libconfig.h>
#include <math.h> #include <math.h>
#include <time.h>
#include "LS7366R.h" #include "LS7366R.h"
#include "ringbuffer.h" #include "ringbuffer.h"
@ -77,12 +78,14 @@ int main (void) {
start(); start();
uint8_t ledTick = 0; uint8_t ledTick = 0;
struct timespec timestamp;
while (1) { while (1) {
uint32_t period = ringbufferGet(); uint32_t period = ringbufferGet();
clock_gettime(CLOCK_REALTIME, &timestamp);
// add averaging and forming the struct here // 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++; ledTick++;
if (ledTick == 50) { if (ledTick == 50) {