Fix examples to build cleanly if PICO_DEFAULT_LED_PIN isn't defined
This commit is contained in:
committed by
Graham Sanderson
parent
482d9657d3
commit
4d7882bc59
@@ -13,6 +13,9 @@
|
||||
// `pico_bootsel_via_double_reset` library!
|
||||
|
||||
int main() {
|
||||
#ifndef PICO_DEFAULT_LED_PIN
|
||||
#warning system/hello_double_tap example requires a board with a regular LED
|
||||
#else
|
||||
const uint LED_PIN = PICO_DEFAULT_LED_PIN;
|
||||
gpio_init(LED_PIN);
|
||||
gpio_set_dir(LED_PIN, GPIO_OUT);
|
||||
@@ -22,4 +25,5 @@ int main() {
|
||||
gpio_put(LED_PIN, 0);
|
||||
sleep_ms(250);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user