diff --git a/artiq/runtime/bridge.c b/artiq/runtime/bridge.c index 78c47acfd..8d90864a1 100644 --- a/artiq/runtime/bridge.c +++ b/artiq/runtime/bridge.c @@ -18,6 +18,7 @@ static void rtio_output_blind(int channel, int addr, int data) rtio_o_we_write(1); } +#if ((defined RTIO_DDS_COUNT) && (RTIO_DDS_COUNT > 0)) static void dds_write(int bus_channel, int addr, int data) { rtio_output_blind(bus_channel, addr, data); @@ -39,6 +40,7 @@ static int dds_read(int bus_channel, int addr) rtio_i_re_write(1); return r; } +#endif static void send_ready(void) { @@ -73,6 +75,7 @@ void bridge_main(void) mailbox_acknowledge(); break; } +#if ((defined RTIO_DDS_COUNT) && (RTIO_DDS_COUNT > 0)) case MESSAGE_TYPE_BRG_DDS_SEL: { struct msg_brg_dds_sel *msg; @@ -119,6 +122,7 @@ void bridge_main(void) mailbox_acknowledge(); break; } +#endif /* RTIO_DDS_COUNT */ default: mailbox_acknowledge(); break; diff --git a/artiq/runtime/dds.c b/artiq/runtime/dds.c index 1a7d8f9f4..586243f4b 100644 --- a/artiq/runtime/dds.c +++ b/artiq/runtime/dds.c @@ -1,4 +1,7 @@ #include + +#if ((defined RTIO_DDS_COUNT) && (RTIO_DDS_COUNT > 0)) + #include #include "artiq_personality.h" @@ -221,3 +224,5 @@ void dds_set(long long int timestamp, int bus_channel, int channel, ftw, pow, phase_mode, amplitude); } } + +#endif /* RTIO_DDS_COUNT */ diff --git a/artiq/runtime/dds.h b/artiq/runtime/dds.h index 10fa3fffc..0a2a8ade4 100644 --- a/artiq/runtime/dds.h +++ b/artiq/runtime/dds.h @@ -5,6 +5,8 @@ #include #include +#if ((defined RTIO_DDS_COUNT) && (RTIO_DDS_COUNT > 0)) + /* Maximum number of commands in a batch */ #define DDS_MAX_BATCH 16 @@ -60,4 +62,6 @@ void dds_batch_exit(void); void dds_set(long long int timestamp, int bus_channel, int channel, unsigned int ftw, unsigned int pow, int phase_mode, unsigned int amplitude); +#endif /* RTIO_DDS_COUNT */ + #endif /* __DDS_H */ diff --git a/artiq/runtime/ksupport.c b/artiq/runtime/ksupport.c index dde9bc3a2..049cc7ac6 100644 --- a/artiq/runtime/ksupport.c +++ b/artiq/runtime/ksupport.c @@ -118,10 +118,12 @@ static const struct symbol runtime_exports[] = { {"rtio_input_timestamp", &rtio_input_timestamp}, {"rtio_input_data", &rtio_input_data}, +#if ((defined RTIO_DDS_COUNT) && (RTIO_DDS_COUNT > 0)) {"dds_init", &dds_init}, {"dds_batch_enter", &dds_batch_enter}, {"dds_batch_exit", &dds_batch_exit}, {"dds_set", &dds_set}, +#endif {"i2c_init", &i2c_init}, {"i2c_start", &i2c_start}, diff --git a/artiq/runtime/moninj.c b/artiq/runtime/moninj.c index 4a7c14205..9ad4ea79c 100644 --- a/artiq/runtime/moninj.c +++ b/artiq/runtime/moninj.c @@ -38,13 +38,15 @@ struct monitor_reply { long long int ttl_overrides; unsigned short int dds_rtio_first_channel; unsigned short int dds_channels_per_bus; +#if ((defined RTIO_DDS_COUNT) && (RTIO_DDS_COUNT > 0)) unsigned int dds_ftws[CONFIG_RTIO_DDS_COUNT*CONFIG_DDS_CHANNELS_PER_BUS]; +#endif } __attribute__((packed)); static void moninj_monitor(const ip_addr_t *addr, u16_t port) { struct monitor_reply reply; - int i, j; + int i; struct pbuf *reply_p; reply.ttl_levels = 0; @@ -66,6 +68,9 @@ static void moninj_monitor(const ip_addr_t *addr, u16_t port) reply.ttl_overrides |= 1LL << i; } +#if ((defined RTIO_DDS_COUNT) && (RTIO_DDS_COUNT > 0)) + int j; + reply.dds_rtio_first_channel = CONFIG_RTIO_FIRST_DDS_CHANNEL; reply.dds_channels_per_bus = CONFIG_DDS_CHANNELS_PER_BUS; for(j=0;j 0)) + static int bus_channel = CONFIG_RTIO_FIRST_DDS_CHANNEL; static void ddsbus(char *n) @@ -360,6 +362,7 @@ static void ddstest(char *n, char *channel) do_ddstest_one(j); } } +#endif /* RTIO_DDS_COUNT */ #if (defined CSR_SPIFLASH_BASE && defined CONFIG_SPIFLASH_PAGE_SIZE) static void fsread(char *key) @@ -659,6 +662,7 @@ static void do_command(char *c) else if(strcmp(token, "ttloe") == 0) ttloe(get_token(&c), get_token(&c)); else if(strcmp(token, "ttlo") == 0) ttlo(get_token(&c), get_token(&c)); +#if ((defined RTIO_DDS_COUNT) && (RTIO_DDS_COUNT > 0)) else if(strcmp(token, "ddsbus") == 0) ddsbus(get_token(&c)); else if(strcmp(token, "ddssel") == 0) ddssel(get_token(&c)); else if(strcmp(token, "ddsw") == 0) ddsw(get_token(&c), get_token(&c)); @@ -668,6 +672,7 @@ static void do_command(char *c) else if(strcmp(token, "ddsfud") == 0) ddsfud(); else if(strcmp(token, "ddsftw") == 0) ddsftw(get_token(&c), get_token(&c)); else if(strcmp(token, "ddstest") == 0) ddstest(get_token(&c), get_token(&c)); +#endif #if (defined CSR_SPIFLASH_BASE && defined CONFIG_SPIFLASH_PAGE_SIZE) else if(strcmp(token, "fserase") == 0) fs_erase();