-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug #309 #310
base: master
Are you sure you want to change the base?
Fix bug #309 #310
Changes from 2 commits
c1f9acf
ea9a2ca
4ba6826
3b7d395
c2320b2
6c665de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -955,7 +955,7 @@ def registerReadback(self): | |
@inlineCallbacks | ||
def func(): | ||
# build registry packet | ||
regs = self.regRun(self.RUN_MODE_REGISTER_READBACK, 0) # 0 reps? | ||
regs = self.regRun(self.RUN_MODE_REGISTER_READBACK, {}, 0) | ||
|
||
p = self.makePacket("registerReadback") | ||
p.write(regs.tostring()) | ||
|
@@ -1052,7 +1052,8 @@ def processReadback(resp): | |
a = np.fromstring(resp, dtype='<u1') | ||
return { | ||
'build': a[0], | ||
'noPllLatch': a[1]&1 == 1, | ||
'noPllLatch': bool(a[1] & 1), | ||
'dClkBits': a[1] >> 1 & 0b1111, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would really like it if @jrainbo could verify this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can never remember the preference of operators. I'd prefer to be explicit: 'dClkBits': (a[1] >> 1) & 0b1111, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
'executionCounter': int(a[2]) + int(a[3] << 8), | ||
'nPackets': a[4], | ||
'badPackets': a[5] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe use named params here to help the reader:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming of the params is a good idea here but this should be done in a consistent way across the module. Should I add a commit that adds param names
info
andreps
to allself.regRun()
calls in the module?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'd be a good idea to add param names throughout the module. Note that the param names for build1 and build7 are different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, this should be reviewed.