Skip to content

Commit 6a5d429

Browse files
committed
clean up tProc v2 internal/external code a bit
1 parent 65b504a commit 6a5d429

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

qick_lib/qick/drivers/tproc.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -507,15 +507,8 @@ def time_update(self):
507507
self.logger.info('TIME_UPDATE')
508508
self.tproc_ctrl = 2
509509
def start(self):
510-
"""
511-
If tProc is configured for internal start, start the tProc.
512-
If configured for external start, do nothing.
513-
"""
514-
if self.tproc_cfg & (1 << 10):
515-
pass
516-
else:
517-
self.logger.info('PROCESSOR_START')
518-
self.tproc_ctrl = 4
510+
self.logger.info('PROCESSOR_START')
511+
self.tproc_ctrl = 4
519512
def stop(self):
520513
self.logger.info('PROCESSOR_STOP')
521514
self.tproc_ctrl = 8
@@ -568,6 +561,11 @@ def start_src(self, src):
568561
self.tproc_cfg |= (1 << 10)
569562
else:
570563
raise RuntimeError("start_src must be internal or external, got %s"%(src))
564+
def get_start_src(self):
565+
if self.tproc_cfg & (1 << 10):
566+
return 'external'
567+
else:
568+
return 'internal'
571569

572570
def __str__(self):
573571
lines = []

qick_lib/qick/qick.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,10 +1446,13 @@ def start_tproc(self):
14461446
"""
14471447
Start the tProc.
14481448
"""
1449-
if self.TPROC_VERSION == 2:
1449+
if self.TPROC_VERSION == 1:
1450+
self.tproc.start()
1451+
elif self.TPROC_VERSION == 2:
14501452
# reset all registers (importantly, this zeroes the counters to distinguish "program waiting for external start" from "program complete")
14511453
self.tproc.reset()
1452-
self.tproc.start()
1454+
if self.tproc.get_start_src() == 'internal':
1455+
self.tproc.start()
14531456

14541457
def stop_tproc(self, lazy=False):
14551458
"""

0 commit comments

Comments
 (0)