Skip to content

Commit 1e7306d

Browse files
Roy, ElizabethRoy, Elizabeth
authored andcommitted
Changed bit to check to indicate SPI activity
1 parent e1e8bdc commit 1e7306d

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

cores/arduino/wiring_analog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ void analogWrite(uint8_t pin, int val)
123123
if(bit_pos == NOT_A_PIN) return;
124124

125125
/* Special check for SPI_SS double bonded pin -- no action if SPI is active
126-
(Using Slave Select Disable as indicator of SPI activity) */
127-
if((pin == 10) && (SPI0.CTRLB & SPI_SSD_bm)) return;
126+
(Using SPI Enable bit as indicator of SPI activity) */
127+
if((pin == 10) && (SPI0.CTRLA & SPI_ENABLE_bm)) return;
128128

129129
/* Check if TWI is operating on double bonded pin (Master Enable is high
130130
in both Master and Slave mode for bus error detection, so this can

cores/arduino/wiring_digital.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ void pinMode(uint8_t pin, PinMode mode)
3838
if(((pin == PIN_A4) || (pin == PIN_A5)) && (TWI0.MCTRLA & TWI_ENABLE_bm)) return;
3939

4040
/* Special check for SPI_SS double bonded pin -- no action if SPI is active
41-
(Using Slave Select Disable as indicator of SPI activity) */
42-
if((pin == 10) && (SPI0.CTRLB & SPI_SSD_bm)) return;
41+
(Using SPI Enable bit as indicator of SPI activity) */
42+
if((pin == 10) && (SPI0.CTRLA & SPI_ENABLE_bm)) return;
4343

4444
PORT_t* port = digitalPinToPortStruct(pin);
4545
if(port == NULL) return;
@@ -153,8 +153,8 @@ void digitalWrite(uint8_t pin, PinStatus val)
153153
if(((pin == PIN_A4) || (pin == PIN_A5)) && (TWI0.MCTRLA & TWI_ENABLE_bm)) return;
154154

155155
/* Special check for SPI_SS double bonded pin -- no action if SPI is active
156-
(Using Slave Select Disable as indicator of SPI activity) */
157-
if((pin == 10) && (SPI0.CTRLB & SPI_SSD_bm)) return;
156+
(Using SPI Enable bit as indicator of SPI activity) */
157+
if((pin == 10) && (SPI0.CTRLA & SPI_ENABLE_bm)) return;
158158

159159
/* Turn off PWM if applicable */
160160

@@ -235,8 +235,8 @@ PinStatus digitalRead(uint8_t pin)
235235
if(((pin == PIN_A4) || (pin == PIN_A5)) && (TWI0.MCTRLA & TWI_ENABLE_bm)) return LOW;
236236

237237
/* Special check for SPI_SS double bonded pin -- no action if SPI is active
238-
(Using Slave Select Disable as indicator of SPI activity) */
239-
if((pin == 10) && (SPI0.CTRLB & SPI_SSD_bm)) return LOW;
238+
(Using SPI Enable bit as indicator of SPI activity) */
239+
if((pin == 10) && (SPI0.CTRLA & SPI_ENABLE_bm)) return;
240240

241241
// If the pin that support PWM output, we need to turn it off
242242
// before getting a digital reading.

0 commit comments

Comments
 (0)