Skip to content

Commit 03903f9

Browse files
committed
[rtl872x] SPI hal: set sample delay for SPI0@25MHz
1 parent 917ed35 commit 03903f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hal/src/rtl872x/spi_hal.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ class Spi {
274274
u32 rtlClockDivider = 256;
275275
clockDivToRtlClockDiv(config_.clockDiv, &rtlClockDivider);
276276
SSI_SetBaudDiv(SPI_DEV_TABLE[rtlSpiIndex_].SPIx, rtlClockDivider);
277-
// Set sample delay for SPI0@50MHz
278-
if (rtlClockDivider == 2 && SPI_DEV_TABLE[rtlSpiIndex_].SPIx == SPI0_DEV) {
277+
// Set sample delay for SPI0@50MHz/25MHz
278+
if (rtlClockDivider <= 4 && SPI_DEV_TABLE[rtlSpiIndex_].SPIx == SPI0_DEV) {
279279
SSI_SetSampleDelay(SPI_DEV_TABLE[rtlSpiIndex_].SPIx, 0x1);
280280
} else {
281281
SSI_SetSampleDelay(SPI_DEV_TABLE[rtlSpiIndex_].SPIx, 0x0);

0 commit comments

Comments
 (0)