diff --git a/artiq/runtime/rtiocrg.c b/artiq/runtime/rtiocrg.c index 260d5f3d1..01d24b246 100644 --- a/artiq/runtime/rtiocrg.c +++ b/artiq/runtime/rtiocrg.c @@ -33,7 +33,7 @@ void rtiocrg_init(void) int rtiocrg_check(void) { -#ifdef CSR_RTIO_CRG_PLL_RESET_ADDR +#if ((defined CSR_RTIO_CRG_BASE) && (defined CSR_RTIO_CRG_PLL_RESET_ADDR)) return rtio_crg_pll_locked_read(); #else return 1; @@ -44,6 +44,7 @@ int rtiocrg_switch_clock(int clk) { int current_clk; +#ifdef CSR_RTIO_CRG_BASE current_clk = rtio_crg_clock_sel_read(); if(clk == current_clk) { #ifdef CSR_RTIO_CRG_PLL_RESET_ADDR @@ -64,4 +65,7 @@ int rtiocrg_switch_clock(int clk) return 0; #endif return 1; +#else /* CSR_RTIO_CRG_BASE */ + return 1; +#endif } diff --git a/artiq/runtime/test_mode.c b/artiq/runtime/test_mode.c index 8676c3a2b..6bd057548 100644 --- a/artiq/runtime/test_mode.c +++ b/artiq/runtime/test_mode.c @@ -39,6 +39,7 @@ static void leds(char *value) } #endif +#ifdef CSR_RTIO_CRG_BASE static void clksrc(char *value) { char *c; @@ -57,6 +58,7 @@ static void clksrc(char *value) rtio_crg_clock_sel_write(value2); } +#endif static void ttloe(char *n, char *value) { @@ -563,7 +565,9 @@ static void help(void) { puts("Available commands:"); puts("help - this message"); +#ifdef CSR_RTIO_CRG_BASE puts("clksrc - select RTIO clock source"); +#endif puts("ttloe - set TTL output enable"); puts("ttlo - set TTL output value"); puts("ddsbus - select the DDS bus RTIO channel"); @@ -648,7 +652,9 @@ static void do_command(char *c) else if(strcmp(token, "leds") == 0) leds(get_token(&c)); #endif +#ifdef CSR_RTIO_CRG_BASE else if(strcmp(token, "clksrc") == 0) clksrc(get_token(&c)); +#endif 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));