You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/11/20 13:35:04 UTC
[incubator-nuttx] 12/26: Fix chip/s32k3xx_lpi2c.c:624:3: error: unused function 's32k3xx_lpi2c_sem_waitstop'
This is an automated email from the ASF dual-hosted git repository.
pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 670c3e0e3572770b73535c6efe66100fcc5493fb
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sat Nov 19 12:36:10 2022 +0800
Fix chip/s32k3xx_lpi2c.c:624:3: error: unused function 's32k3xx_lpi2c_sem_waitstop'
Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
arch/arm/src/s32k3xx/s32k3xx_lpi2c.c | 97 ++----------------------------------
1 file changed, 3 insertions(+), 94 deletions(-)
diff --git a/arch/arm/src/s32k3xx/s32k3xx_lpi2c.c b/arch/arm/src/s32k3xx/s32k3xx_lpi2c.c
index 85172d187b..e1eb35a3f8 100644
--- a/arch/arm/src/s32k3xx/s32k3xx_lpi2c.c
+++ b/arch/arm/src/s32k3xx/s32k3xx_lpi2c.c
@@ -238,9 +238,7 @@ static uint32_t s32k3xx_lpi2c_toticks(int msgc, struct i2c_msg_s *msgs);
#endif /* CONFIG_S32K3XX_I2C_DYNTIMEO */
static inline int
- s32k3xx_lpi2c_sem_waitdone(struct s32k3xx_lpi2c_priv_s *priv);
-static inline void
- s32k3xx_lpi2c_sem_waitstop(struct s32k3xx_lpi2c_priv_s *priv);
+s32k3xx_lpi2c_sem_waitdone(struct s32k3xx_lpi2c_priv_s *priv);
#ifdef CONFIG_I2C_TRACE
static void s32k3xx_lpi2c_tracereset(struct s32k3xx_lpi2c_priv_s *priv);
@@ -470,7 +468,7 @@ static uint32_t s32k3xx_lpi2c_toticks(int msgc, struct i2c_msg_s *msgs)
#ifndef CONFIG_I2C_POLLED
static inline int
- s32k3xx_lpi2c_sem_waitdone(struct s32k3xx_lpi2c_priv_s *priv)
+s32k3xx_lpi2c_sem_waitdone(struct s32k3xx_lpi2c_priv_s *priv)
{
irqstate_t flags;
uint32_t regval;
@@ -561,7 +559,7 @@ static inline int
}
#else
static inline int
- s32k3xx_lpi2c_sem_waitdone(struct s32k3xx_lpi2c_priv_s *priv)
+s32k3xx_lpi2c_sem_waitdone(struct s32k3xx_lpi2c_priv_s *priv)
{
clock_t timeout;
clock_t start;
@@ -612,95 +610,6 @@ static inline int
}
#endif
-/****************************************************************************
- * Name: s32k3xx_lpi2c_sem_waitstop
- *
- * Description:
- * Wait for a STOP to complete
- *
- ****************************************************************************/
-
-static inline void
- s32k3xx_lpi2c_sem_waitstop(struct s32k3xx_lpi2c_priv_s *priv)
-{
- clock_t start;
- clock_t elapsed;
- clock_t timeout;
- uint32_t regval;
-
- /* Select a timeout */
-
-#ifdef CONFIG_S32K3XX_I2C_DYNTIMEO
- timeout = USEC2TICK(CONFIG_S32K3XX_I2C_DYNTIMEO_STARTSTOP);
-#else
- timeout = CONFIG_S32K3XX_I2CTIMEOTICKS;
-#endif
-
- /* Wait as stop might still be in progress; but stop might also
- * be set because of a timeout error: "The [STOP] bit is set and
- * cleared by software, cleared by hardware when a Stop condition is
- * detected, set by hardware when a timeout error is detected."
- */
-
- start = clock_systime_ticks();
- do
- {
- /* Calculate the elapsed time */
-
- elapsed = clock_systime_ticks() - start;
-
- /* Check for STOP condition */
-
- if (priv->config->mode == LPI2C_MASTER)
- {
- regval = s32k3xx_lpi2c_getreg(priv, S32K3XX_LPI2C_MSR_OFFSET);
- if ((regval & LPI2C_MSR_SDF) == LPI2C_MSR_SDF)
- {
- return;
- }
- }
-
- /* Enable Interrupts when slave mode */
-
- else
- {
- regval = s32k3xx_lpi2c_getreg(priv, S32K3XX_LPI2C_SSR_OFFSET);
- if ((regval & LPI2C_SSR_SDF) == LPI2C_SSR_SDF)
- {
- return;
- }
- }
-
- /* Check for NACK error */
-
- if (priv->config->mode == LPI2C_MASTER)
- {
- regval = s32k3xx_lpi2c_getreg(priv, S32K3XX_LPI2C_MSR_OFFSET);
- if ((regval & LPI2C_MSR_NDF) == LPI2C_MSR_NDF)
- {
- return;
- }
- }
-
- /* Enable Interrupts when slave mode */
-
- else
- {
-#warning Missing logic for I2C Slave
- }
- }
-
- /* Loop until the stop is complete or a timeout occurs. */
-
- while (elapsed < timeout);
-
- /* If we get here then a timeout occurred with the STOP condition
- * still pending.
- */
-
- i2cinfo("Timeout with Status Register: %" PRIx32 "\n", regval);
-}
-
/****************************************************************************
* Name: s32k3xx_lpi2c_trace*
*