Skip to content

Commit ab412b0

Browse files
committed
Apply Apollo3 pin mapping
1 parent 7e182a8 commit ab412b0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Adafruit_NeoPixel.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2169,14 +2169,17 @@ void Adafruit_NeoPixel::show(void) {
21692169
void Adafruit_NeoPixel::setPin(uint16_t p) {
21702170
if(begun && (pin >= 0)) {
21712171
#if defined(AM_PART_APOLLO3)
2172+
// The pin has already been mapped to the Apollo3 pad
21722173
apollo3UnsetPin(pin);
21732174
#endif
21742175
pinMode(pin, INPUT);
21752176
}
2176-
pin = p;
21772177
#if defined(AM_PART_APOLLO3)
2178-
apollo3SetPin(pin);
2178+
// Map the specified pin to the Apollo3 pad
2179+
p = ap3_gpio_pin2pad(p);
2180+
apollo3SetPin(p);
21792181
#endif
2182+
pin = p;
21802183
if(begun) {
21812184
pinMode(p, OUTPUT);
21822185
digitalWrite(p, LOW);

0 commit comments

Comments
 (0)