1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 12:25:20 +03:00
betaflight/src/main/drivers/light_led.h
Dominic Clifton 83a5c319b5 CJMCU - Add support for LED2. Swap usage of LED0 and LED1.
Currently the LED2 (blue) is just enabled after the main board
initialisation is complete and then it stays on.
2015-01-07 23:02:05 +00:00

67 lines
2.1 KiB
C

/*
* This file is part of Cleanflight.
*
* Cleanflight 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 3 of the License, or
* (at your option) any later version.
*
* Cleanflight 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 Cleanflight. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
// Helpful macros
#ifdef LED0
#define LED0_TOGGLE digitalToggle(LED0_GPIO, LED0_PIN);
#ifndef LED0_INVERTED
#define LED0_OFF digitalHi(LED0_GPIO, LED0_PIN);
#define LED0_ON digitalLo(LED0_GPIO, LED0_PIN);
#else
#define LED0_OFF digitalLo(LED0_GPIO, LED0_PIN);
#define LED0_ON digitalHi(LED0_GPIO, LED0_PIN);
#endif // inverted
#else
#define LED0_TOGGLE
#define LED0_OFF
#define LED0_ON
#endif
#ifdef LED1
#define LED1_TOGGLE digitalToggle(LED1_GPIO, LED1_PIN);
#ifndef LED1_INVERTED
#define LED1_OFF digitalHi(LED1_GPIO, LED1_PIN);
#define LED1_ON digitalLo(LED1_GPIO, LED1_PIN);
#else
#define LED1_OFF digitalLo(LED1_GPIO, LED1_PIN);
#define LED1_ON digitalHi(LED1_GPIO, LED1_PIN);
#endif // inverted
#else
#define LED1_TOGGLE
#define LED1_OFF
#define LED1_ON
#endif
#ifdef LED2
#define LED2_TOGGLE digitalToggle(LED2_GPIO, LED2_PIN);
#ifndef LED2_INVERTED
#define LED2_OFF digitalHi(LED2_GPIO, LED2_PIN);
#define LED2_ON digitalLo(LED2_GPIO, LED2_PIN);
#else
#define LED2_OFF digitalLo(LED2_GPIO, LED2_PIN);
#define LED2_ON digitalHi(LED2_GPIO, LED2_PIN);
#endif // inverted
#else
#define LED2_TOGGLE
#define LED2_OFF
#define LED2_ON
#endif
void ledInit(void);