Skip to content

Commit 6018129

Browse files
committed
More numpy print updates to board_support/zest
1 parent d61ea6f commit 6018129

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

board_support/zest/ad7794.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ def configuration_register(self, chan):
9090
return val | 0x0000ff
9191

9292
def conv_volt(self, readout, chan):
93+
readout = int(readout)
9394
vref = 0.0
9495
if chan == 6 or self.REFSEL == 2:
9596
vref = 1.17

board_support/zest/zest_setup.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def hardware_reset(self, injector=False):
158158
if not self.pntest4():
159159
return False
160160
self.adc_twos_comp(twoscomp=True)
161-
print('test pattern %s' % self.set_test_mode('00000000'))
161+
print('test pattern %s' % [[int(item) for item in sublist] for sublist in self.set_test_mode('00000000') or []])
162162
if not self.amc7823_print(check_channels=[1, 2, 3, 4, 5, 6, 7]):
163163
return False
164164
return True
@@ -575,7 +575,7 @@ def find_best_idelay(self, ix, idelay_dict):
575575
return ix if False else self.top2idelay(lane, ix % 2)[0]
576576

577577
def adc_idelay1(self, dbg1=0):
578-
print('test pattern %s' % self.set_test_mode('00001100'))
578+
print('test pattern %s' % [[int(item) for item in sublist] for sublist in self.set_test_mode('00001100') or []])
579579
print('Type 1 (firmware) idelay scan')
580580
if True: # not needed after powerup, but will clear old values if re-scanning
581581
self.set_idelays(16*[0])
@@ -605,7 +605,7 @@ def adc_idelay1(self, dbg1=0):
605605
return all([2 == (x >> 5) for x in idelay_mirror]) # all channels scan success!
606606

607607
def adc_idelay0(self):
608-
print('test pattern %s' % self.set_test_mode('00001100'))
608+
print('test pattern %s' % [[int(item) for item in sublist] for sublist in self.set_test_mode('00001100') or []])
609609
print('Type 0 (software) idelay scan')
610610
print("idelay scan " + " ".join(self.chan_list))
611611
idelay_dict = {}
@@ -651,7 +651,7 @@ def adc_bufr_reset1(self, adc_values, name, adc, ic_reset, iserdes_reset):
651651
return success, adc_values
652652

653653
def adc_bufr_reset(self):
654-
print('test pattern %s' % self.set_test_mode('00001100'))
654+
print('test pattern %s' % [[int(item) for item in sublist] for sublist in self.set_test_mode('00001100') or []])
655655
adc_values = self.adc_reg(verbose=True)
656656
print('0x%x %s %s' % (adc_values[0], adc_values[0] != 0x4339, adc_values[0] != 0xa19c))
657657
s1, adc_values = self.adc_bufr_reset1(
@@ -661,7 +661,9 @@ def adc_bufr_reset(self):
661661
return s1 and s2
662662

663663
def adc_bitslip(self):
664-
print('bitslip: test pattern %s' % self.set_test_mode('00001100'))
664+
print('bitslip: test pattern %s' % [
665+
[int(item) for item in sublist]
666+
for sublist in self.set_test_mode('00001100') or []])
665667
index = 0
666668
bitslip = self.bitslip_calc()
667669
print(format(bitslip, '016b'))

projects/common/get_raw_adcs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def get_raw_adcs_run(dev, filewritepath='raw_adcs_', ext_trig=False, freq=7/33.0
6868
print("difference %6.2f" % diff1)
6969
if save_data is True:
7070
# ISO 8601 2016-06-02T16:06:14Z
71-
datetimestr = datetime.datetime.utcnow().isoformat()+"Z "+str(timestamp)
71+
datetimestr = datetime.datetime.now(datetime.UTC).isoformat().replace('+00:00', 'Z') + " " + str(timestamp)
7272
header = "\n".join([datetimestr, chan_txt])
7373

7474
data_dir = start_time.strftime(filewritepath + '%Y%m%d_%H%M%S')

0 commit comments

Comments
 (0)