Skip to content

Commit fcc4d6c

Browse files
CYFS3Rbb666
authored andcommitted
[bsp/renesas][drivers] Skip invalid chip select writes in SCI SPI
1 parent 0305faf commit fcc4d6c

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

  • bsp/renesas/libraries/HAL_Drivers/drivers

bsp/renesas/libraries/HAL_Drivers/drivers/drv_sci.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,17 @@ static rt_err_t ra_hw_spi_configure(struct rt_spi_device *device,
668668
#endif
669669

670670
/**< Configure Select Line */
671-
rt_pin_write(device->cs_pin, PIN_HIGH);
671+
if (!(configuration->mode & RT_SPI_NO_CS) && (device->cs_pin != PIN_NONE))
672+
{
673+
if (configuration->mode & RT_SPI_CS_HIGH)
674+
{
675+
rt_pin_write(device->cs_pin, PIN_LOW);
676+
}
677+
else
678+
{
679+
rt_pin_write(device->cs_pin, PIN_HIGH);
680+
}
681+
}
672682

673683
/**< config bitrate */
674684
#ifdef R_SCI_B_SPI_H

0 commit comments

Comments
 (0)