aboutsummaryrefslogtreecommitdiff
path: root/pyecsca/sca/scope/picoscope_alt.py
diff options
context:
space:
mode:
authorJ08nY2020-03-03 22:32:13 +0100
committerJ08nY2020-03-03 22:32:13 +0100
commitdeca0e3d89ff4483dd6b6b4ad99b3400145bee5b (patch)
treebfe240b4fa6092e09c9abdc25243b78cb7f97e22 /pyecsca/sca/scope/picoscope_alt.py
parent9ed79b918009580a04649c7acdce63247d2314ed (diff)
downloadpyecsca-deca0e3d89ff4483dd6b6b4ad99b3400145bee5b.tar.gz
pyecsca-deca0e3d89ff4483dd6b6b4ad99b3400145bee5b.tar.zst
pyecsca-deca0e3d89ff4483dd6b6b4ad99b3400145bee5b.zip
Diffstat (limited to 'pyecsca/sca/scope/picoscope_alt.py')
-rw-r--r--pyecsca/sca/scope/picoscope_alt.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/pyecsca/sca/scope/picoscope_alt.py b/pyecsca/sca/scope/picoscope_alt.py
index c5f97af..52cbf2e 100644
--- a/pyecsca/sca/scope/picoscope_alt.py
+++ b/pyecsca/sca/scope/picoscope_alt.py
@@ -43,13 +43,15 @@ class PicoScopeAlt(Scope): # pragma: no cover
def arm(self) -> None:
self.ps.runBlock()
- def capture(self, channel: str, timeout: Optional[int] = None) -> Optional[np.ndarray]:
+ def capture(self, timeout: Optional[int] = None) -> bool:
start = time_ns()
while not self.ps.isReady():
sleep(0.001)
if timeout is not None and (time_ns() - start) / 1e6 >= timeout:
- return None
+ return False
+ return True
+ def retrieve(self, channel: str) -> Optional[np.ndarray]:
return self.ps.getDataV(channel)
def stop(self) -> None: