aboutsummaryrefslogtreecommitdiff
path: root/src/kern/gpio/sysled.c
blob: d3e5f308f66a4c569eeaabd96afc5bb2e693b789 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "kern/gpio/sysled.h"

#define SYSLED GPIO_PIN_PB3

gpio_reserved_pin_t get_sysled()
{
  if (gpio_pin_in_use(SYSLED)) {
    return (gpio_reserved_pin_t){.v_ = SYSLED};
  }

  int ec;
  gpio_pin_opts_t opts = DEFAULT_GPIO_OPTS_OUTPUT;
  return reserve_gpio_pin(SYSLED, &opts, &ec);
}