diff options
author | px4dev <px4@purgatory.org> | 2013-05-19 21:51:35 +0200 |
---|---|---|
committer | px4dev <px4@purgatory.org> | 2013-05-19 21:51:35 +0200 |
commit | b7d430e3c06c10411419bfc8bfb30574f7a9cb56 (patch) | |
tree | 994a105907415d5b6d877c436126410b25562aa4 /src/drivers/boards | |
parent | c6b7eb1224426d9ec2e6d59a3df4c7443449109a (diff) | |
parent | 504b6d12561d68874ded4c1f747c21926a065045 (diff) | |
download | px4-firmware-b7d430e3c06c10411419bfc8bfb30574f7a9cb56.tar.gz px4-firmware-b7d430e3c06c10411419bfc8bfb30574f7a9cb56.tar.bz2 px4-firmware-b7d430e3c06c10411419bfc8bfb30574f7a9cb56.zip |
Merge branch 'master' of https://github.com/PX4/Firmware into fmuv2_bringup
Fix px4iov2 build issue by selecting the correct NuttX config.
Diffstat (limited to 'src/drivers/boards')
-rw-r--r-- | src/drivers/boards/px4fmu/module.mk | 3 | ||||
-rw-r--r-- | src/drivers/boards/px4fmu/px4fmu_init.c | 27 | ||||
-rw-r--r-- | src/drivers/boards/px4fmu/px4fmu_led.c | 28 |
3 files changed, 40 insertions, 18 deletions
diff --git a/src/drivers/boards/px4fmu/module.mk b/src/drivers/boards/px4fmu/module.mk index 2cb261d30..66b776917 100644 --- a/src/drivers/boards/px4fmu/module.mk +++ b/src/drivers/boards/px4fmu/module.mk @@ -6,4 +6,5 @@ SRCS = px4fmu_can.c \ px4fmu_init.c \ px4fmu_pwm_servo.c \ px4fmu_spi.c \ - px4fmu_usb.c + px4fmu_usb.c \ + px4fmu_led.c diff --git a/src/drivers/boards/px4fmu/px4fmu_init.c b/src/drivers/boards/px4fmu/px4fmu_init.c index 5dd70c3f9..69edc23ab 100644 --- a/src/drivers/boards/px4fmu/px4fmu_init.c +++ b/src/drivers/boards/px4fmu/px4fmu_init.c @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (C) 2012 PX4 Development Team. All rights reserved. + * Copyright (c) 2012, 2013 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -91,6 +91,19 @@ # endif #endif +/* + * Ideally we'd be able to get these from up_internal.h, + * but since we want to be able to disable the NuttX use + * of leds for system indication at will and there is no + * separate switch, we need to build independent of the + * CONFIG_ARCH_LEDS configuration switch. + */ +__BEGIN_DECLS +extern void led_init(); +extern void led_on(int led); +extern void led_off(int led); +__END_DECLS + /**************************************************************************** * Protected Functions ****************************************************************************/ @@ -114,7 +127,7 @@ __EXPORT void stm32_boardinitialize(void) /* configure SPI interfaces */ stm32_spiinitialize(); - /* configure LEDs */ + /* configure LEDs (empty call to NuttX' ledinit) */ up_ledinit(); } @@ -178,11 +191,11 @@ __EXPORT int nsh_archinitialize(void) (hrt_callout)stm32_serial_dma_poll, NULL); - // initial LED state -// drv_led_start(); - up_ledoff(LED_BLUE); - up_ledoff(LED_AMBER); - up_ledon(LED_BLUE); + /* initial LED state */ + drv_led_start(); + led_off(LED_AMBER); + led_on(LED_BLUE); + /* Configure SPI-based devices */ diff --git a/src/drivers/boards/px4fmu/px4fmu_led.c b/src/drivers/boards/px4fmu/px4fmu_led.c index fd1e159aa..34fd194c3 100644 --- a/src/drivers/boards/px4fmu/px4fmu_led.c +++ b/src/drivers/boards/px4fmu/px4fmu_led.c @@ -39,19 +39,27 @@ #include <nuttx/config.h> -#include <stdint.h> #include <stdbool.h> -#include <debug.h> -#include <arch/board/board.h> - -#include "chip.h" -#include "up_arch.h" -#include "up_internal.h" #include "stm32_internal.h" #include "px4fmu_internal.h" -__EXPORT void up_ledinit() +#include <arch/board/board.h> + +/* + * Ideally we'd be able to get these from up_internal.h, + * but since we want to be able to disable the NuttX use + * of leds for system indication at will and there is no + * separate switch, we need to build independent of the + * CONFIG_ARCH_LEDS configuration switch. + */ +__BEGIN_DECLS +extern void led_init(); +extern void led_on(int led); +extern void led_off(int led); +__END_DECLS + +__EXPORT void led_init() { /* Configure LED1-2 GPIOs for output */ @@ -59,7 +67,7 @@ __EXPORT void up_ledinit() stm32_configgpio(GPIO_LED2); } -__EXPORT void up_ledon(int led) +__EXPORT void led_on(int led) { if (led == 0) { @@ -73,7 +81,7 @@ __EXPORT void up_ledon(int led) } } -__EXPORT void up_ledoff(int led) +__EXPORT void led_off(int led) { if (led == 0) { |