mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 09:38:37 +08:00
s32k3xx:lpi2c end only on stop with end of packet
This commit is contained in:
committed by
Petro Karashchenko
parent
119bf660a4
commit
b2b5826b80
@@ -1431,13 +1431,20 @@ static int s32k3xx_lpi2c_isr_process(struct s32k3xx_lpi2c_priv_s *priv)
|
|||||||
LPI2C_MSR_FEF | LPI2C_MSR_EPF)));
|
LPI2C_MSR_FEF | LPI2C_MSR_EPF)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for endof packet */
|
/* Check for endof packet or Stop */
|
||||||
|
|
||||||
if ((status & (LPI2C_MSR_EPF | LPI2C_MSR_SDF)) != 0)
|
if ((status & (LPI2C_MSR_EPF | LPI2C_MSR_SDF)) != 0)
|
||||||
{
|
{
|
||||||
|
/* Reset either or both */
|
||||||
|
|
||||||
s32k3xx_lpi2c_putreg(priv, S32K3XX_LPI2C_MSR_OFFSET, status &
|
s32k3xx_lpi2c_putreg(priv, S32K3XX_LPI2C_MSR_OFFSET, status &
|
||||||
(LPI2C_MSR_EPF | LPI2C_MSR_SDF));
|
(LPI2C_MSR_EPF | LPI2C_MSR_SDF));
|
||||||
|
|
||||||
|
/* Was it both End of packet and Stop */
|
||||||
|
|
||||||
|
if ((status & (LPI2C_MSR_EPF | LPI2C_MSR_SDF)) ==
|
||||||
|
(LPI2C_MSR_EPF | LPI2C_MSR_SDF))
|
||||||
|
{
|
||||||
#ifndef CONFIG_I2C_POLLED
|
#ifndef CONFIG_I2C_POLLED
|
||||||
if (priv->intstate == INTSTATE_WAITING)
|
if (priv->intstate == INTSTATE_WAITING)
|
||||||
{
|
{
|
||||||
@@ -1457,6 +1464,7 @@ static int s32k3xx_lpi2c_isr_process(struct s32k3xx_lpi2c_priv_s *priv)
|
|||||||
priv->intstate = INTSTATE_DONE;
|
priv->intstate = INTSTATE_DONE;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user