4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-02-19 05:51:24 +08:00

Update drv_spi.c

This commit is contained in:
LiuKang 2021-10-11 17:45:37 +08:00 committed by GitHub
parent 3c32e0168d
commit 93792b2c84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -293,9 +293,9 @@ static rt_uint32_t spixfer(struct rt_spi_device *device, struct rt_spi_message *
if (message->cs_take && !(device->config.mode & RT_SPI_NO_CS))
{
if(device->config.mode & RT_SPI_CS_HIGH)
if (device->config.mode & RT_SPI_CS_HIGH)
HAL_GPIO_WritePin(cs->GPIOx, cs->GPIO_Pin, GPIO_PIN_SET);
else
else
HAL_GPIO_WritePin(cs->GPIOx, cs->GPIO_Pin, GPIO_PIN_RESET);
}
@ -390,7 +390,7 @@ static rt_uint32_t spixfer(struct rt_spi_device *device, struct rt_spi_message *
if (message->cs_release && !(device->config.mode & RT_SPI_NO_CS))
{
if(device->config.mode & RT_SPI_CS_HIGH)
if (device->config.mode & RT_SPI_CS_HIGH)
HAL_GPIO_WritePin(cs->GPIOx, cs->GPIO_Pin, GPIO_PIN_RESET);
else
HAL_GPIO_WritePin(cs->GPIOx, cs->GPIO_Pin, GPIO_PIN_SET);