From fb594f8f5df5037c96030b4480365d541f0127a5 Mon Sep 17 00:00:00 2001 From: Wielebny666 <31576684+Wielebny666@users.noreply.github.com> Date: Tue, 23 Jun 2020 16:02:50 +0200 Subject: [PATCH] spi_master: correctly set cs polarity All devices must be added to the same spi line before use. --- components/soc/include/hal/spi_ll.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/soc/include/hal/spi_ll.h b/components/soc/include/hal/spi_ll.h index 0213d6dc12..2784aabf6a 100644 --- a/components/soc/include/hal/spi_ll.h +++ b/components/soc/include/hal/spi_ll.h @@ -275,7 +275,7 @@ static inline void spi_ll_master_set_pos_cs(spi_dev_t *hw, int cs, uint32_t pos_ if (pos_cs) { hw->pin.master_cs_pol |= (1 << cs); } else { - hw->pin.master_cs_pol &= (1 << cs); + hw->pin.master_cs_pol &= ~(1 << cs); } } @@ -599,7 +599,7 @@ static inline void spi_ll_master_set_cksel(spi_dev_t *hw, int cs, uint32_t cksel if (cksel) { hw->pin.master_ck_sel |= (1 << cs); } else { - hw->pin.master_ck_sel &= (1 << cs); + hw->pin.master_ck_sel &= ~(1 << cs); } }