Skip to content

Commit 2cba113

Browse files
committed
Fixing missing A0 pin test
Signed-off-by: Thibaut VIARD <[email protected]>
1 parent 0e6f63c commit 2cba113

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cores/arduino/wiring_analog.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ uint32_t analogRead( uint32_t ulPin )
8080
{
8181
uint32_t valueRead = 0;
8282

83+
if ( ulPin < A0 )
84+
{
85+
ulPin += A0 ;
86+
}
87+
8388
pinPeripheral(ulPin, g_APinDescription[ulPin].ulPinType);
8489

8590
ADC->INPUTCTRL.bit.MUXPOS = g_APinDescription[ulPin].ulADCChannelNumber;

0 commit comments

Comments
 (0)