software/dump/sigrok: fix write_data, now working :)
This commit is contained in:
parent
3d35e72a48
commit
2048acf80e
|
@ -40,7 +40,6 @@ samplerate = {} KHz
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
def write_data(self):
|
def write_data(self):
|
||||||
# XXX are probes limited to 1 bit?
|
|
||||||
data_bits = math.ceil(len(self.variables)/8)*8
|
data_bits = math.ceil(len(self.variables)/8)*8
|
||||||
data_len = 0
|
data_len = 0
|
||||||
for variable in self.variables:
|
for variable in self.variables:
|
||||||
|
@ -48,10 +47,10 @@ samplerate = {} KHz
|
||||||
datas = []
|
datas = []
|
||||||
for i in range(data_len):
|
for i in range(data_len):
|
||||||
data = 0
|
data = 0
|
||||||
for j, var in enumerate(reversed(self.variables)):
|
for j, variable in enumerate(reversed(self.variables)):
|
||||||
data = data << 1
|
data = data << 1
|
||||||
try:
|
try:
|
||||||
data |= variable.values[i] % 2
|
data |= variable.values[i] & 0x1 # 1 bit probes
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
datas.append(data)
|
datas.append(data)
|
||||||
|
|
Loading…
Reference in New Issue