Skip to content

Commit e6410c9

Browse files
committed
[SPI] Fix spurious HW SS assignment
Fixes arduino-libraries/WiFiNINA#60
1 parent c4a0ada commit e6410c9

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

libraries/SPI/src/SPI.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@ void SPIClass::begin()
4444

4545
PORTMUX.TWISPIROUTEA |= _uc_mux;
4646

47-
// We don't need HW SS since salve/master mode is selected via registers, so make it simply INPUT
48-
pinMode(_uc_pinSS, INPUT);
4947
pinMode(_uc_pinMosi, OUTPUT);
5048
pinMode(_uc_pinSCK, OUTPUT);
5149
// MISO is set to input by the controller
5250

51+
// We don't need HW SS since salve/master mode is selected via registers
5352
SPI0.CTRLB |= (SPI_SSD_bm);
5453
SPI0.CTRLA |= (SPI_ENABLE_bm | SPI_MASTER_bm);
5554

variants/nona4809/pins_arduino.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
#define PIN_SPI_MISO (12)
4545
#define PIN_SPI_SCK (13)
4646
#define PIN_SPI_MOSI (11)
47-
#define PIN_SPI_SS (10)
47+
#define PIN_SPI_SS (8)
4848

4949
static const uint8_t SS = PIN_SPI_SS;
5050
static const uint8_t MOSI = PIN_SPI_MOSI;

variants/uno2018/pins_arduino.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#define PIN_SPI_MISO (33)
4646
#define PIN_SPI_SCK (34)
4747
#define PIN_SPI_MOSI (32)
48-
#define PIN_SPI_SS (10)
48+
#define PIN_SPI_SS (22)
4949

5050
static const uint8_t SS = PIN_SPI_SS;
5151
static const uint8_t MOSI = PIN_SPI_MOSI;

0 commit comments

Comments
 (0)