From 0ebff04ad74d35455c2fb1e8b3d65cabd89f4efa Mon Sep 17 00:00:00 2001 From: hartytp Date: Thu, 7 Feb 2019 15:43:18 +0000 Subject: [PATCH] SUServo: apply bit masks to servo memory writes to prevent overflows Signed-off-by: TPH --- artiq/coredevice/suservo.py | 1 + 1 file changed, 1 insertion(+) diff --git a/artiq/coredevice/suservo.py b/artiq/coredevice/suservo.py index 956950380..f1ce004e5 100644 --- a/artiq/coredevice/suservo.py +++ b/artiq/coredevice/suservo.py @@ -130,6 +130,7 @@ class SUServo: :param value: Data to be written. """ addr |= WE + value &= (1 << COEFF_WIDTH) - 1 value |= (addr >> 8) << COEFF_WIDTH addr = addr & 0xff rtio_output((self.channel << 8) | addr, value)