Merge branch 'master' of github.com:PX4/Firmware into calibration

This commit is contained in:
Lorenz Meier
2012-10-22 12:14:40 +02:00
10 changed files with 296 additions and 176 deletions
+5 -3
View File
@@ -20,6 +20,11 @@
set MODE autostart
set USB autoconnect
#
# Start playing the startup tune
#
tone_alarm start
#
# Try to mount the microSD card.
#
@@ -31,9 +36,6 @@ else
echo "[init] no microSD card found"
fi
usleep 500
#
# Look for an init script on the microSD card.
#
+1 -1
View File
@@ -57,8 +57,8 @@
#include <string.h>
#include <arch/board/drv_led.h>
#include <arch/board/up_hrt.h>
#include <arch/board/drv_tone_alarm.h>
#include <arch/board/up_hrt.h>
#include <drivers/drv_tone_alarm.h>
#include "state_machine_helper.h"
#include "systemlib/systemlib.h"
#include <math.h>
@@ -63,8 +63,6 @@
#define _TONE_ALARM_BASE 0x7400
#define TONE_SET_ALARM _IOC(_TONE_ALARM_BASE, 1)
extern int tone_alarm_init(void);
/* structure describing one note in a tone pattern */
struct tone_note {
uint8_t pitch;
@@ -127,4 +125,4 @@ enum tone_pitch {
TONE_NOTE_MAX
};
#endif /* DRV_TONE_ALARM_H_ */
#endif /* DRV_TONE_ALARM_H_ */
+43
View File
@@ -0,0 +1,43 @@
############################################################################
#
# Copyright (C) 2012 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
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name PX4 nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
#
# Tone alarm driver
#
APPNAME = tone_alarm
PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = 2048
INCLUDES = $(TOPDIR)/arch/arm/src/stm32 $(TOPDIR)/arch/arm/src/common
include $(APPDIR)/mk/app.mk
+1 -1
View File
@@ -51,7 +51,7 @@
#include <arch/board/board.h>
#include <arch/board/up_hrt.h>
#include <arch/board/drv_tone_alarm.h>
#include <drivers/drv_tone_alarm.h>
#include <nuttx/spi.h>
-39
View File
@@ -1,39 +0,0 @@
#echo "---------------------------"
# Start apps
echo "init: Starting applications.."
echo "---------------------------"
# WARNING:
# ttyS0 is ALWAYS the NSH UART
# ttyS1..SN are enumerated according to HW
# uart indices (ttyS1 is the first UART NOT
# configured for NSH, e.g. UART2)
# ttyS0: UART1
# ttyS1: UART2
# ttyS2: UART5
# ttyS3: UART6
uorb start
mavlink -d /dev/ttyS0 -b 57600 &
echo "Trying to mount microSD card to /fs/microsd.."
if mount -t vfat /dev/mmcsd0 /fs/microsd
then
echo "Successfully mounted SD card."
else
echo "FAILED mounting SD card."
fi
commander &
sensors &
attitude_estimator_bm &
#position_estimator &
ardrone_control -d /dev/ttyS1 -m attitude &
gps -d /dev/ttyS3 -m all &
#sdlog &
#fixedwing_control &
echo "---------------------------"
echo "init: All applications started"
echo "INIT DONE, RUNNING SYSTEM.."
# WARNING! USE EXIT ONLY ON AR.DRONE
# NO NSH COMMANDS CAN BE USED AFTER
exit
+1
View File
@@ -93,6 +93,7 @@ CONFIGURED_APPS += drivers/hmc5883
CONFIGURED_APPS += drivers/mpu6000
CONFIGURED_APPS += drivers/bma180
CONFIGURED_APPS += drivers/l3gd20
CONFIGURED_APPS += drivers/stm32/tone_alarm
CONFIGURED_APPS += px4/px4io/driver
CONFIGURED_APPS += px4/fmu
+1 -1
View File
@@ -43,7 +43,7 @@ AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = up_boot.c up_leds.c up_spi.c up_hrt.c \
drv_gpio.c \
drv_led.c drv_eeprom.c \
drv_tone_alarm.c up_pwm_servo.c up_usbdev.c \
up_pwm_servo.c up_usbdev.c \
up_cpuload.c
ifeq ($(CONFIG_NSH_ARCHINIT),y)
-6
View File
@@ -58,7 +58,6 @@
#include <arch/board/up_hrt.h>
#include <arch/board/up_cpuload.h>
#include <arch/board/drv_tone_alarm.h>
#include <arch/board/up_adc.h>
#include <arch/board/board.h>
#include <arch/board/drv_led.h>
@@ -277,10 +276,5 @@ int nsh_archinitialize(void)
}
#endif
/* configure the tone generator */
#ifdef CONFIG_TONE_ALARM
tone_alarm_init();
#endif
return OK;
}