Added sanity check for some boards without led.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos 2022-03-25 17:58:57 +01:00
parent d12d18261f
commit ade3e6d2fb
No known key found for this signature in database
GPG key ID: C0095B7870A4CCD3

View file

@ -1570,6 +1570,7 @@ void tud_mount_cb()
void led_blinking_task()
{
#ifdef PICO_DEFAULT_LED_PIN
static uint32_t start_ms = 0;
static uint8_t led_state = false;
static uint8_t led_color = PICO_DEFAULT_LED_PIN;
@ -1587,6 +1588,7 @@ void led_blinking_task()
gpio_put(led_color, led_state);
led_state ^= 1; // toggle
#endif
}
void led_off_all()
@ -1596,8 +1598,10 @@ void led_off_all()
gpio_put(TINY2040_LED_G_PIN, 1);
gpio_put(TINY2040_LED_B_PIN, 1);
#else
#ifdef PICO_DEFAULT_LED_PIN
gpio_put(PICO_DEFAULT_LED_PIN, 0);
#endif
#endif
}
extern void neug_task();
@ -1619,8 +1623,10 @@ int main(void)
gpio_init(TINY2040_LED_B_PIN);
gpio_set_dir(TINY2040_LED_B_PIN, GPIO_OUT);
#else
#ifdef PICO_DEFAULT_LED_PIN
gpio_init(PICO_DEFAULT_LED_PIN);
gpio_set_dir(PICO_DEFAULT_LED_PIN, GPIO_OUT);
#endif
#endif
led_off_all();