From cb7dd37f781ffa161b0db3e3872ee25689d4348e Mon Sep 17 00:00:00 2001 From: Stuart Ianna Date: Fri, 5 Apr 2024 15:02:25 +1100 Subject: [PATCH] system/spi: Set SPI delay characteristics to zero when enabled. Previously, when delay control was enabled, spi_transfer would pass junk values down to the underlying driver because these values where not initialized. Setting them to zero provides a predictable result considering they are not controlled by this tool. --- system/spi/spi_exch.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/system/spi/spi_exch.c b/system/spi/spi_exch.c index 31db5d83e..1a898484e 100644 --- a/system/spi/spi_exch.c +++ b/system/spi/spi_exch.c @@ -154,6 +154,13 @@ int spicmd_exch(FAR struct spitool_s *spitool, int argc, FAR char **argv) seq.ntrans = 1; seq.trans = &trans; +#ifdef CONFIG_SPI_DELAY_CONTROL + seq.a = 0; + seq.b = 0; + seq.i = 0; + seq.c = 0; +#endif + trans.deselect = true; #ifdef CONFIG_SPI_CMDDATA trans.cmd = spitool->command;