arch/z80/src/ez80/ez80_spi.c: Correct oversight in previous commit

Commit 797e45d6bf attempted to reduce the frequency of SPI reconfiguration by keeping track of the current frequency and mode settings and changing these settings only when the new settings differ from the old settings.

However, the original commit neglected to save the new frequency setting and, hence, was not effective in what it was trying to do:  Every time the SPI setfrequency() method was called, it still looked like a new frequency and the frequency was still reconfigured, even though it hadn't really changed.
This commit is contained in:
Gregory Nutt 2020-03-06 17:52:50 -06:00 committed by Abdelatif Guettouche
parent c0e8afc531
commit 78563d555a
2 changed files with 6 additions and 9 deletions

View File

@ -236,7 +236,8 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev,
outp(EZ80_SPI_BRG_L, brg & 0xff);
outp(EZ80_SPI_BRG_H, (brg >> 8) & 0xff);
g_spi_actual = ((EZ80_SYS_CLK_FREQ + 1) / 2 + brg - 1) / brg;
g_spi_frequency = frequency;
g_spi_actual = ((EZ80_SYS_CLK_FREQ + 1) / 2 + brg - 1) / brg;
finfo("BRG=%lu Actual=%lu\n",
(unsigned long)brg, (unsigned long)g_spi_actual);
@ -580,10 +581,10 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer,
* prior to calling this function. Specifically: GPIOs should have
* been configured for output, and all chip selects disabled.
*
* One GPIO, SS (PB2 on the eZ8F091) is reserved as a chip select. However,
* If multiple devices on on the bus, then multiple chip selects will be
* required. Therefore, all GPIO chip management is deferred to board-
* specific logic.
* One GPIO, SS (PB2 on the eZ8F091) is reserved as a chip select.
* However, if multiple devices on on the bus, then multiple chip
* selects will be required. Therefore, all GPIO chip management is
* deferred to board-specific logic.
*
* Input Parameters:
* Port number (for hardware that has multiple SPI interfaces)

View File

@ -86,10 +86,6 @@
* Chip select 3 is not used
*/
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* RAM Memory map
*
* 040000 Beginning of RAM