This commit is contained in:
2021-03-04 15:26:39 +01:00
parent 49b0974022
commit 0ad3cba113

View File

@ -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, &timestamp);
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) {