Skip to content

Commit

Permalink
Fix default assignment for SPI chip select
Browse files Browse the repository at this point in the history
  • Loading branch information
eberseth committed Feb 11, 2021
1 parent 21407ef commit c66ce46
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
8 changes: 0 additions & 8 deletions hal/network/lwip/wiznet/wiznetif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion hal/shared/spi_lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit c66ce46

Please sign in to comment.