Skip to content

Commit 2fb08a0

Browse files
lurchkilograham
authored andcommitted
Let hello_double_tap run without an LED defined
1 parent 7915827 commit 2fb08a0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

system/hello_double_tap/hello_double_tap.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
// `pico_bootsel_via_double_reset` library!
1414

1515
int main() {
16-
#ifndef PICO_DEFAULT_LED_PIN
17-
#warning system/hello_double_tap example requires a board with a regular LED
18-
#else
16+
#ifdef PICO_DEFAULT_LED_PIN
1917
const uint LED_PIN = PICO_DEFAULT_LED_PIN;
2018
gpio_init(LED_PIN);
2119
gpio_set_dir(LED_PIN, GPIO_OUT);
@@ -25,5 +23,9 @@ int main() {
2523
gpio_put(LED_PIN, 0);
2624
sleep_ms(250);
2725
}
26+
#else
27+
while (true) {
28+
sleep_ms(250);
29+
}
2830
#endif
2931
}

0 commit comments

Comments
 (0)