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)
69
69
int analogRead (uint8_t pin )
70
70
{
71
71
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 ;
72
75
73
76
uint8_t low , high ;
74
77
@@ -117,6 +120,9 @@ void analogWrite(uint8_t pin, int val)
117
120
uint8_t bit_pos = digitalPinToBitPosition (pin );
118
121
if (bit_pos == NOT_A_PIN ) return ;
119
122
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
+
120
126
// We need to make sure the PWM output is enabled for those pins
121
127
// that support it, as we turn it off when digitally reading or
122
128
// writing with them. Also, make sure the pin is in output mode
You can’t perform that action at this time.
0 commit comments