From 3e3883302001eaee5c46ff33726ef16b25537fb7 Mon Sep 17 00:00:00 2001 From: Marius Weber Date: Tue, 29 Sep 2020 01:24:39 +0100 Subject: [PATCH] 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 --- artiq/coredevice/ad9910.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artiq/coredevice/ad9910.py b/artiq/coredevice/ad9910.py index fbe6bca41..c1e828cf7 100644 --- a/artiq/coredevice/ad9910.py +++ b/artiq/coredevice/ad9910.py @@ -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_):