mirror of
https://github.com/polhenarejos/pico-hsm.git
synced 2026-01-19 10:08:06 +00:00
Added sanity check for some boards without led.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
d12d18261f
commit
ade3e6d2fb
1 changed files with 6 additions and 0 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue