forked from M-Labs/artiq
dds: fix phase computation. Closes #79.
This commit is contained in:
parent
f07c7e9c6f
commit
0fe0f4d433
@ -131,11 +131,11 @@ class _DDSGeneric:
|
|||||||
"""
|
"""
|
||||||
if phase_mode == _PHASE_MODE_DEFAULT:
|
if phase_mode == _PHASE_MODE_DEFAULT:
|
||||||
phase_mode = self.phase_mode
|
phase_mode = self.phase_mode
|
||||||
syscall("dds_set", now_mu(), self.channel,
|
syscall("dds_set", now_mu(), self.channel, frequency,
|
||||||
frequency, round(phase*2**self.pow_width), phase_mode)
|
phase, phase_mode)
|
||||||
|
|
||||||
@kernel
|
@kernel
|
||||||
def set(self, frequency, phase=0, phase_mode=_PHASE_MODE_DEFAULT):
|
def set(self, frequency, phase=0.0, phase_mode=_PHASE_MODE_DEFAULT):
|
||||||
"""Like ``set_mu``, but uses Hz and turns."""
|
"""Like ``set_mu``, but uses Hz and turns."""
|
||||||
self.set_mu(self.frequency_to_ftw(frequency),
|
self.set_mu(self.frequency_to_ftw(frequency),
|
||||||
self.turns_to_pow(phase), phase_mode)
|
self.turns_to_pow(phase), phase_mode)
|
||||||
|
Loading…
Reference in New Issue
Block a user