From 190f6b32a4319d90f9786c79c3714638c9224ca6 Mon Sep 17 00:00:00 2001 From: Jerzy Jamroz Date: Thu, 4 Jan 2024 11:56:34 +0100 Subject: [PATCH] fix: EVRU/D use the irqpoller until the isr is implemented. Until EVM-EVRU/D interrupts are implemented in the EVM, the irqpoller will be delivering the capability. --- evgMrmApp/src/Makefile | 2 +- evgMrmApp/src/evgInit.cpp | 12 +++++++----- evgMrmApp/src/evgMrm.h | 7 +++++-- mrfCommon/src/Makefile | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/evgMrmApp/src/Makefile b/evgMrmApp/src/Makefile index 0551be4dc..35523967c 100644 --- a/evgMrmApp/src/Makefile +++ b/evgMrmApp/src/Makefile @@ -23,7 +23,7 @@ LIBRARY_IOC += evgmrm # INC += evgOutput.h # INC += mrmevgseq.h -SRC_DIRS += ../devSupport +SRC_DIRS += ../devSupport #All the source files that are compiled and put in the library. evgmrm_SRCS += evgInit.cpp diff --git a/evgMrmApp/src/evgInit.cpp b/evgMrmApp/src/evgInit.cpp index bb9cdc530..e1bf2b397 100644 --- a/evgMrmApp/src/evgInit.cpp +++ b/evgMrmApp/src/evgInit.cpp @@ -133,7 +133,7 @@ evgShutdown(void*) mrf::Object::visitObjects(&disableIRQ,0); } -static void +static void inithooks(initHookState state) { epicsUInt8 lvl; switch(state) { @@ -225,7 +225,7 @@ mrmEvgSetupVME ( printf("##### Setting up MRF EVG in VME Slot %d #####\n",slot); printf("Found Vendor: %08x\nBoard: %08x\nRevision: %08x\n", info.vendor, info.board, info.revision); - + epicsUInt32 xxx = CSRRead32(csrCpuAddr + CSR_FN_ADER(1)); if(xxx) printf("Warning: EVG not in power on state! (%08x)\n", xxx); @@ -536,6 +536,8 @@ mrmEvgSetupPCI ( delete evg; return -1; } else { + new IRQPoller(&EVRMRM::isr_poll, static_cast(evg->getEvruMrm()), 0.1); + new IRQPoller(&EVRMRM::isr_poll, static_cast(evg->getEvrdMrm()), 0.1); printf("PCI interrupt connected!\n"); } @@ -562,7 +564,7 @@ static const iocshArg * const mrmEvgSetupVMEArgs[5] = { &mrmEvgSetupVMEArg0, static const iocshFuncDef mrmEvgSetupVMEFuncDef = { "mrmEvgSetupVME", 5, mrmEvgSetupVMEArgs }; -static void +static void mrmEvgSetupVMECallFunc(const iocshArgBuf *args) { mrmEvgSetupVME(args[0].sval, args[1].ival, @@ -750,7 +752,7 @@ reportCard(mrf::Object* obj, void* arg) { } evg->show(*level); - + if(*level >= 2) printregisters(evg->getRegAddr()); @@ -758,7 +760,7 @@ reportCard(mrf::Object* obj, void* arg) { return true; } -static long +static long report(int level) { printf("=== Begin MRF EVG support ===\n"); mrf::Object::visitObjects(&reportCard, (void*)&level); diff --git a/evgMrmApp/src/evgMrm.h b/evgMrmApp/src/evgMrm.h index f373f1011..f4f81eccf 100644 --- a/evgMrmApp/src/evgMrm.h +++ b/evgMrmApp/src/evgMrm.h @@ -41,9 +41,9 @@ #include "drvem.h" /********* - * Each EVG will be represented by the instance of class 'evgMrm'. Each evg + * Each EVG will be represented by the instance of class 'evgMrm'. Each evg * object maintains a list to all the evg sub-componets i.e. Event clock, - * Software Events, Trigger Events, Distributed bus, Multiplex Counters, + * Software Events, Trigger Events, Distributed bus, Multiplex Counters, * Input, Output etc. */ class wdTimer; @@ -198,6 +198,9 @@ class evgMrm : public mrf::ObjectInst, // EVM only mrf::auto_ptr fct; mrf::auto_ptr evru, evrd; +public: + EVRMRM *getEvruMrm() const { return evru.get(); } // EVRU MRM accessor + EVRMRM *getEvrdMrm() const { return evrd.get(); } // EVRD MRM accessor }; #endif //EVG_MRM_H diff --git a/mrfCommon/src/Makefile b/mrfCommon/src/Makefile index c58217ad9..e99eb3e0b 100644 --- a/mrfCommon/src/Makefile +++ b/mrfCommon/src/Makefile @@ -73,7 +73,7 @@ mrfCommon_SRCS += mrfCommon.cpp mrfCommon_SRCS += spi.cpp mrfCommon_SRCS += flash.cpp mrfCommon_SRCS += flashiocsh.cpp -#NOTINUSE: mrfCommon_SRCS += pollirq.cpp +mrfCommon_SRCS += pollirq.cpp #MTCA EVM EVRU/D usage mrfCommon_LIBS += $(EPICS_BASE_IOC_LIBS)