From 403bac94a58e6da03d40902024366ede4ef9cbce Mon Sep 17 00:00:00 2001 From: Jonathan Hogg Date: Wed, 26 Jul 2017 18:23:54 +0100 Subject: [PATCH] Tidy up some bits: naming; best practice on waveform generation command window transaction usage; analog channel enable mask for capture --- scope.py | 13 ++++++------- vm.py | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/scope.py b/scope.py index c3bf835..eddd783 100755 --- a/scope.py +++ b/scope.py @@ -101,11 +101,7 @@ class Scope(vm.VirtualMachine): logic_channels.remove(7) if 'B' in analog_channels and 6 in logic_channels: logic_channels.remove(6) - analog_enable = 0 - if 'A' in channels: - analog_enable |= 1 - if 'B' in channels: - analog_enable |= 2 + analog_enable = sum(1<<(ord(channel)-ord('A')) for channel in analog_channels) logic_enable = sum(1<