Skip to content

Commit cfd1809

Browse files
dhalberttannewt
authored andcommitted
Suppress A0 (PA02) as a TouchIn-capable pin on CPX.
1 parent 922006d commit cfd1809

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

atmel-samd/boards/circuitplayground_express/mpconfigboard.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#define MICROPY_HW_BOARD_NAME "Adafruit CircuitPlayground Express"
44
#define MICROPY_HW_MCU_NAME "samd21g18"
55

6+
// Don't allow touch on A0 (PA02), because it's connected to the speaker.
7+
#define PA02_NO_TOUCH (true)
8+
69
// Salae reads 12mhz which is the limit even though we set it to the safer 8mhz.
710
#define SPI_FLASH_BAUDRATE (8000000)
811

atmel-samd/samd21_pins.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,13 @@ PIN(PA01, EXTINT_CHANNEL(1), NO_ADC, NO_TOUCH,
8484
SERCOM(SERCOM1, 1));
8585
#endif
8686
#ifdef PIN_PA02
87-
PIN(PA02, EXTINT_CHANNEL(2), ADC_INPUT(ADC_POSITIVE_INPUT_PIN0), TOUCH(0),
87+
// Touch is not allowed on A0 (PA02) on Circuit Playground Express.
88+
PIN(PA02, EXTINT_CHANNEL(2), ADC_INPUT(ADC_POSITIVE_INPUT_PIN0),
89+
#ifdef PA02_NO_TOUCH
90+
NO_TOUCH,
91+
#else
92+
TOUCH(0),
93+
#endif
8894
NO_TIMER,
8995
NO_TIMER,
9096
NO_SERCOM,

0 commit comments

Comments
 (0)