2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
24 #include "drivers/io_types.h"
25 #include "common/utils.h"
27 #define STATUS_LED_NUMBER 3
29 typedef struct statusLedConfig_s
{
30 ioTag_t ioTags
[STATUS_LED_NUMBER
];
34 PG_DECLARE(statusLedConfig_t
, statusLedConfig
);
37 #if defined(UNIT_TEST) || defined(USE_FAKE_LED)
39 #define LED0_TOGGLE NOOP
43 #define LED1_TOGGLE NOOP
47 #define LED2_TOGGLE NOOP
53 #define LED0_TOGGLE ledToggle(0)
54 #define LED0_OFF ledSet(0, false)
55 #define LED0_ON ledSet(0, true)
57 #define LED1_TOGGLE ledToggle(1)
58 #define LED1_OFF ledSet(1, false)
59 #define LED1_ON ledSet(1, true)
61 #define LED2_TOGGLE ledToggle(2)
62 #define LED2_OFF ledSet(2, false)
63 #define LED2_ON ledSet(2, true)
65 void ledInit(const statusLedConfig_t
*statusLedConfig
);
66 void ledToggle(int led
);
67 void ledSet(int led
, bool state
);