]> sigrok.org Git - pulseview.git/blobdiff - pv/data/logicsnapshot.cpp
Add an extra sample to the logic edges so that the end sample is visible
[pulseview.git] / pv / data / logicsnapshot.cpp
index 177c66279bf0a1fa079f82b3da0d22a8f537ee86..f203e8b674fb57fb37c556edc593c5e1798873a8 100644 (file)
@@ -366,8 +366,10 @@ void LogicSnapshot::get_subsampled_edges(
        }
 
        // Add the final state
-       edges.push_back(pair<int64_t, bool>(end,
-               get_sample(end) & sig_mask));
+       const bool end_sample = get_sample(end) & sig_mask;
+       if (last_sample != end_sample)
+               edges.push_back(pair<int64_t, bool>(end, end_sample));
+       edges.push_back(pair<int64_t, bool>(end + 1, end_sample));
 }
 
 uint64_t LogicSnapshot::get_subsample(int level, uint64_t offset) const