properly configurable LED defaults for the boards

This commit is contained in:
Felix Ruess
2012-01-09 18:18:52 +01:00
parent 29171a3244
commit 4bdfacf762
18 changed files with 168 additions and 46 deletions
+3 -2
View File
@@ -142,15 +142,16 @@ ap.srcs += $(SRC_FIRMWARE)/commands.c
#
ap.srcs += $(SRC_BOARD)/baro_board.c
ifeq ($(BOARD), booz)
ap.CFLAGS += -DROTORCRAFT_BARO_LED=$(BARO_LED)
else ifeq ($(BOARD), lisa_l)
ap.CFLAGS += -DUSE_I2C2
else ifeq ($(BOARD), navgo)
ap.CFLAGS += -DROTORCRAFT_BARO_LED=$(BARO_LED)
ap.CFLAGS += -DUSE_I2C1
ap.CFLAGS += -DADS1114_I2C_DEVICE=i2c1
ap.srcs += peripherals/ads1114.c
endif
ifneq ($(BARO_LED),none)
ap.CFLAGS += -DROTORCRAFT_BARO_LED=$(BARO_LED)
endif
#
# Analog Backend
@@ -9,8 +9,8 @@
AHRS_CFLAGS = -DUSE_AHRS -DAHRS_UPDATE_FW_ESTIMATOR
AHRS_CFLAGS += -DUSE_AHRS_ALIGNER -DAHRS_GRAVITY_UPDATE_COORDINATED_TURN
ifdef AHRS_ALIGNER_LED
AHRS_CFLAGS += -DAHRS_ALIGNER_LED=$(AHRS_ALIGNER_LED)
ifneq ($(AHRS_ALIGNER_LED),none)
AHRS_CFLAGS += -DAHRS_ALIGNER_LED=$(AHRS_ALIGNER_LED)
endif
AHRS_CFLAGS += -DAHRS_TYPE_H=\"subsystems/ahrs/ahrs_float_cmpl_rmat.h\"
AHRS_SRCS += subsystems/ahrs.c
@@ -13,7 +13,8 @@ ap.srcs += $(SRC_SUBSYSTEMS)/ahrs.c
ap.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_aligner.c
ap.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_float_dcm.c
ifdef AHRS_ALIGNER_LED
ifneq ($(AHRS_ALIGNER_LED),none)
ap.CFLAGS += -DAHRS_ALIGNER_LED=$(AHRS_ALIGNER_LED)
endif
@@ -6,8 +6,8 @@
AHRS_CFLAGS = -DUSE_AHRS -DAHRS_UPDATE_FW_ESTIMATOR -DUSE_AHRS_CMPL
AHRS_CFLAGS += -DUSE_AHRS_ALIGNER
ifdef AHRS_ALIGNER_LED
AHRS_CFLAGS += -DAHRS_ALIGNER_LED=$(AHRS_ALIGNER_LED)
ifneq ($(AHRS_ALIGNER_LED),none)
AHRS_CFLAGS += -DAHRS_ALIGNER_LED=$(AHRS_ALIGNER_LED)
endif
AHRS_CFLAGS += -DAHRS_TYPE_H=\"subsystems/ahrs/ahrs_int_cmpl_euler.h\"
AHRS_SRCS += subsystems/ahrs.c
@@ -9,8 +9,8 @@
AHRS_CFLAGS = -DUSE_AHRS -DAHRS_UPDATE_FW_ESTIMATOR
AHRS_CFLAGS += -DUSE_AHRS_ALIGNER -DAHRS_GRAVITY_UPDATE_COORDINATED_TURN
ifdef AHRS_ALIGNER_LED
AHRS_CFLAGS += -DAHRS_ALIGNER_LED=$(AHRS_ALIGNER_LED)
ifneq ($(AHRS_ALIGNER_LED),none)
AHRS_CFLAGS += -DAHRS_ALIGNER_LED=$(AHRS_ALIGNER_LED)
endif
AHRS_CFLAGS += -DAHRS_TYPE_H=\"subsystems/ahrs/ahrs_int_cmpl.h\"
AHRS_SRCS += subsystems/ahrs.c
@@ -123,9 +123,7 @@ ifeq ($(ARCH), stm32)
ifneq ($(SYS_TIME_LED),none)
ns_CFLAGS += -DSYS_TIME_LED=$(SYS_TIME_LED)
endif
else
ns_CFLAGS += -DTIME_LED=1
endif
#
# Sys-time
@@ -2,7 +2,10 @@
# Complementary filter for attitude estimation
#
ap.CFLAGS += -DUSE_AHRS_CMPL -DAHRS_ALIGNER_LED=$(AHRS_ALIGNER_LED)
stm_passthrough.CFLAGS += -DUSE_AHRS_CMPL
ifneq ($(AHRS_ALIGNER_LED),none)
stm_passthrough.CFLAGS += -DAHRS_ALIGNER_LED=$(AHRS_ALIGNER_LED)
endif
stm_passthrough.srcs += $(SRC_SUBSYSTEMS)/ahrs.c
stm_passthrough.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_aligner.c
stm_passthrough.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_int_cmpl_euler.c
@@ -8,8 +8,8 @@
AHRS_CFLAGS = -DUSE_AHRS
AHRS_CFLAGS += -DUSE_AHRS_ALIGNER
ifdef AHRS_ALIGNER_LED
AHRS_CFLAGS += -DAHRS_ALIGNER_LED=$(AHRS_ALIGNER_LED)
ifneq ($(AHRS_ALIGNER_LED),none)
AHRS_CFLAGS += -DAHRS_ALIGNER_LED=$(AHRS_ALIGNER_LED)
endif
AHRS_CFLAGS += -DAHRS_TYPE_H=\"subsystems/ahrs/ahrs_float_cmpl_rmat.h\"
AHRS_SRCS += subsystems/ahrs.c
@@ -5,8 +5,8 @@
AHRS_CFLAGS = -DUSE_AHRS -DUSE_AHRS_CMPL
AHRS_CFLAGS += -DUSE_AHRS_ALIGNER
ifdef AHRS_ALIGNER_LED
AHRS_CFLAGS += -DAHRS_ALIGNER_LED=$(AHRS_ALIGNER_LED)
ifneq ($(AHRS_ALIGNER_LED),none)
AHRS_CFLAGS += -DAHRS_ALIGNER_LED=$(AHRS_ALIGNER_LED)
endif
AHRS_CFLAGS += -DAHRS_TYPE_H=\"subsystems/ahrs/ahrs_int_cmpl_euler.h\"
AHRS_SRCS += subsystems/ahrs.c
@@ -8,8 +8,8 @@
AHRS_CFLAGS = -DUSE_AHRS
AHRS_CFLAGS += -DUSE_AHRS_ALIGNER
ifdef AHRS_ALIGNER_LED
AHRS_CFLAGS += -DAHRS_ALIGNER_LED=$(AHRS_ALIGNER_LED)
ifneq ($(AHRS_ALIGNER_LED),none)
AHRS_CFLAGS += -DAHRS_ALIGNER_LED=$(AHRS_ALIGNER_LED)
endif
AHRS_CFLAGS += -DAHRS_TYPE_H=\"subsystems/ahrs/ahrs_int_cmpl.h\"
AHRS_SRCS += subsystems/ahrs.c
+21 -7
View File
@@ -18,14 +18,31 @@ endif
#
#
ifndef SYS_TIME_LED
SYS_TIME_LED = 1 # not used on rotorcraft, only for tests
#
# default LED configuration
#
ifndef RADIO_CONTROL_LED
RADIO_CONTROL_LED = 1
endif
ifndef BARO_LED
BARO_LED = 2
endif
ifndef AHRS_ALIGNER_LED
AHRS_ALIGNER_LED = 3
endif
ifndef GPS_LED
GPS_LED = 4
endif
ifndef SYS_TIME_LED
SYS_TIME_LED = 1
endif
RADIO_CONTROL_LED = 1
RADIO_CONTROL_LINK = UART0
BARO_LED = 2
ifndef MODEM_PORT
MODEM_PORT = UART1
@@ -34,12 +51,9 @@ ifndef MODEM_BAUD
MODEM_BAUD = B57600
endif
AHRS_ALIGNER_LED = 3
ifndef GPS_PORT
GPS_PORT=UART0
endif
ifndef GPS_BAUD
GPS_BAUD=B38400
endif
GPS_LED=4
+20 -4
View File
@@ -18,8 +18,27 @@ endif
#
#
#
# default LED configuration
#
ifndef RADIO_CONTROL_LED
RADIO_CONTROL_LED = none
endif
ifndef BARO_LED
BARO_LED = none
endif
ifndef AHRS_ALIGNER_LED
AHRS_ALIGNER_LED = none
endif
ifndef GPS_LED
GPS_LED = 2
endif
ifndef SYS_TIME_LED
SYS_TIME_LED = 1 # not used on rotorcraft, only for tests
SYS_TIME_LED = 1
endif
RADIO_CONTROL_LINK = UART0
@@ -38,9 +57,6 @@ ifndef GPS_BAUD
GPS_BAUD = B38400
endif
GPS_LED = 2
RADIO_CONTROL_LED = none
ifndef ADC_IR1
ADC_IR1 = 1
ADC_IR1_CHAN = 0
+19 -4
View File
@@ -36,13 +36,31 @@ endif
#
#
#
# default LED configuration
#
ifndef RADIO_CONTROL_LED
RADIO_CONTROL_LED = 5
endif
ifndef BARO_LED
BARO_LED = none
endif
ifndef AHRS_ALIGNER_LED
AHRS_ALIGNER_LED = 7
endif
ifndef GPS_LED
GPS_LED = 3
endif
ifndef SYS_TIME_LED
SYS_TIME_LED = 1
endif
RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT = UART3
RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT = UART5
RADIO_CONTROL_LED = 5
ifndef MODEM_PORT
MODEM_PORT=UART2
@@ -51,15 +69,12 @@ ifndef MODEM_BAUD
MODEM_BAUD=B57600
endif
AHRS_ALIGNER_LED = 7
ifndef GPS_PORT
GPS_PORT=UART1
endif
ifndef GPS_BAUD
GPS_BAUD=B38400
endif
GPS_LED = 3
#
# this is the DRDY pin of a max1168 on a booz IMU
+22 -3
View File
@@ -27,13 +27,33 @@ endif
#
#
#
# default LED configuration
#
ifndef RADIO_CONTROL_LED
RADIO_CONTROL_LED = none
endif
ifndef BARO_LED
BARO_LED = none
endif
ifndef AHRS_ALIGNER_LED
AHRS_ALIGNER_LED = none
endif
ifndef GPS_LED
GPS_LED = none
endif
ifndef SYS_TIME_LED
SYS_TIME_LED = 1
endif
RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT = UART3
RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT = UART5
RADIO_CONTROL_LED = none
ifndef MODEM_PORT
MODEM_PORT=UART2
@@ -42,7 +62,6 @@ ifndef MODEM_BAUD
MODEM_BAUD=B57600
endif
#AHRS_ALIGNER_LED = 7
ifndef GPS_PORT
GPS_PORT=UART1
@@ -50,7 +69,7 @@ endif
ifndef GPS_BAUD
GPS_BAUD=B38400
endif
GPS_LED = none
#
# this is the DRDY pin of a max1168 on a booz IMU
+18 -1
View File
@@ -20,11 +20,29 @@ LPC21ISP_BAUD = 38400
LPC21ISP_XTAL = 12000
#
# default LED configuration
#
ifndef RADIO_CONTROL_LED
RADIO_CONTROL_LED = 1
endif
ifndef BARO_LED
BARO_LED = 2
endif
ifndef AHRS_ALIGNER_LED
AHRS_ALIGNER_LED = 3
endif
ifndef GPS_LED
GPS_LED = 4
endif
ifndef SYS_TIME_LED
SYS_TIME_LED = none
endif
### default settings
ifndef GPS_PORT
@@ -33,7 +51,6 @@ endif
ifndef GPS_BAUD
GPS_BAUD = B38400
endif
GPS_LED = 4
ifndef MODEM_PORT
MODEM_PORT = UART1
+22 -2
View File
@@ -19,6 +19,28 @@ endif
LPC21ISP_BAUD = 38400
LPC21ISP_XTAL = 12000
#
# default LED configuration
#
ifndef RADIO_CONTROL_LED
RADIO_CONTROL_LED = none
endif
ifndef BARO_LED
BARO_LED = none
endif
ifndef AHRS_ALIGNER_LED
AHRS_ALIGNER_LED = none
endif
ifndef GPS_LED
GPS_LED = 2
endif
ifndef SYS_TIME_LED
SYS_TIME_LED = none
endif
### default settings for tiny_2 and twog
ifndef GPS_PORT
@@ -27,7 +49,6 @@ endif
ifndef GPS_BAUD
GPS_BAUD = B38400
endif
GPS_LED = 2
ifndef MODEM_PORT
MODEM_PORT = UART1
@@ -36,7 +57,6 @@ ifndef MODEM_BAUD
MODEM_BAUD = B57600
endif
RADIO_CONTROL_LED = none
ADC_IR_TOP = ADC_0
ADC_IR1 = ADC_1
+24 -3
View File
@@ -20,6 +20,30 @@ LPC21ISP_BAUD = 38400
LPC21ISP_XTAL = 12000
#
# default LED configuration
#
ifndef RADIO_CONTROL_LED
RADIO_CONTROL_LED = none
endif
ifndef BARO_LED
BARO_LED = none
endif
ifndef AHRS_ALIGNER_LED
AHRS_ALIGNER_LED = none
endif
ifndef GPS_LED
GPS_LED = 2
endif
ifndef SYS_TIME_LED
SYS_TIME_LED = none
endif
### default settings
ifndef GPS_PORT
GPS_PORT = UART0
@@ -27,9 +51,6 @@ endif
ifndef GPS_BAUD
GPS_BAUD = B38400
endif
GPS_LED = 2
RADIO_CONTROL_LED = none
ifndef MODEM_PORT
MODEM_PORT = UART1
-3
View File
@@ -144,9 +144,6 @@ static inline bool_t sys_time_periodic( void ) {
if (cpu_time_ticks > TIME_TICKS_PER_SEC) {
cpu_time_ticks -= TIME_TICKS_PER_SEC;
cpu_time_sec++;
#ifdef TIME_LED
LED_TOGGLE(TIME_LED)
#endif
#ifdef SYS_TIME_LED
LED_TOGGLE(SYS_TIME_LED)
#endif