Skip to content

Commit 182a419

Browse files
committed
minor tweeks for 32e5, warning removal
1 parent f8ed784 commit 182a419

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

cores/xmega/wiring_analog.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ uint8_t mode;
348348
negpin = analogInputToAnalogPin(negpin + A0); // calc pin number (might not have 0 mapped to A0)
349349
#endif // analogInputToAnalogPin
350350
}
351-
351+
352352
if(negpin >= 0 && negpin <= 3)
353353
{
354354
mode = ADC_CH_INPUTMODE_DIFFWGAINL_gc;
@@ -364,6 +364,10 @@ uint8_t mode;
364364
negpin -= 4; // so that it's 0-3
365365
}
366366
}
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+
}
367371

368372
#else // NOT an 'E5'
369373

@@ -391,11 +395,11 @@ uint8_t mode;
391395
negpin = analogInputToAnalogPin(negpin + A0); // calc pin number (might not have 0 mapped to A0)
392396
#endif // analogInputToAnalogPin
393397
}
394-
398+
395399

396400
if(negpin >= 0 && negpin <= 3 && gain != ADC_CH_GAIN_1X_gc) // allow this *IF* gain is 1X
397401
{
398-
return 0; // dis-allowed combination
402+
return 0; // dis-allowed combination
399403
}
400404
else if(negpin >= 0 && negpin <= 3)
401405
{

variants/xmega32e5/pins_arduino.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,6 @@
126126

127127
// the first macro, 'digitalPinToInterrupt', is for the 'interruptNum' parameter in 'attachInterrupt' and 'detachInterrupt'
128128
// 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; }
132129

133130
#define digitalPinToInterrupt(p) \
134131
( pgm_read_byte(&port_to_int0_PGM[pgm_read_byte(&digital_pin_to_port_PGM[p])]) | \

0 commit comments

Comments
 (0)