From a2265e946d9ddbe560831399b4d9157131717a9e Mon Sep 17 00:00:00 2001 From: Jack H Date: Thu, 2 Jun 2016 00:25:45 +0200 Subject: [PATCH] Swap synth A & B lock bits get_phase_lock(synth) had the bit masks for synths A & B backwards -- get_phase_lock(SYNTH_A) would return the lock status of SYNTH_B and vice versa. This commit brings the code in line with the valon register spec. --- src/valon_synth.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/valon_synth.py b/src/valon_synth.py index 04822bf..84b8e8d 100644 --- a/src/valon_synth.py +++ b/src/valon_synth.py @@ -410,7 +410,10 @@ def get_phase_lock(self, synth): checksum = self.conn.read(1) self.conn.close() #_verify_checksum(data, checksum) - mask = (synth << 1) or 0x20 + if synth == SYNTH_A: + mask = 1 << 4 + else: + mask = 1 << 5 lock = struct.unpack('>B', data)[0] & mask return lock > 0