summaryrefslogtreecommitdiffstats
path: root/app/led.c
blob: 825bd0dcb68949cec70f0b328ecd90f20554ed13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "project.h"

#define LED (GPIO3)
#define LED_PORT GPIOB


void
led_init (void)
{

  MAP_OUTPUT_PP (LED);
}


void
led_clear (void)
{
  CLEAR (LED);
}

void
led_set()
{
  gpio_set (LED_PORT, LED);
}

void
led_slow_tick (void)
{
  static int c;

  c = !c;

  if (c)
    led_set();
  else
    led_clear();
}