You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2019/06/08 06:14:57 UTC

[mynewt-core] 02/10: bus/spi: Fix SS initialization value

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

commit 8ca54588bc3f46f4989ca0c4b98ad963297251f9
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Thu May 30 16:00:44 2019 +0200

    bus/spi: Fix SS initialization value
    
    0 can be valid pin number.
    set SS to -1 to avoid configuration of pin 0 to output.
---
 hw/bus/drivers/spi_hal/src/spi_hal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/bus/drivers/spi_hal/src/spi_hal.c b/hw/bus/drivers/spi_hal/src/spi_hal.c
index 2bf93fd..26c6db7 100644
--- a/hw/bus/drivers/spi_hal/src/spi_hal.c
+++ b/hw/bus/drivers/spi_hal/src/spi_hal.c
@@ -226,7 +226,7 @@ bus_spi_hal_dev_init_func(struct os_dev *odev, void *arg)
     hal_cfg.pin_sck = cfg->pin_sck;
     hal_cfg.pin_mosi = cfg->pin_mosi;
     hal_cfg.pin_miso = cfg->pin_miso;
-    hal_cfg.pin_ss = 0;
+    hal_cfg.pin_ss = -1;
 
     /* XXX we support master only! */
     rc = hal_spi_init_hw(cfg->spi_num, HAL_SPI_TYPE_MASTER, &hal_cfg);