summaryrefslogtreecommitdiff
path: root/lib/loader/energytrace.py
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2021-03-23 15:31:15 +0100
committerDaniel Friesel <daniel.friesel@uos.de>2021-03-23 15:31:15 +0100
commit63a8b93b0fedac53b5ed4acf07aa77d7e07bd7e5 (patch)
tree3b3009c565776b4405817f9ce9d9a6ef8a5231a4 /lib/loader/energytrace.py
parent038958df19613ab2750d394be04220c6f4576369 (diff)
port ET++ drift compensation to drift.py
Diffstat (limited to 'lib/loader/energytrace.py')
-rw-r--r--lib/loader/energytrace.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/loader/energytrace.py b/lib/loader/energytrace.py
index 0ffaac7..0386b99 100644
--- a/lib/loader/energytrace.py
+++ b/lib/loader/energytrace.py
@@ -680,6 +680,15 @@ class EnergyTraceWithLogicAnalyzer(ExternalTimerSync):
self.sync_data = self.sync_data[:x]
break
+ # Each synchronization pulse consists of two LogicAnalyzer pulses, so four
+ # entries in time_stamp_data (rising edge, falling edge, rising edge, falling edge).
+ # If we have less then twelve entries, we observed no transitions and don't even have
+ # valid synchronization data. In this case, we bail out.
+ if len(self.sync_data) < 12:
+ raise RuntimeError(
+ f"LogicAnalyzer sync data has length {len(time_stamp_data)}, expected >= 12"
+ )
+
self.online_timestamps = self.sync_data[2:3] + self.sync_data[4:-7]
self.online_timestamps = (
np.array(self.online_timestamps) - self.online_timestamps[0]