File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -348,7 +348,7 @@ uint8_t mode;
348
348
negpin = analogInputToAnalogPin (negpin + A0 ); // calc pin number (might not have 0 mapped to A0)
349
349
#endif // analogInputToAnalogPin
350
350
}
351
-
351
+
352
352
if (negpin >= 0 && negpin <= 3 )
353
353
{
354
354
mode = ADC_CH_INPUTMODE_DIFFWGAINL_gc ;
@@ -364,6 +364,10 @@ uint8_t mode;
364
364
negpin -= 4 ; // so that it's 0-3
365
365
}
366
366
}
367
+ else
368
+ {
369
+ mode = ADC_CH_INPUTMODE_DIFFWGAINL_gc ; // see 24.15.2 section on 'MUXNEG' when using INTERNAL GND or PAD GND
370
+ }
367
371
368
372
#else // NOT an 'E5'
369
373
@@ -391,11 +395,11 @@ uint8_t mode;
391
395
negpin = analogInputToAnalogPin (negpin + A0 ); // calc pin number (might not have 0 mapped to A0)
392
396
#endif // analogInputToAnalogPin
393
397
}
394
-
398
+
395
399
396
400
if (negpin >= 0 && negpin <= 3 && gain != ADC_CH_GAIN_1X_gc ) // allow this *IF* gain is 1X
397
401
{
398
- return 0 ; // dis-allowed combination
402
+ return 0 ; // dis-allowed combination
399
403
}
400
404
else if (negpin >= 0 && negpin <= 3 )
401
405
{
Original file line number Diff line number Diff line change 126
126
127
127
// the first macro, 'digitalPinToInterrupt', is for the 'interruptNum' parameter in 'attachInterrupt' and 'detachInterrupt'
128
128
// the second macro, 'digitalPinToIntMode', is for the 'mode' parameter in 'attachInterrupt'.
129
- //#define digitalPinToInterrupt(p) \ this is an old attempt, leaving here for reference [for now]
130
- // { register uint8_t uiPort = pgm_read_byte((&digital_pin_to_port_PGM[p])); \
131
- // uiPort == _PD ? PORTD_INT0 : uiPort == _PC ? PORTC_INT0 : uiPort == _PA ? PORTA_INT0 : uiPort == _PR ? PORTR_INT0 : -1; }
132
129
133
130
#define digitalPinToInterrupt (p ) \
134
131
( pgm_read_byte(&port_to_int0_PGM[pgm_read_byte(&digital_pin_to_port_PGM[p])]) | \
You can’t perform that action at this time.
0 commit comments