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:
Lucas De Marchi
2016-12-20 08:51:14 +01:00
committed by Lorenz Meier
parent 3e8061c3cd
commit eaa2cf7d99
3 changed files with 12 additions and 22 deletions
+1 -5
View File
@@ -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
+8 -8
View File
@@ -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));
} }
} }
+3 -9
View File
@@ -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)