From 19cdfc42a4a34affad00d48070a32e173d39efda Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 27 May 2009 20:45:39 +0000 Subject: [PATCH] Integrating SHDC git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1828 42af7a65-404d-4744-a932-0658087f49c3 --- arch/arm/src/lm3s/lm3s_ssi.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/arch/arm/src/lm3s/lm3s_ssi.c b/arch/arm/src/lm3s/lm3s_ssi.c index 4b9386c8a3e..ae45dbf9792 100755 --- a/arch/arm/src/lm3s/lm3s_ssi.c +++ b/arch/arm/src/lm3s/lm3s_ssi.c @@ -426,7 +426,7 @@ static void ssi_semtake(sem_t *sem) static void ssi_txnull(struct lm32_ssidev_s *priv) { - ssivdbg("TX: ones\n"); + ssivdbg("TX: ->0xffff\n"); ssi_putreg(priv, LM3S_SSI_DR_OFFSET, 0xffff); } @@ -545,7 +545,9 @@ static inline boolean ssi_rxfifoempty(struct lm32_ssidev_s *priv) static int ssi_performtx(struct lm32_ssidev_s *priv) { +#ifndef CONFIG_SSI_POLLWAIT uint32 regval; +#endif int ntxd = 0; /* Number of words written to Tx FIFO */ /* Check if the Tx FIFO is full */ @@ -559,8 +561,15 @@ static int ssi_performtx(struct lm32_ssidev_s *priv) /* No.. Transfer more words until either the Tx FIFO is full or * until all of the user provided data has been sent. */ - +#if 1 + /* Further limit the number of words that we put into the Tx + * FIFO to half the half the FIFO depth. Otherwise, we could + * overrun the Rx FIFO on a very fast SSI bus. + */ + for (; ntxd < priv->ntxwords && ntxd < LM3S_TXFIFO_WORDS/2 && !ssi_txfifofull(priv); ntxd++) +#else for (; ntxd < priv->ntxwords && !ssi_txfifofull(priv); ntxd++) +#endif { priv->txword(priv); } @@ -809,7 +818,7 @@ static int ssi_transfer(struct lm32_ssidev_s *priv, const void *txbuffer, * * Returned Value: * On success, a reference to the private data structgure for this IRQ. - * NULL on failrue. + * NULL on failure. * ****************************************************************************/