forked from M-Labs/artiq
runtime: account for RTIO_FINE_TS_WIDTH in time buffers
This commit is contained in:
parent
f68d5cbd73
commit
d3f05e414a
@ -5,12 +5,14 @@
|
||||
#include "dds.h"
|
||||
#include "bridge.h"
|
||||
|
||||
#define TIME_BUFFER (8000 << RTIO_FINE_TS_WIDTH)
|
||||
|
||||
static void dds_write(int addr, int data)
|
||||
{
|
||||
rtio_chan_sel_write(RTIO_DDS_CHANNEL);
|
||||
rtio_o_address_write(addr);
|
||||
rtio_o_data_write(data);
|
||||
rtio_o_timestamp_write(rtio_get_counter() + 8000);
|
||||
rtio_o_timestamp_write(rtio_get_counter() + TIME_BUFFER);
|
||||
rtio_o_we_write(1);
|
||||
}
|
||||
|
||||
@ -46,7 +48,7 @@ void bridge_main(void)
|
||||
struct msg_brg_ttl_out *msg;
|
||||
|
||||
msg = (struct msg_brg_ttl_out *)umsg;
|
||||
ttl_set_oe(rtio_get_counter() + 8000, msg->channel, msg->value);
|
||||
ttl_set_oe(rtio_get_counter() + TIME_BUFFER, msg->channel, msg->value);
|
||||
mailbox_acknowledge();
|
||||
break;
|
||||
}
|
||||
@ -54,7 +56,7 @@ void bridge_main(void)
|
||||
struct msg_brg_ttl_out *msg;
|
||||
|
||||
msg = (struct msg_brg_ttl_out *)umsg;
|
||||
ttl_set_o(rtio_get_counter() + 8000, msg->channel, msg->value);
|
||||
ttl_set_o(rtio_get_counter() + TIME_BUFFER, msg->channel, msg->value);
|
||||
mailbox_acknowledge();
|
||||
break;
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ long long int now_init(void)
|
||||
|
||||
if(now < 0) {
|
||||
rtio_init();
|
||||
now = rtio_get_counter() + 125000;
|
||||
now = rtio_get_counter() + (125000 << RTIO_FINE_TS_WIDTH);
|
||||
}
|
||||
|
||||
return now;
|
||||
|
Loading…
Reference in New Issue
Block a user