Skip to content

Commit

Permalink
[GH#539] GPIOInterruptManager: Add DeassertActiveInterruptTrigger pro…
Browse files Browse the repository at this point in the history
…perty
  • Loading branch information
MarWit committed Nov 24, 2023
1 parent 8ec260b commit 6dd79a5
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/Emulator/Main/Peripherals/GPIOPort/GPIOInterruptManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,26 @@ public void RefreshInterrupts()
switch(InterruptType[i])
{
case InterruptTrigger.ActiveHigh:
if(underlyingState[i])
if(DeassertActiveInterruptTrigger)
{
irqState |= !InterruptMask[i];
activeInterrupts[i] = true;
activeInterrupts[i] = underlyingState[i];
}
else
{
activeInterrupts[i] |= underlyingState[i];
}
irqState |= activeInterrupts[i] && !InterruptMask[i];
break;
case InterruptTrigger.ActiveLow:
if(!underlyingState[i])
if(DeassertActiveInterruptTrigger)
{
irqState |= !InterruptMask[i];
activeInterrupts[i] = true;
activeInterrupts[i] = !underlyingState[i];
}
else
{
activeInterrupts[i] |= !underlyingState[i];
}
irqState |= activeInterrupts[i] && !InterruptMask[i];
break;
case InterruptTrigger.RisingEdge:
if(isEdge && underlyingState[i])
Expand Down Expand Up @@ -114,6 +122,8 @@ public void RefreshInterrupts()
}
}

public bool DeassertActiveInterruptTrigger { get; set; }

public IArray<bool> InterruptEnable { get { return interruptEnable; } }

public IArray<InterruptTrigger> InterruptType { get { return interruptType; } }
Expand Down

0 comments on commit 6dd79a5

Please sign in to comment.