You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2020/07/19 18:49:31 UTC

[incubator-nuttx] 06/07: AVR: Remove warning pragma from SPI freq function

This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 8319078887beb749ab24f283e50c3f004c1d449b
Author: Brennan Ashton <ba...@brennanashton.com>
AuthorDate: Sun Jul 19 17:21:36 2020 +0000

    AVR: Remove warning pragma from SPI freq function
    
    The function for updating the spi frequency included a #warning
    pragma because the divider registers are computed but not used
    it is not clear what needs to be done here to implement this
    but the warning has been removed and replaced with a comment
    in the function.
    
    Signed-off-by: Brennan Ashton <ba...@brennanashton.com>
---
 arch/avr/src/avr/up_spi.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/avr/src/avr/up_spi.c b/arch/avr/src/avr/up_spi.c
index dd58ed6..09334ad 100644
--- a/arch/avr/src/avr/up_spi.c
+++ b/arch/avr/src/avr/up_spi.c
@@ -188,11 +188,15 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev,
   FAR struct avr_spidev_s *priv = (FAR struct avr_spidev_s *)dev;
   uint32_t actual;
 
+  /* TODO: This is missing the actual logic to update the frequency.
+   * The divider bits are computed but not actually used.
+   */
+
   /* Has the request frequency changed? */
 
   if (frequency != priv->frequency)
     {
-      /* Read the SPI status and control registers, clearing all divider bits */
+      /* Read the SPI status and control registers, clearing all div bits */
 
       uint8_t spcr = SPCR & ~((1 << SPR0) | (1 << SPR1));
       uint8_t spsr = SPSR & ~(1 << SPI2X);
@@ -236,8 +240,6 @@ static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev,
           actual = BOARD_CPU_CLOCK / 128;
         }
 
-#warning REVISIT: spcr/spsr are never used
-
       /* Save the frequency setting */
 
       priv->frequency = frequency;