forked from M-Labs/artiq
runtime: implement rtio_sync syscall
This commit is contained in:
parent
5573cf3688
commit
dec7c1438f
|
@ -6,7 +6,8 @@ lt.initialize_all()
|
||||||
_syscalls = [
|
_syscalls = [
|
||||||
("rpc", "i+:i"),
|
("rpc", "i+:i"),
|
||||||
("gpio_set", "ii:v"),
|
("gpio_set", "ii:v"),
|
||||||
("rtio_set", "iii:v")
|
("rtio_set", "iii:v"),
|
||||||
|
("rtio_sync", "i:v"),
|
||||||
]
|
]
|
||||||
|
|
||||||
def _str_to_functype(s):
|
def _str_to_functype(s):
|
||||||
|
|
|
@ -139,10 +139,17 @@ static void rtio_set(int timestamp, int channel, int value)
|
||||||
rtio_o_we_write(1);
|
rtio_o_we_write(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void rtio_sync(int channel)
|
||||||
|
{
|
||||||
|
rtio_chan_sel_write(channel);
|
||||||
|
while(rtio_o_level_read() != 0);
|
||||||
|
}
|
||||||
|
|
||||||
static const struct symbol syscalls[] = {
|
static const struct symbol syscalls[] = {
|
||||||
{"__syscall_rpc", rpc},
|
{"__syscall_rpc", rpc},
|
||||||
{"__syscall_gpio_set", gpio_set},
|
{"__syscall_gpio_set", gpio_set},
|
||||||
{"__syscall_rtio_set", rtio_set},
|
{"__syscall_rtio_set", rtio_set},
|
||||||
|
{"__syscall_rtio_sync", rtio_sync},
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue