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

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new aa8960948 bus/spi_apollo3: Fix SPI frequency setting
aa8960948 is described below

commit aa89609484101ff6b3e0409e7891372ccd393ece
Author: Jerzy Kasenberg <jerzy.kasenb...@codecoup.pl>
AuthorDate: Fri Mar 3 11:40:20 2023 +0100

    bus/spi_apollo3: Fix SPI frequency setting
    
    bus_spi_node seems to keep SPI frequency in kHz while
    hal_spi_settings keeps it in Hz.
    
    This just converts frequency to Hz before calling hal_spi_config.
---
 hw/bus/drivers/spi_apollo3/src/spi_apollo3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/bus/drivers/spi_apollo3/src/spi_apollo3.c 
b/hw/bus/drivers/spi_apollo3/src/spi_apollo3.c
index 44bee8e6f..c7f029cac 100644
--- a/hw/bus/drivers/spi_apollo3/src/spi_apollo3.c
+++ b/hw/bus/drivers/spi_apollo3/src/spi_apollo3.c
@@ -107,7 +107,7 @@ bus_spi_configure(struct bus_dev *bdev, struct bus_node 
*bnode)
 
     spi_cfg.data_mode = node->mode;
     spi_cfg.data_order = node->data_order;
-    spi_cfg.baudrate = node->freq;
+    spi_cfg.baudrate = node->freq * 1000;
     /* XXX add support for other word sizes */
     spi_cfg.word_size = HAL_SPI_WORD_SIZE_8BIT;
 

Reply via email to