blob: b7f34a096ad3c7ec7622e1bd3db8e121ed746777 (
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
39
40
41
42
43
44
45
|
#include "project.h"
#define LED (GPIO6)
#define LED_PORT GPIOA
static unsigned led_ms;
void
led_init (void)
{
MAP_OUTPUT_PP (LED);
}
void
led_clear (void)
{
SET (LED);
}
void
led_set()
{
CLEAR (LED);
}
void led_blink (unsigned ms)
{
led_set();
led_ms = ms;
}
void
led_tick (void)
{
if (!led_ms) return;
led_ms--;
if (!led_ms) led_clear();
}
|