some more tests

This commit is contained in:
Robin Müller 2022-11-02 16:32:00 +01:00
parent ddc68669fc
commit b2e3bc7e7a
2 changed files with 4 additions and 1 deletions

View File

@ -130,6 +130,7 @@ ReturnValue_t PdecHandler::polledOperation() {
ReturnValue_t PdecHandler::irqOperation() { ReturnValue_t PdecHandler::irqOperation() {
ReturnValue_t result = returnvalue::OK; ReturnValue_t result = returnvalue::OK;
int fd = open(uioNames.irq, O_RDWR); int fd = open(uioNames.irq, O_RDWR);
sif::info << uioNames.irq << std::endl;
if (fd < 0) { if (fd < 0) {
sif::error << "PdecHandler::irqOperation: Opening UIO IRQ file" << uioNames.irq << " failed" sif::error << "PdecHandler::irqOperation: Opening UIO IRQ file" << uioNames.irq << " failed"
<< std::endl; << std::endl;
@ -141,6 +142,8 @@ ReturnValue_t PdecHandler::irqOperation() {
uint32_t info = 1; uint32_t info = 1;
ssize_t nb = 0; ssize_t nb = 0;
int ret = 0; int ret = 0;
// Clear interrupts with dummy read before unmasking the interrupt
ret = *(registerBaseAddress + PDEC_PIR_OFFSET);
while (true) { while (true) {
readCommandQueue(); readCommandQueue();

View File

@ -91,7 +91,7 @@ class PdecHandler : public SystemObject, public ExecutableObjectIF, public HasAc
private: private:
static const uint8_t INTERFACE_ID = CLASS_ID::PDEC_HANDLER; 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 ABANDONED_CLTU = MAKE_RETURN_CODE(0xA0);
static const ReturnValue_t FRAME_DIRTY = MAKE_RETURN_CODE(0xA1); static const ReturnValue_t FRAME_DIRTY = MAKE_RETURN_CODE(0xA1);