From 740222d21607b0aa0cbbcd7a734c6378ed5f0ddf Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 2 Sep 2018 14:09:52 -0700 Subject: [PATCH] garmin: don't suppress the time sample at zero time The logic to suppress multiple redundant time samples in the garmin parser also always suppressed the time sample at 0:00, which was not intentional. Fix it by simply making the "suppress before" logic be "suppress until" instead. Signed-off-by: Linus Torvalds --- src/garmin_parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/garmin_parser.c b/src/garmin_parser.c index cdb2da8..b004c09 100644 --- a/src/garmin_parser.c +++ b/src/garmin_parser.c @@ -323,11 +323,11 @@ DECLARE_FIELD(ANY, timestamp, UINT32) data -= garmin->cache.time; // Did we already do this? - if (data <= garmin->record_data.time) + if (data < garmin->record_data.time) return; // Now we're ready to actually update the sample times - garmin->record_data.time = data; + garmin->record_data.time = data+1; sample.time = data; garmin->callback(DC_SAMPLE_TIME, sample, garmin->userdata); }