From 914bdd95d5540843016b6e8d998e515c26eaaf84 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 20 Nov 2014 12:49:09 -0800 Subject: [PATCH] runtime: use booleans in syscalls --- artiq/coredevice/gpio.py | 4 ++-- artiq/coredevice/rtio.py | 6 +++--- artiq/coredevice/runtime.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/artiq/coredevice/gpio.py b/artiq/coredevice/gpio.py index 125939855..cf5456691 100644 --- a/artiq/coredevice/gpio.py +++ b/artiq/coredevice/gpio.py @@ -6,8 +6,8 @@ class GPIOOut(AutoContext): @kernel def on(self): - syscall("gpio_set", self.channel, 1) + syscall("gpio_set", self.channel, True) @kernel def off(self): - syscall("gpio_set", self.channel, 0) + syscall("gpio_set", self.channel, False) diff --git a/artiq/coredevice/rtio.py b/artiq/coredevice/rtio.py index 5e25e563c..354a11054 100644 --- a/artiq/coredevice/rtio.py +++ b/artiq/coredevice/rtio.py @@ -20,7 +20,7 @@ class LLRTIOOut(AutoContext): @kernel def _set_oe(self): - syscall("rtio_oe", self.channel, 1) + syscall("rtio_oe", self.channel, True) @kernel def set_value(self, t, value): @@ -96,7 +96,7 @@ class RTIOOut(_RTIOBase): """ def build(self): _RTIOBase.build(self) - self._set_oe(1) + self._set_oe(True) @kernel def sync(self): @@ -146,7 +146,7 @@ class RTIOIn(_RTIOBase): """ def build(self): _RTIOBase.build(self) - self._set_oe(0) + self._set_oe(False) @kernel def gate_rising(self, duration): diff --git a/artiq/coredevice/runtime.py b/artiq/coredevice/runtime.py index 53a87a4ce..d981828b2 100644 --- a/artiq/coredevice/runtime.py +++ b/artiq/coredevice/runtime.py @@ -12,8 +12,8 @@ lt.initialize_all() _syscalls = { "rpc": "i+:i", - "gpio_set": "ii:n", - "rtio_oe": "ii:n", + "gpio_set": "ib:n", + "rtio_oe": "ib:n", "rtio_set": "Iii:n", "rtio_replace": "Iii:n", "rtio_sync": "i:n",