SI: Collapse interrupt generation check in UpdateInterrupts()

We can simplify this by storing the result of the test into a variable
instead.
This commit is contained in:
Lioncash 2021-08-31 16:12:13 -04:00
parent ca24c32cbf
commit d00e7d5a75

View File

@ -247,14 +247,10 @@ static void UpdateInterrupts()
s_com_csr.RDSTINT = 0; s_com_csr.RDSTINT = 0;
// check if we have to generate an interrupt // check if we have to generate an interrupt
if ((s_com_csr.RDSTINT & s_com_csr.RDSTINTMSK) || (s_com_csr.TCINT & s_com_csr.TCINTMSK)) const bool generate_interrupt = (s_com_csr.RDSTINT & s_com_csr.RDSTINTMSK) != 0 ||
{ (s_com_csr.TCINT & s_com_csr.TCINTMSK) != 0;
ProcessorInterface::SetInterrupt(ProcessorInterface::INT_CAUSE_SI, true);
} ProcessorInterface::SetInterrupt(ProcessorInterface::INT_CAUSE_SI, generate_interrupt);
else
{
ProcessorInterface::SetInterrupt(ProcessorInterface::INT_CAUSE_SI, false);
}
} }
static void GenerateSIInterrupt(SIInterruptType type) static void GenerateSIInterrupt(SIInterruptType type)