millis
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user