mirror of https://github.com/m-labs/artiq.git
runtime: use booleans in syscalls
This commit is contained in:
parent
dfd779c7c5
commit
914bdd95d5
|
@ -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)
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue