|
@@ -332,12 +332,12 @@ void myRadio_gpio_init(RADIO_GPIO_CALLBACK cb)
|
|
|
uint8_t myRadioSpi_rwByte(uint8_t byteToWrite)
|
|
uint8_t myRadioSpi_rwByte(uint8_t byteToWrite)
|
|
|
{
|
|
{
|
|
|
#if defined(SPI_HARD)
|
|
#if defined(SPI_HARD)
|
|
|
- uint8_t i, temp;
|
|
|
|
|
|
|
+ uint32_t i, temp;
|
|
|
temp = 0;
|
|
temp = 0;
|
|
|
while (SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_TXE) == RESET) //检查指定的SPI标志位设置与否:发送缓存空标志位
|
|
while (SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_TXE) == RESET) //检查指定的SPI标志位设置与否:发送缓存空标志位
|
|
|
{
|
|
{
|
|
|
i++;
|
|
i++;
|
|
|
- if(i > 200)return 0;
|
|
|
|
|
|
|
+ if(i > 20000)return 0;
|
|
|
}
|
|
}
|
|
|
SPI_I2S_SendData(SPI1, byteToWrite); //通过外设SPIx发送一个数据
|
|
SPI_I2S_SendData(SPI1, byteToWrite); //通过外设SPIx发送一个数据
|
|
|
i=0;
|
|
i=0;
|
|
@@ -345,7 +345,7 @@ uint8_t myRadioSpi_rwByte(uint8_t byteToWrite)
|
|
|
while (SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_RXNE) == RESET)//检查指定的SPI标志位设置与否:接受缓存非空标志位
|
|
while (SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_RXNE) == RESET)//检查指定的SPI标志位设置与否:接受缓存非空标志位
|
|
|
{
|
|
{
|
|
|
i++;
|
|
i++;
|
|
|
- if(i > 200)return 0;
|
|
|
|
|
|
|
+ if(i > 20000)return 0;
|
|
|
}
|
|
}
|
|
|
/*!< Return the byte read from the SPI bus */
|
|
/*!< Return the byte read from the SPI bus */
|
|
|
temp = SPI_I2S_ReceiveData(SPI1);
|
|
temp = SPI_I2S_ReceiveData(SPI1);
|