LPC1300 的示例代码, 有个写法看不明白?求大虾指点

2019-03-25 20:27发布

/*****************************************************************************
** Function name:                SSPSend
**
** Descriptions:                Send a block of data to the SSP port, the
**                                                first parameter is the buffer pointer, the 2nd
**                                                parameter is the block length.
**
** parameters:                        buffer pointer, and the block length
** Returned value:                None
**
*****************************************************************************/
void SSPSend( uint8_t *buf, uint32_t Length )
{
  uint32_t i;
  uint8_t Dummy = Dummy;                 ------------------------------这步含义是什么?

  for ( i = 0; i < Length; i++ )
  {
        /* Move on only if NOT busy and TX FIFO not full. */
        while ( (LPC_SSP0->SR & (SSPSR_TNF|SSPSR_BSY)) != SSPSR_TNF );
        LPC_SSP0->DR = *buf;
        buf++;
#if !LOOPBACK_MODE
        while ( (LPC_SSP0->SR & (SSPSR_BSY|SSPSR_RNE)) != SSPSR_RNE );
        /* Whenever a byte is written, MISO FIFO counter increments, Clear FIFO
        on MISO. Otherwise, when SSP0Receive() is called, previous data byte
        is left in the FIFO. */
        Dummy = LPC_SSP0->DR;      
#else
        /* Wait until the Busy bit is cleared. */
        while ( LPC_SSP0->SR & SSPSR_BSY );
#endif
  }
  return;
} 此帖出自小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
2条回答
zhaojun_xf
1楼-- · 2019-03-26 02:05
_NXP LPC1000_ 防止编译器报警,提示此变量没有被使用。
lmy_asi
2楼-- · 2019-03-26 05:19
 精彩回答 2  元偷偷看……

一周热门 更多>