forked from M-Labs/artiq
ad9910: fix `turns_to_pow` return-type on host
When run on the host, the `turns_to_pow` retrun-type is numpy.int64. Sensibly, the compiler does not attempt to convert `numpy.int64` to `int32`. Signed-off-by: Marius Weber <marius.weber@physics.ox.ac.uk>
This commit is contained in:
parent
9ff47bacab
commit
3e38833020
|
@ -596,7 +596,7 @@ class AD9910:
|
||||||
def turns_to_pow(self, turns) -> TInt32:
|
def turns_to_pow(self, turns) -> TInt32:
|
||||||
"""Return the 16-bit phase offset word corresponding to the given phase
|
"""Return the 16-bit phase offset word corresponding to the given phase
|
||||||
in turns."""
|
in turns."""
|
||||||
return int32(round(turns*0x10000)) & 0xffff
|
return int32(round(turns*0x10000)) & int32(0xffff)
|
||||||
|
|
||||||
@portable(flags={"fast-math"})
|
@portable(flags={"fast-math"})
|
||||||
def pow_to_turns(self, pow_):
|
def pow_to_turns(self, pow_):
|
||||||
|
|
Loading…
Reference in New Issue