diff --git a/tests/ethswitch.cpp b/tests/ethswitch.cpp index f12bda0..34c64e3 100644 --- a/tests/ethswitch.cpp +++ b/tests/ethswitch.cpp @@ -78,6 +78,28 @@ bool GetBit(uint16_t value, uint16_t inPort, uint16_t outPort) return value & (1 << offset); } +// Convert bitmask to list of board numbers +const char *PrintFpgaList(uint16_t fpgaList) +{ + static char buffer[128]; + char *p = buffer; + for (size_t i = 0; i < 16; i++) { + if (fpgaList & (1<UdpMulticastFpga; console.Print(36, lm+64, EthUdpPort::IP_String(bswap_32(UdpMulticastFpga)).c_str()); } - console.Print(37, lm+16, "%6x", data->PortForwardFpga[0]); - console.Print(37, lm+32, "%6x", data->PortForwardFpga[1]); + console.Print(37, lm+16, PrintFpgaList(data->PortForwardFpga[0])); + console.Print(37, lm+32, PrintFpgaList(data->PortForwardFpga[1])); } }