File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,9 @@ int analogRead(uint8_t pin)
70
70
{
71
71
if (pin > NUM_ANALOG_INPUTS ) return NOT_A_PIN ;
72
72
73
- /* Check if TWI is operating on double bonded pin */
73
+ /* Check if TWI is operating on double bonded pin (Master Enable is high
74
+ in both Master and Slave mode for bus error detection, so this can
75
+ indicate an active state for Wire) */
74
76
if (((pin == PIN_A4 ) || (pin == PIN_A5 )) && (TWI0 .MCTRLA & TWI_ENABLE_bm )) return 0 ;
75
77
76
78
uint8_t low , high ;
@@ -120,7 +122,8 @@ void analogWrite(uint8_t pin, int val)
120
122
uint8_t bit_pos = digitalPinToBitPosition (pin );
121
123
if (bit_pos == NOT_A_PIN ) return ;
122
124
123
- /* Special check for SPI_SS double bonded pin -- no action if SPI is active */
125
+ /* Special check for SPI_SS double bonded pin -- no action if SPI is active
126
+ (Using Slave Select Disable as indicator of SPI activity) */
124
127
if ((pin == 10 ) && (SPI0 .CTRLB & SPI_SSD_bm )) return ;
125
128
126
129
// We need to make sure the PWM output is enabled for those pins
You can’t perform that action at this time.
0 commit comments