-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
led.h
98 lines (82 loc) · 1.82 KB
/
led.h
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
* $Id$
*
* Copyright (C) 2003-2005 Antoine Drouin
*
* This file is part of paparazzi.
*
* paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* paparazzi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
/** \file led.h
* \brief arch independent LED (Light Emitting Diodes) API
*
*
*/
#ifndef LED_H
#define LED_H
#if defined USE_LED
#include "led_hw.h"
static inline void led_init ( void ) {
#if USE_LED_1
LED_INIT(1);
LED_OFF(1);
#endif /* LED_1 */
#if USE_LED_2
LED_INIT(2);
LED_OFF(2);
#endif /* LED_2 */
#if USE_LED_3
LED_INIT(3);
LED_OFF(3);
#endif /* LED_3 */
#if USE_LED_4
LED_INIT(4);
LED_OFF(4);
#endif /* LED_4 */
#if USE_LED_5
LED_INIT(5);
LED_OFF(5);
#endif /* LED_5 */
#if USE_LED_6
LED_INIT(6);
LED_OFF(6);
#endif /* LED_6 */
#if USE_LED_7
LED_INIT(7);
LED_OFF(7);
#endif /* LED_7 */
#if USE_LED_8
LED_INIT(8);
LED_OFF(8);
#endif /* LED_8 */
#ifdef LED_BODY_BANK
LED_INIT(BODY);
LED_OFF(BODY);
#endif /* LED_BODY_BANK */
#if USE_LED_12
LED_INIT(12);
LED_OFF(12);
#endif /* LED_12 */
}
#else /* USE_LED */
static inline void led_init ( void ) {}
#define LED_ON(i) {}
#define LED_OFF(i) {}
#define LED_TOGGLE(i) {}
#define LED_PERIODIC() {}
#endif /* USE_LED */
#endif /* LED_H */