From c66ce46950ba05355c25070ccd62b083fc2df1a7 Mon Sep 17 00:00:00 2001 From: Eric Berseth Date: Thu, 4 Feb 2021 12:32:51 -0800 Subject: [PATCH] Fix default assignment for SPI chip select --- hal/network/lwip/wiznet/wiznetif.cpp | 8 -------- hal/shared/spi_lock.h | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/hal/network/lwip/wiznet/wiznetif.cpp b/hal/network/lwip/wiznet/wiznetif.cpp index 2006bb3bca..7990b89f43 100644 --- a/hal/network/lwip/wiznet/wiznetif.cpp +++ b/hal/network/lwip/wiznet/wiznetif.cpp @@ -128,14 +128,6 @@ WizNetif::WizNetif(hal_spi_interface_t spi, pin_t cs, pin_t reset, pin_t interru /* There is an external 10k pull-up */ HAL_Pin_Mode(interrupt_, INPUT); - if (!hal_spi_is_enabled(spi_)) { - hal_spi_init(spi_); - // Make sure the SPI peripheral is initialized with default settings - hal_spi_acquire(spi_, nullptr); - hal_spi_begin_ext(spi_, SPI_MODE_MASTER, SPI_DEFAULT_SS, nullptr); - hal_spi_release(spi_, nullptr); - } - SPARK_ASSERT(os_semaphore_create(&spiSem_, 1, 0) == 0); reg_wizchip_cris_cbfunc( diff --git a/hal/shared/spi_lock.h b/hal/shared/spi_lock.h index fb09855271..4f8e0ab3a0 100644 --- a/hal/shared/spi_lock.h +++ b/hal/shared/spi_lock.h @@ -50,7 +50,7 @@ class SpiConfigurationLock { hal_spi_init(spi_); // Make sure the SPI peripheral is initialized with default settings hal_spi_acquire(spi_, nullptr); - hal_spi_begin_ext(spi_, SPI_MODE_MASTER, SPI_DEFAULT_SS, nullptr); + hal_spi_begin_ext(spi_, SPI_MODE_MASTER, PIN_INVALID, nullptr); } else { hal_spi_acquire(spi_, nullptr); }