summaryrefslogtreecommitdiff
path: root/nuttx/arch
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-05-27 20:45:39 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-05-27 20:45:39 +0000
commit541f8a338b93b1d1cc58573765de286cf441ee6f (patch)
tree4f8b1b153ee4ef51692d8e9899284abcebdd0e41 /nuttx/arch
parent45736d3dd038edade97535c9bbedfae4553c05e7 (diff)
downloadpx4-nuttx-541f8a338b93b1d1cc58573765de286cf441ee6f.tar.gz
px4-nuttx-541f8a338b93b1d1cc58573765de286cf441ee6f.tar.bz2
px4-nuttx-541f8a338b93b1d1cc58573765de286cf441ee6f.zip
Integrating SHDC
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1828 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch')
-rwxr-xr-xnuttx/arch/arm/src/lm3s/lm3s_ssi.c15
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 4b9386c8a..ae45dbf97 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.
*
****************************************************************************/