fixup examples based on default pin #define-s and also support them being undefined

This commit is contained in:
graham sanderson
2021-02-28 09:00:36 -06:00
committed by Graham Sanderson
parent 9c7e31b8e7
commit 82b6dc0576
10 changed files with 101 additions and 43 deletions

View File

@@ -10,6 +10,9 @@
#include "hello.pio.h"
int main() {
#ifndef PICO_DEFAULT_LED_PIN
#warning pio/hello_pio example requires a board with a regular LED
#else
// Choose which PIO instance to use (there are two instances)
PIO pio = pio0;
@@ -35,4 +38,5 @@ int main() {
pio_sm_put_blocking(pio, sm, 0);
sleep_ms(500);
}
#endif
}