From adf3df2bb556bdb1ed03625ada6c2b1211fa995f Mon Sep 17 00:00:00 2001 From: Brad Bondurant Date: Wed, 22 May 2019 17:23:06 +0100 Subject: [PATCH] suservo coredevice driver: mask ftw to avoid erroneous sign extension --- artiq/coredevice/suservo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artiq/coredevice/suservo.py b/artiq/coredevice/suservo.py index f1ce004e5..2011bba2d 100644 --- a/artiq/coredevice/suservo.py +++ b/artiq/coredevice/suservo.py @@ -284,7 +284,7 @@ class Channel: """ base = (self.servo_channel << 8) | (profile << 3) self.servo.write(base + 0, ftw >> 16) - self.servo.write(base + 6, ftw) + self.servo.write(base + 6, (ftw & 0xffff)) self.servo.write(base + 4, offs) self.servo.write(base + 2, pow_)