Several patches from Petteri Aimonen
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5625 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
d5d770d0bc
commit
1ed1a4abcb
@ -511,7 +511,7 @@ static void spi_dmarxwait(FAR struct stm32_spidev_s *priv)
|
|||||||
* must not really have completed???
|
* must not really have completed???
|
||||||
*/
|
*/
|
||||||
|
|
||||||
while (sem_wait(&priv->rxsem) != 0 && priv->rxresult == 0)
|
while (sem_wait(&priv->rxsem) != 0 || priv->rxresult == 0)
|
||||||
{
|
{
|
||||||
/* The only case that an error should occur here is if the wait was awakened
|
/* The only case that an error should occur here is if the wait was awakened
|
||||||
* by a signal.
|
* by a signal.
|
||||||
@ -537,7 +537,7 @@ static void spi_dmatxwait(FAR struct stm32_spidev_s *priv)
|
|||||||
* must not really have completed???
|
* must not really have completed???
|
||||||
*/
|
*/
|
||||||
|
|
||||||
while (sem_wait(&priv->txsem) != 0 && priv->txresult == 0)
|
while (sem_wait(&priv->txsem) != 0 || priv->txresult == 0)
|
||||||
{
|
{
|
||||||
/* The only case that an error should occur here is if the wait was awakened
|
/* The only case that an error should occur here is if the wait was awakened
|
||||||
* by a signal.
|
* by a signal.
|
||||||
@ -731,6 +731,7 @@ static void spi_dmatxsetup(FAR struct stm32_spidev_s *priv, FAR const void *txbu
|
|||||||
#ifdef CONFIG_STM32_SPI_DMA
|
#ifdef CONFIG_STM32_SPI_DMA
|
||||||
static inline void spi_dmarxstart(FAR struct stm32_spidev_s *priv)
|
static inline void spi_dmarxstart(FAR struct stm32_spidev_s *priv)
|
||||||
{
|
{
|
||||||
|
priv->rxresult = 0;
|
||||||
stm32_dmastart(priv->rxdma, spi_dmarxcallback, priv, false);
|
stm32_dmastart(priv->rxdma, spi_dmarxcallback, priv, false);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -746,6 +747,7 @@ static inline void spi_dmarxstart(FAR struct stm32_spidev_s *priv)
|
|||||||
#ifdef CONFIG_STM32_SPI_DMA
|
#ifdef CONFIG_STM32_SPI_DMA
|
||||||
static inline void spi_dmatxstart(FAR struct stm32_spidev_s *priv)
|
static inline void spi_dmatxstart(FAR struct stm32_spidev_s *priv)
|
||||||
{
|
{
|
||||||
|
priv->txresult = 0;
|
||||||
stm32_dmastart(priv->txdma, spi_dmatxcallback, priv, false);
|
stm32_dmastart(priv->txdma, spi_dmatxcallback, priv, false);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user