diff --git a/evgMrmApp/src/evgMrm.cpp b/evgMrmApp/src/evgMrm.cpp index fb2950606..49ae228ff 100644 --- a/evgMrmApp/src/evgMrm.cpp +++ b/evgMrmApp/src/evgMrm.cpp @@ -194,7 +194,7 @@ evgMrm::evgMrm(const std::string& id, scanIoInit(&ioScanTimestamp); - if((busConfig.busType==busType_pci) || (info.board==MRF_VME_EVM300_BID)) + if(busConfig.busType==busType_pci || (busConfig.busType==busType_vme && version()>=MRFVersion(2, 0, 0))) mrf::SPIDevice::registerDev(id+":FLASH", mrf::SPIDevice(this, 1)); if((pciDevice->id.sub_device==PCI_DEVICE_ID_MRF_MTCA_EVM_300) || (info.board==MRF_VME_EVM300_BID)) { @@ -210,7 +210,7 @@ evgMrm::evgMrm(const std::string& id, } evgMrm::~evgMrm() { - if(getBusConfiguration()->busType==busType_pci) + if(getBusConfiguration()->busType==busType_pci || (getBusConfiguration()->busType==busType_vme && version()>=MRFVersion(2, 0, 0))) mrf::SPIDevice::unregisterDev(name()+":FLASH"); for(size_t i = 0; i < m_trigEvt.size(); i++) diff --git a/evrMrmApp/src/drvem.cpp b/evrMrmApp/src/drvem.cpp index 818209aed..8ec852b88 100644 --- a/evrMrmApp/src/drvem.cpp +++ b/evrMrmApp/src/drvem.cpp @@ -353,7 +353,7 @@ try{ drain_fifo_task.start(); - if(busConfig.busType==busType_pci) + if(busConfig.busType==busType_pci || (busConfig.busType==busType_vme && version()>=MRFVersion(2, 0, 0))) mrf::SPIDevice::registerDev(n+":FLASH", mrf::SPIDevice(this, 1)); #ifndef DBR_UTAG @@ -369,7 +369,7 @@ try{ EVRMRM::~EVRMRM() { - if(getBusConfiguration()->busType==busType_pci) + if(getBusConfiguration()->busType==busType_pci || (getBusConfiguration()->busType==busType_vme && version()>=MRFVersion(2, 0, 0))) mrf::SPIDevice::unregisterDev(name()+":FLASH"); cleanup(); } diff --git a/mrfCommon/src/flashiocsh.cpp b/mrfCommon/src/flashiocsh.cpp index 0fab67940..64409d0e1 100644 --- a/mrfCommon/src/flashiocsh.cpp +++ b/mrfCommon/src/flashiocsh.cpp @@ -104,7 +104,7 @@ void flashread(const char *name, int addrraw, int countraw, const char *outfile) if(outfile) { fstrm.open(outfile, std::ios_base::out|std::ios_base::binary); if(fstrm.fail()) - throw std::runtime_error("Unable to open output file"); + throw std::runtime_error("Unable to open input file"); strm = &fstrm; }