[Core/CD] added clear of CDC decoder interrupt pending flag when decoding is disabled (verified on real hardware, cf. Krikzz's mcd-verificator)

This commit is contained in:
ekeeke 2024-02-21 20:25:04 +01:00
parent 47761b9b8f
commit f09c97336e
1 changed files with 10 additions and 0 deletions

View File

@ -680,6 +680,16 @@ void cdc_reg_w(unsigned char data)
/* set CRCOK bit only if decoding is enabled */
cdc.stat[0] = data & BIT_DECEN;
/* decoding disabled ? */
if (!(data & BIT_DECEN))
{
/* clear pending decoder interrupt */
cdc.ifstat |= BIT_DECI;
/* update CDC IRQ state */
cdc.irq &= ~BIT_DECI;
}
/* update STAT2 register */
if (data & BIT_AUTORQ)
{