Skip to content

Commit c493ab1

Browse files
Allow for no PIN_LED for board variants
1 parent 47079e6 commit c493ab1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

cores/rp2040/cyw43_wrappers.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,11 @@ extern "C" void __digitalWrite(pin_size_t pin, PinStatus val);
171171
extern "C" PinStatus __digitalRead(pin_size_t pin);
172172

173173
extern "C" void cyw43_pinMode(pin_size_t pin, PinMode mode) {
174+
#if defined PIN_LED
174175
if (!__isPicoW && (pin == PIN_LED)) {
175176
pin = 25; // Silently swap in the Pico's LED
176177
}
178+
#endif
177179
if (pin < 64) {
178180
__pinMode(pin, mode);
179181
} else {
@@ -182,9 +184,11 @@ extern "C" void cyw43_pinMode(pin_size_t pin, PinMode mode) {
182184
}
183185

184186
extern "C" void cyw43_digitalWrite(pin_size_t pin, PinStatus val) {
187+
#if defined PIN_LED
185188
if (!__isPicoW && (pin == PIN_LED)) {
186189
pin = 25; // Silently swap in the Pico's LED
187190
}
191+
#endif
188192
if (pin < 64) {
189193
__digitalWrite(pin, val);
190194
} else {
@@ -193,9 +197,11 @@ extern "C" void cyw43_digitalWrite(pin_size_t pin, PinStatus val) {
193197
}
194198

195199
extern "C" PinStatus cyw43_digitalRead(pin_size_t pin) {
200+
#ifdef PIN_LED
196201
if (!__isPicoW && (pin == PIN_LED)) {
197202
pin = 25; // Silently swap in the Pico's LED
198203
}
204+
#endif
199205
if (pin < 64) {
200206
return __digitalRead(pin);
201207
} else {

platform.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ build.flags.libstdcpp=-lstdc++
106106
build.flags.exceptions=-fno-exceptions
107107
build.flags.stackprotect=
108108
build.libpico=libpico.a
109-
build.libpicow=libipv4.a
109+
build.libpicow=liblwip.a
110110
build.boot2=boot2_generic_03h_4_padded_checksum
111111
build.libpicowdefs=-DLWIP_IPV6=0 -DLWIP_IPV4=1
112112
build.wificc=-DWIFICC=CYW43_COUNTRY_WORLDWIDE

0 commit comments

Comments
 (0)