File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,9 @@ void analogReference(uint8_t mode)
6969int analogRead (uint8_t pin )
7070{
7171 if (pin > NUM_ANALOG_INPUTS ) return NOT_A_PIN ;
72+
73+ /* Check if TWI is operating on double bonded pin */
74+ if (((pin == PIN_A4 ) || (pin == PIN_A5 )) && (TWI0 .MCTRLA & TWI_ENABLE_bm )) return 0 ;
7275
7376 uint8_t low , high ;
7477
@@ -117,6 +120,9 @@ void analogWrite(uint8_t pin, int val)
117120 uint8_t bit_pos = digitalPinToBitPosition (pin );
118121 if (bit_pos == NOT_A_PIN ) return ;
119122
123+ /* Special check for SPI_SS double bonded pin -- no action if SPI is active */
124+ if ((pin == 10 ) && (SPI0 .CTRLB & SPI_SSD_bm )) return ;
125+
120126 // We need to make sure the PWM output is enabled for those pins
121127 // that support it, as we turn it off when digitally reading or
122128 // writing with them. Also, make sure the pin is in output mode
You can’t perform that action at this time.
0 commit comments