forked from schneider42/moodlamp-rf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathleds.c
66 lines (54 loc) · 964 Bytes
/
leds.c
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include <avr/io.h>
#include <avr/interrupt.h>
#include "leds.h"
#include "config.h"
#include "pinutils.h"
void leds_init(void)
{
DDR_CONFIG_OUT(LED1);
DDR_CONFIG_OUT(LED2);
DDR_CONFIG_OUT(LED3);
PIN_SET(LED2);
}
inline void leds_rx(void)
{
uint8_t sreg = SREG; cli();
PIN_SET(LED2);
SREG = sreg;
}
inline void leds_rxend(void)
{
uint8_t sreg = SREG; cli();
PIN_CLEAR(LED2);
SREG = sreg;
}
inline void leds_adc(void)
{
// uint8_t sreg = SREG; cli();
// PIN_SET(LED1);
// SREG = sreg;
}
inline void leds_adcend(void)
{
// uint8_t sreg = SREG; cli();
// PIN_CLEAR(LED1);
// SREG = sreg;
}
inline void leds_tx(void)
{
uint8_t sreg = SREG; cli();
PIN_SET(LED3);
SREG = sreg;
}
inline void leds_txend(void)
{
uint8_t sreg = SREG; cli();
PIN_CLEAR(LED3);
SREG = sreg;
}
inline void leds_main(void)
{
uint8_t sreg = SREG; cli();
PIN_TOGGLE(LED1);
SREG = sreg;
}