Skip to content

Commit

Permalink
Update verify_hardware.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bimac committed Aug 21, 2023
1 parent 3cb2db0 commit 960f408
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/hardware_validation/verify_hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,13 @@ def log_fun(msg_type: str = 'info', msg: str = '', last: bool = False):

dev = usb.core.find(idVendor=0x04D8, idProduct=0xEE6A)
if not dev:
log_fun('fail', Cannot find Harp Sound Card')
log_fun('fail', 'Cannot find Harp Sound Card')
else:
log_fun('pass', 'found USB device {:04X}:{:04X} (Harp Sound Card)'.format(dev.idVendor, dev.idProduct))

dev = next((p for p in serial.tools.list_ports.comports() if (p.vid == 1027 and p.pid == 24577)), None)
if not dev:
log_fun('fail', cannot find Harp Sound Card\'s Serial port - did you plug in *both* USB ports of the device?')
log_fun('fail', 'cannot find Harp Sound Card\'s Serial port - did you plug in *both* USB ports of the device?')
else:
log_fun('pass', 'found USB device {:04X}:{:04X} (FT232 UART), serial port: {}'.format(dev.vid, dev.pid, dev.name))

Expand Down Expand Up @@ -243,9 +243,9 @@ def log_fun(msg_type: str = 'info', msg: str = '', last: bool = False):
triggers = [i.host_timestamp for i in bpod.session.current_trial.events_occurrences if i.content == 'Port1In']
np.mean(np.diff(triggers))
if len(triggers) == 0:
log_fun('fail', 'could not read camera trigger.', last=True)
log_fun('fail', 'could not read camera trigger', last=True)
else:
log_fun('pass', 'successfully read camera trigger.')
log_fun('pass', 'successfully read camera trigger')
log_fun('info', f'average frame-rate: {np.mean(np.diff(triggers)) * 1E3:.3f} Hz', last=True)

bpod.close()
Expand Down

0 comments on commit 960f408

Please sign in to comment.