arch/arm64/src/imx9/imx9_lpi2c.c: Ignore spurious RX interrupts

Check remaining data count, just in case an extra RX interrupt occurs
after receiving a message

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
This commit is contained in:
Jukka Laitinen 2024-09-13 10:39:12 +03:00 committed by Alan C. Assis
parent dd88c7fcfa
commit 78d2d884d3

View File

@ -1576,7 +1576,7 @@ static int imx9_lpi2c_isr_process(struct imx9_lpi2c_priv_s *priv)
/* Check if there are received bytes */
else if ((status & LPI2C_MSR_RDF) != 0)
else if ((status & LPI2C_MSR_RDF) != 0 && priv->dcnt > 0)
{
imx9_lpi2c_traceevent(priv, I2CEVENT_RCVBYTE, priv->dcnt);