diff --git a/linux/ipcore/PdecHandler.cpp b/linux/ipcore/PdecHandler.cpp index ff1f819d..a1030382 100644 --- a/linux/ipcore/PdecHandler.cpp +++ b/linux/ipcore/PdecHandler.cpp @@ -130,6 +130,7 @@ ReturnValue_t PdecHandler::polledOperation() { ReturnValue_t PdecHandler::irqOperation() { ReturnValue_t result = returnvalue::OK; int fd = open(uioNames.irq, O_RDWR); + sif::info << uioNames.irq << std::endl; if (fd < 0) { sif::error << "PdecHandler::irqOperation: Opening UIO IRQ file" << uioNames.irq << " failed" << std::endl; @@ -141,6 +142,8 @@ ReturnValue_t PdecHandler::irqOperation() { uint32_t info = 1; ssize_t nb = 0; int ret = 0; + // Clear interrupts with dummy read before unmasking the interrupt + ret = *(registerBaseAddress + PDEC_PIR_OFFSET); while (true) { readCommandQueue(); diff --git a/linux/ipcore/PdecHandler.h b/linux/ipcore/PdecHandler.h index be6299fb..61b0f811 100644 --- a/linux/ipcore/PdecHandler.h +++ b/linux/ipcore/PdecHandler.h @@ -91,7 +91,7 @@ class PdecHandler : public SystemObject, public ExecutableObjectIF, public HasAc private: static const uint8_t INTERFACE_ID = CLASS_ID::PDEC_HANDLER; - static constexpr Modes OP_MODE = Modes::POLLED; + static constexpr Modes OP_MODE = Modes::IRQ; static const ReturnValue_t ABANDONED_CLTU = MAKE_RETURN_CODE(0xA0); static const ReturnValue_t FRAME_DIRTY = MAKE_RETURN_CODE(0xA1);