diff options
author | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2009-05-27 20:45:39 +0000 |
---|---|---|
committer | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2009-05-27 20:45:39 +0000 |
commit | 9a1ec9abe689d7b8ef8f6bd9e5559db3cc767f6a (patch) | |
tree | 4f8b1b153ee4ef51692d8e9899284abcebdd0e41 /nuttx/arch/arm/src/lm3s/lm3s_ssi.c | |
parent | 1ff8652a39963faa3041d583d4db566a2dcb89b8 (diff) |
Integrating SHDC
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@1828 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/arch/arm/src/lm3s/lm3s_ssi.c')
-rwxr-xr-x | nuttx/arch/arm/src/lm3s/lm3s_ssi.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/nuttx/arch/arm/src/lm3s/lm3s_ssi.c b/nuttx/arch/arm/src/lm3s/lm3s_ssi.c index 4b9386c8a3..ae45dbf979 100755 --- a/nuttx/arch/arm/src/lm3s/lm3s_ssi.c +++ b/nuttx/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. * ****************************************************************************/ |