From 887cb110a74bc947022b7176fe00c2c2231ff96b Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 8 Jan 2019 20:46:53 +0800 Subject: [PATCH] firmware: fix default DRTIO routing table --- artiq/firmware/libboard_artiq/drtio_routing.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/artiq/firmware/libboard_artiq/drtio_routing.rs b/artiq/firmware/libboard_artiq/drtio_routing.rs index 8e6c526fb..27234d22c 100644 --- a/artiq/firmware/libboard_artiq/drtio_routing.rs +++ b/artiq/firmware/libboard_artiq/drtio_routing.rs @@ -16,10 +16,11 @@ impl RoutingTable { // default routing table is for star topology with no hops pub fn default_master(default_n_links: usize) -> RoutingTable { let mut ret = RoutingTable([[INVALID_HOP; MAX_HOPS]; DEST_COUNT]); - for i in 0..default_n_links { + let n_entries = default_n_links + 1; // include local RTIO + for i in 0..n_entries { ret.0[i][0] = i as u8; } - for i in 1..default_n_links { + for i in 1..n_entries { ret.0[i][1] = 0x00; } ret