aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/usrp3/x300/x300_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/usrp3/x300/x300_main.c')
-rw-r--r--firmware/usrp3/x300/x300_main.c22
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;