diff options
author | Martin Braun <martin.braun@ettus.com> | 2016-08-01 18:17:41 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2016-08-09 12:42:52 -0700 |
commit | 3bf4b000f7d9a7f4af82c21753556ede7e8df6e3 (patch) | |
tree | 2228d7eb58c4d83d91192cb9b6a908e4e49f6317 /firmware/usrp3/x300/x300_main.c | |
parent | c5b076173e2d866f3ee99c113a37183c5ec20f0b (diff) | |
download | uhd-3bf4b000f7d9a7f4af82c21753556ede7e8df6e3.tar.gz uhd-3bf4b000f7d9a7f4af82c21753556ede7e8df6e3.tar.bz2 uhd-3bf4b000f7d9a7f4af82c21753556ede7e8df6e3.zip |
Merging RFNoC support for X310
Diffstat (limited to 'firmware/usrp3/x300/x300_main.c')
-rw-r--r-- | firmware/usrp3/x300/x300_main.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/firmware/usrp3/x300/x300_main.c b/firmware/usrp3/x300/x300_main.c index eca0802be..42ee3248b 100644 --- a/firmware/usrp3/x300/x300_main.c +++ b/firmware/usrp3/x300/x300_main.c @@ -246,18 +246,16 @@ static void handle_claim(void) /*********************************************************************** * LED blinky logic and support utilities **********************************************************************/ -static uint32_t get_xbar_total(const uint8_t port) +static uint32_t get_xbar_total(const uint32_t port) { - #define get_xbar_stat(in_prt, out_prt) \ - wb_peek32(RB0_BASE+256+(((in_prt)*8+(out_prt))*4)) + static const uint32_t NUM_PORTS = 16; uint32_t total = 0; - for (size_t i = 0; i < 8; i++) + for (uint32_t i = 0; i < NUM_PORTS; i++) { - total += get_xbar_stat(port, i); - } - for (size_t i = 0; i < 8; i++) - { - total += get_xbar_stat(i, port); + wb_poke32(SET0_BASE + SR_RB_ADDR*4, (NUM_PORTS*port + i)); + total += wb_peek32(RB0_BASE + RB_XBAR*4); + wb_poke32(SET0_BASE + SR_RB_ADDR*4, (NUM_PORTS*i + port)); + total += wb_peek32(RB0_BASE + RB_XBAR*4); } if (port < 2) //also netstack if applicable { @@ -279,10 +277,10 @@ static size_t popcntll(uint64_t num) static void update_leds(void) { //update activity status for all ports - uint64_t activity_shreg[8]; - for (size_t i = 0; i < 8; i++) + uint64_t activity_shreg[16]; + for (uint32_t i = 0; i < 16; i++) { - static uint32_t last_total[8]; + static uint32_t last_total[16]; const uint32_t total = get_xbar_total(i); activity_shreg[i] <<= 1; activity_shreg[i] |= (total == last_total[i])? 0 : 1; |