From 65da1fee4a22707865db333386c7069e4aadd99f Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 14 Sep 2018 20:38:41 +0800 Subject: [PATCH] firmware: fix build without DRTIO --- artiq/firmware/libboard_artiq/drtio_routing.rs | 4 +++- artiq/firmware/runtime/main.rs | 1 - artiq/firmware/runtime/moninj.rs | 2 +- artiq/firmware/runtime/rtio_mgt.rs | 4 +++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/artiq/firmware/libboard_artiq/drtio_routing.rs b/artiq/firmware/libboard_artiq/drtio_routing.rs index c78b5cddd..fe51c3cc4 100644 --- a/artiq/firmware/libboard_artiq/drtio_routing.rs +++ b/artiq/firmware/libboard_artiq/drtio_routing.rs @@ -1,4 +1,6 @@ -use board_misoc::{csr, config}; +use board_misoc::config; +#[cfg(has_drtio_routing)] +use board_misoc::csr; use core::fmt; pub const DEST_COUNT: usize = 256; diff --git a/artiq/firmware/runtime/main.rs b/artiq/firmware/runtime/main.rs index 16f0fca05..6ecf79dd0 100644 --- a/artiq/firmware/runtime/main.rs +++ b/artiq/firmware/runtime/main.rs @@ -34,7 +34,6 @@ use board_misoc::{csr, irq, ident, clock, boot, config}; use board_misoc::ethmac; #[cfg(has_drtio)] use board_artiq::drtioaux; -#[cfg(has_drtio_routing)] use board_artiq::drtio_routing; use board_artiq::{mailbox, rpc_queue}; use proto_artiq::{mgmt_proto, moninj_proto, rpc_proto, session_proto, kernel_proto}; diff --git a/artiq/firmware/runtime/moninj.rs b/artiq/firmware/runtime/moninj.rs index d2713bd4c..b049806df 100644 --- a/artiq/firmware/runtime/moninj.rs +++ b/artiq/firmware/runtime/moninj.rs @@ -125,7 +125,7 @@ macro_rules! dispatch { #[cfg(not(has_drtio))] macro_rules! dispatch { ($routing_table:ident, $channel:expr, $func:ident $(, $param:expr)*) => {{ - let channel = $channel as u8; + let channel = $channel as u16; local_moninj::$func(channel, $($param, )*) }} } diff --git a/artiq/firmware/runtime/rtio_mgt.rs b/artiq/firmware/runtime/rtio_mgt.rs index c3b67567d..1635586a0 100644 --- a/artiq/firmware/runtime/rtio_mgt.rs +++ b/artiq/firmware/runtime/rtio_mgt.rs @@ -1,6 +1,8 @@ use core::cell::RefCell; use urc::Urc; -use board_misoc::{csr, clock}; +use board_misoc::csr; +#[cfg(has_drtio))] +use board_misoc::clock; #[cfg(has_rtio_clock_switch)] use board_misoc::config; use board_artiq::drtio_routing;