mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 04:43:34 +08:00
aerofc: fix LED names
There are no blue/red LEDs and these names just causes confusion with the "always-on LEDs".
This commit is contained in:
committed by
Lorenz Meier
parent
3e8061c3cd
commit
eaa2cf7d99
@@ -161,11 +161,7 @@
|
|||||||
* way. The following definitions are used to access individual LEDs.
|
* way. The following definitions are used to access individual LEDs.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* LED index values for use with stm32_setled()
|
/* LED index values for use with stm32_setled() */
|
||||||
*
|
|
||||||
* PC4 BLUE_LED D4 Blue LED cathode
|
|
||||||
* PC5 RED_LED D5 Red LED cathode
|
|
||||||
*/
|
|
||||||
#define BOARD_LED1 0
|
#define BOARD_LED1 0
|
||||||
#define BOARD_LED2 1
|
#define BOARD_LED2 1
|
||||||
#define BOARD_NLEDS 2
|
#define BOARD_NLEDS 2
|
||||||
|
|||||||
@@ -65,20 +65,20 @@ __EXPORT void led_init(void)
|
|||||||
{
|
{
|
||||||
/* Configure LED1-2 GPIOs for output */
|
/* Configure LED1-2 GPIOs for output */
|
||||||
|
|
||||||
stm32_configgpio(GPIO_BLUE_LED);
|
stm32_configgpio(GPIO_LED1);
|
||||||
stm32_configgpio(GPIO_RED_LED);
|
stm32_configgpio(GPIO_LED2);
|
||||||
}
|
}
|
||||||
|
|
||||||
__EXPORT void led_on(int led)
|
__EXPORT void led_on(int led)
|
||||||
{
|
{
|
||||||
if (led == 0) {
|
if (led == 0) {
|
||||||
/* Pull down to switch on */
|
/* Pull down to switch on */
|
||||||
stm32_gpiowrite(GPIO_BLUE_LED, false);
|
stm32_gpiowrite(GPIO_LED1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (led == 1) {
|
if (led == 1) {
|
||||||
/* Pull down to switch on */
|
/* Pull down to switch on */
|
||||||
stm32_gpiowrite(GPIO_RED_LED, false);
|
stm32_gpiowrite(GPIO_LED2, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,22 +86,22 @@ __EXPORT void led_off(int led)
|
|||||||
{
|
{
|
||||||
if (led == 0) {
|
if (led == 0) {
|
||||||
/* Pull up to switch off */
|
/* Pull up to switch off */
|
||||||
stm32_gpiowrite(GPIO_BLUE_LED, true);
|
stm32_gpiowrite(GPIO_LED1, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (led == 1) {
|
if (led == 1) {
|
||||||
/* Pull up to switch off */
|
/* Pull up to switch off */
|
||||||
stm32_gpiowrite(GPIO_RED_LED, true);
|
stm32_gpiowrite(GPIO_LED2, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
__EXPORT void led_toggle(int led)
|
__EXPORT void led_toggle(int led)
|
||||||
{
|
{
|
||||||
if (led == 0) {
|
if (led == 0) {
|
||||||
stm32_gpiowrite(GPIO_BLUE_LED, !stm32_gpioread(GPIO_BLUE_LED));
|
stm32_gpiowrite(GPIO_LED1, !stm32_gpioread(GPIO_LED1));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (led == 1) {
|
if (led == 1) {
|
||||||
stm32_gpiowrite(GPIO_RED_LED, !stm32_gpioread(GPIO_RED_LED));
|
stm32_gpiowrite(GPIO_LED2, !stm32_gpioread(GPIO_LED2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,15 +61,9 @@
|
|||||||
#define UDID_START 0x1FFF7A10
|
#define UDID_START 0x1FFF7A10
|
||||||
|
|
||||||
/* PX4FMU GPIOs ***********************************************************************************/
|
/* PX4FMU GPIOs ***********************************************************************************/
|
||||||
/* LEDs
|
/* LEDs */
|
||||||
*
|
#define GPIO_LED1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN12)
|
||||||
* PC4 BLUE_LED D4 Blue LED cathode
|
#define GPIO_LED2 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN10)
|
||||||
* PC5 RED_LED D5 Red LED cathode
|
|
||||||
*/
|
|
||||||
#define GPIO_LED1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN12)
|
|
||||||
#define GPIO_LED2 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN10)
|
|
||||||
#define GPIO_BLUE_LED GPIO_LED1
|
|
||||||
#define GPIO_RED_LED GPIO_LED2
|
|
||||||
|
|
||||||
#define GPIO_SENSORS_POWER (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTD|GPIO_PIN13)
|
#define GPIO_SENSORS_POWER (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTD|GPIO_PIN13)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user