mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-18 16:06:30 +08:00
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:
|
||||
"""Return the 16-bit phase offset word corresponding to the given phase
|
||||
in turns."""
|
||||
return int32(round(turns*0x10000)) & 0xffff
|
||||
return int32(round(turns*0x10000)) & int32(0xffff)
|
||||
|
||||
@portable(flags={"fast-math"})
|
||||
def pow_to_turns(self, pow_):
|
||||
|
Loading…
Reference in New Issue
Block a user