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/>.
24 #include "common/utils.h"
29 #include "light_led.h"
34 #if defined(LED0) || defined(LED1) || defined(LED2)
44 .cfg
= { LED0_PIN
, Mode_Out_PP
, Speed_2MHz
}
50 .cfg
= { LED1_PIN
, Mode_Out_PP
, Speed_2MHz
}
56 .cfg
= { LED2_PIN
, Mode_Out_PP
, Speed_2MHz
}
61 uint8_t gpio_count
= ARRAYLEN(gpio_setup
);
64 RCC_APB2PeriphClockCmd(LED0_PERIPHERAL
, ENABLE
);
67 RCC_APB2PeriphClockCmd(LED1_PERIPHERAL
, ENABLE
);
70 RCC_APB2PeriphClockCmd(LED2_PERIPHERAL
, ENABLE
);
77 for (i
= 0; i
< gpio_count
; i
++) {
78 gpioInit(gpio_setup
[i
].gpio
, &gpio_setup
[i
].cfg
);