Blackbox device type 'file' (SITL) considered working when file handler is available
[inav.git] / src / main / drivers / light_led.h
blobe8507a16455ecd22990f7f3c4145e58963107086
1 /*
2 * This file is part of Cleanflight.
4 * Cleanflight is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Cleanflight is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
18 #pragma once
20 #define LED_NUMBER 3
22 // Helpful macros
23 #ifdef LED0
24 # define LED0_TOGGLE ledToggle(0)
25 # define LED0_OFF ledSet(0, false)
26 # define LED0_ON ledSet(0, true)
27 #else
28 # define LED0_TOGGLE do {} while (0)
29 # define LED0_OFF do {} while (0)
30 # define LED0_ON do {} while (0)
31 #endif
33 #ifdef LED1
34 # define LED1_TOGGLE ledToggle(1)
35 # define LED1_OFF ledSet(1, false)
36 # define LED1_ON ledSet(1, true)
37 #else
38 # define LED1_TOGGLE do {} while (0)
39 # define LED1_OFF do {} while (0)
40 # define LED1_ON do {} while (0)
41 #endif
43 #ifdef LED2
44 # define LED2_TOGGLE ledToggle(2)
45 # define LED2_OFF ledSet(2, false)
46 # define LED2_ON ledSet(2, true)
47 #else
48 # define LED2_TOGGLE do {} while (0)
49 # define LED2_OFF do {} while (0)
50 # define LED2_ON do {} while (0)
51 #endif
53 void ledInit(bool alternative_led);
54 void ledToggle(int led);
55 void ledSet(int led, bool state);