summaryrefslogtreecommitdiff
path: root/hw/bsp
diff options
context:
space:
mode:
authorAndrew Scheller <[email protected]>2021-02-18 11:53:18 +0000
committerGitHub <[email protected]>2021-02-18 11:53:18 +0000
commit2145ab7664bc35c4e5ea24b28d6c4f4fa61fe375 (patch)
treec2772589478f49d67cfb77fe17a16bf9a4bbf973 /hw/bsp
parent1b849fc70a9dca3603b38828a3c37696efb1ebe0 (diff)
rp2040/family.c: allow LED_PIN to be undefined
Diffstat (limited to 'hw/bsp')
-rw-r--r--hw/bsp/rp2040/family.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/bsp/rp2040/family.c b/hw/bsp/rp2040/family.c
index 452e4771a..e42941483 100644
--- a/hw/bsp/rp2040/family.c
+++ b/hw/bsp/rp2040/family.c
@@ -110,8 +110,10 @@ void stdio_rtt_init(void)
void board_init(void)
{
+#ifdef LED_PIN
gpio_init(LED_PIN);
gpio_set_dir(LED_PIN, GPIO_OUT);
+#endif
// Button
#ifndef BUTTON_BOOTSEL
@@ -141,7 +143,9 @@ void board_init(void)
void board_led_write(bool state)
{
+#ifdef LED_PIN
gpio_put(LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
+#endif
}
uint32_t board_button_read(void)