Commit a19d80c9 authored by root's avatar root Committed by Alessandro Rubini

NewLogger: flush invalid timestamps from first 2s

parent 5d210737
......@@ -374,9 +374,17 @@ void handle_readout(struct board_def *bdef)
{
int64_t t_ps;
struct fdelay_time t;
static time_t start;
int done;
while(fdelay_read(bdef->b, &t, 1, O_NONBLOCK) == 1)
{
if (!start) start = time(NULL);
if (!done) {
done = time(NULL) - start > 1;
if (!done) continue;
}
t_ps = (t.coarse * 8000LL) + ((t.frac * 8000LL) >> 12);
printf("seq %5i: time %lli s, %lli.%03lli ns [%x]\n", t.seq_id, t.utc, t_ps / 1000LL, t_ps % 1000LL, t.coarse);
log_write(&t, bdef->hw_index);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment