From ed94d720e14dca39665cd7c9048d22920ca3e795 Mon Sep 17 00:00:00 2001
From: su530201 <olivier.kaufmann@umons.ac.be>
Date: Wed, 14 Jun 2023 12:42:47 +0200
Subject: [PATCH] Adds joins in vab_pulses

---
 dev/test_2_mux_2024.py   | 7 ++++---
 ohmpi/hardware_system.py | 2 ++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/dev/test_2_mux_2024.py b/dev/test_2_mux_2024.py
index 036fa50e..53271b71 100644
--- a/dev/test_2_mux_2024.py
+++ b/dev/test_2_mux_2024.py
@@ -43,8 +43,9 @@ if within_ohmpi:
     from ohmpi.ohmpi import OhmPi
     print('Starting test of mux within OhmPi.')
     k = OhmPi()
-    k.switch_mux_on([1, 4, 2, 3])
-    time.sleep(1.)
     k.reset_mux()
-
+    k._hw.switch_mux([1, 4, 2, 3], state='on')
+    k._hw.vab_square_wave(12,1)
+    k._hw.switch_mux([1, 4, 2, 3], state='off')
+    k._hw._plot_readings()
 change_config('../configs/config_default.py', verbose=False)
\ No newline at end of file
diff --git a/ohmpi/hardware_system.py b/ohmpi/hardware_system.py
index 8c699b99..05d035dd 100644
--- a/ohmpi/hardware_system.py
+++ b/ohmpi/hardware_system.py
@@ -292,6 +292,8 @@ class OhmPiHardware:
         injection = Thread(target=self._inject, kwargs={'inj_time': 0.2, 'polarity': polarity})
         gain_auto.start()
         injection.start()
+        gain_auto.join()
+        injection.join()
         self._vab_pulses(vab, lengths, sampling_rate, append=append)
 
     def _vab_pulse(self, vab, length, sampling_rate=None, polarity=1, append=False):
-- 
GitLab