forked from M-Labs/artiq
1
0
Fork 0

runtime: implement rtio_sync syscall

This commit is contained in:
Sebastien Bourdeauducq 2014-07-22 11:36:54 -06:00
parent 5573cf3688
commit dec7c1438f
2 changed files with 9 additions and 1 deletions

View File

@ -6,7 +6,8 @@ lt.initialize_all()
_syscalls = [
("rpc", "i+:i"),
("gpio_set", "ii:v"),
("rtio_set", "iii:v")
("rtio_set", "iii:v"),
("rtio_sync", "i:v"),
]
def _str_to_functype(s):

View File

@ -139,10 +139,17 @@ static void rtio_set(int timestamp, int channel, int value)
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[] = {
{"__syscall_rpc", rpc},
{"__syscall_gpio_set", gpio_set},
{"__syscall_rtio_set", rtio_set},
{"__syscall_rtio_sync", rtio_sync},
{NULL, NULL}
};