diff --git a/dtcInterfaceLib/CFOandDTC_Registers.cpp b/dtcInterfaceLib/CFOandDTC_Registers.cpp index 790bad1..8560996 100644 --- a/dtcInterfaceLib/CFOandDTC_Registers.cpp +++ b/dtcInterfaceLib/CFOandDTC_Registers.cpp @@ -896,7 +896,7 @@ DTCLib::RegisterFormatter DTCLib::CFOandDTC_Registers::FormatJitterAttenuatorCSR form.description = "Jitter Attenuator CSR"; form.vals.push_back(" : []"); //first value describes format form.vals.push_back(std::string("JA Source Clock Select: [") + - (JAinputSelect.to_ulong() == 0 ? "from CFO" + (JAinputSelect.to_ulong() == 0 ? "from emulated CFO" : (JAinputSelect.to_ulong() == 1 ? "from RJ45" : "Timing Card Selectable (SFP+ or FPGA) Input Clock")) + "]"); form.vals.push_back(std::string("JA in Reset: [") + (data[0] ? "YES" : "No") + "]"); diff --git a/dtcInterfaceLib/DTC_Registers.cpp b/dtcInterfaceLib/DTC_Registers.cpp index 0caade9..b00be50 100644 --- a/dtcInterfaceLib/DTC_Registers.cpp +++ b/dtcInterfaceLib/DTC_Registers.cpp @@ -3723,7 +3723,7 @@ void DTCLib::DTC_Registers::SetCFO40MHzClockMarkerEnable(DTC_Link_ID const& link std::bitset<32> data = ReadRegister_(DTC_Register_CFOMarkerEnables); if (link == DTC_Link_ALL) { - for (uint8_t i = 0; i < 8; ++i) + for (uint8_t i = 0; i < 6; ++i) //just ROC links data[i] = enable; } else diff --git a/dtcInterfaceLib/mu2edev.cpp b/dtcInterfaceLib/mu2edev.cpp index 64962da..3a193e3 100644 --- a/dtcInterfaceLib/mu2edev.cpp +++ b/dtcInterfaceLib/mu2edev.cpp @@ -88,6 +88,30 @@ int mu2edev::init(DTCLib::DTC_SimMode simMode, int deviceIndex, std::string simM return simMode; } +//============================================================================== +// exec +// run linux command and get result back in string +std::string exec(const char* cmd) +{ + __COUTV__(cmd); + + std::array buffer; + std::string result; + std::shared_ptr pipe(popen(cmd, "r"), pclose); + if(!pipe) + { + __COUT_ERR__ << "popen() failed!" << __E__; + return "popen() failed!"; + } + while(!feof(pipe.get())) + { + if(fgets(buffer.data(), 128, pipe.get()) != nullptr) + result += buffer.data(); + } + //__COUTV__(result); + return result; +} // end exec() + /***************************** initDMAEngine set up DMA engines @@ -111,7 +135,9 @@ void mu2edev::initDMAEngine() __SS__ << "mu2e Device file not found (or DTCLIB_SIM_ENABLE not set)! Exiting.\n" << "Attempt to open '" << devfile << "' and received error: " << errno << " - " << strerror(errno) << __E__; - perror(ss.str().c_str()); + + ss << "Who owns it?\n" << exec("ls -l /dev/mu2e*") << __E__; + perror(ss.str().c_str()); __SS_THROW__; // exit(1); }