diff --git a/conf/autopilot/subsystems/fixedwing/radio_control_datalink.makefile b/conf/autopilot/subsystems/fixedwing/radio_control_datalink.makefile index 6202acf1b8..bb342a5c3e 100644 --- a/conf/autopilot/subsystems/fixedwing/radio_control_datalink.makefile +++ b/conf/autopilot/subsystems/fixedwing/radio_control_datalink.makefile @@ -11,6 +11,9 @@ endif ifeq ($(NORADIO), False) +ifdef (RADIO_CONTROL_DATALINK_LED) + ap.CFLAGS += -D(RADIO_CONTROL_DATALINK_LED=$((RADIO_CONTROL_DATALINK_LED) +endif $(TARGET).CFLAGS += -DRADIO_CONTROL $(TARGET).CFLAGS += -DRADIO_CONTROL_TYPE_H=\"radio_control/rc_datalink.h\" $(TARGET).CFLAGS += -DRADIO_CONTROL_TYPE_DATALINK diff --git a/conf/autopilot/subsystems/shared/radio_control_ppm.makefile b/conf/autopilot/subsystems/shared/radio_control_ppm.makefile index 6b2fdeab88..41b7f90729 100644 --- a/conf/autopilot/subsystems/shared/radio_control_ppm.makefile +++ b/conf/autopilot/subsystems/shared/radio_control_ppm.makefile @@ -12,7 +12,7 @@ endif ifeq ($(NORADIO), False) $(TARGET).CFLAGS += -DRADIO_CONTROL - ifdef RADIO_CONTROL_LED + ifneq ($(RADIO_CONTROL_LED),none) ap.CFLAGS += -DRADIO_CONTROL_LED=$(RADIO_CONTROL_LED) endif $(TARGET).CFLAGS += -DRADIO_CONTROL_TYPE_H=\"subsystems/radio_control/ppm.h\" diff --git a/conf/autopilot/subsystems/shared/radio_control_spektrum.makefile b/conf/autopilot/subsystems/shared/radio_control_spektrum.makefile index ae53bd7a26..192a21c376 100644 --- a/conf/autopilot/subsystems/shared/radio_control_spektrum.makefile +++ b/conf/autopilot/subsystems/shared/radio_control_spektrum.makefile @@ -10,7 +10,7 @@ ap.CFLAGS += -DRADIO_CONTROL_TYPE_H=\"subsystems/radio_control/spektrum.h\" ifeq ($(ARCH), lpc21) ap.CFLAGS += -DRADIO_CONTROL_SPEKTRUM_MODEL_H=$(RADIO_CONTROL_SPEKTRUM_MODEL) endif -ifdef RADIO_CONTROL_LED +ifneq ($(RADIO_CONTROL_LED),none) ap.CFLAGS += -DRADIO_CONTROL_LED=$(RADIO_CONTROL_LED) endif ap.CFLAGS += -DRADIO_CONTROL_SPEKTRUM_PRIMARY_PORT=$(RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT) diff --git a/conf/boards/classix.makefile b/conf/boards/classix.makefile index 79002ad107..055ec54e92 100644 --- a/conf/boards/classix.makefile +++ b/conf/boards/classix.makefile @@ -24,6 +24,7 @@ LPC21ISP_XTAL = 12000 ### default settings for classix GPS_BAUD = B38400 GPS_LED = none +RADIO_CONTROL_LED = none # All targets on the TINY board run on the same processor achitecture $(TARGET).ARCHDIR = $(ARCH) diff --git a/conf/boards/hb_1.1.makefile b/conf/boards/hb_1.1.makefile index b8d0c3ae0a..4c2a8c8525 100644 --- a/conf/boards/hb_1.1.makefile +++ b/conf/boards/hb_1.1.makefile @@ -37,6 +37,7 @@ GPS_BAUD = B38400 endif GPS_LED = 2 +RADIO_CONTROL_LED = none ifndef ADC_IR1 ADC_IR1 = 1 diff --git a/conf/boards/tiny_2.11.makefile b/conf/boards/tiny_2.11.makefile index fd92507e9a..706ebf8154 100644 --- a/conf/boards/tiny_2.11.makefile +++ b/conf/boards/tiny_2.11.makefile @@ -36,6 +36,8 @@ ifndef MODEM_BAUD MODEM_BAUD = B57600 endif +RADIO_CONTROL_LED = none + ADC_IR_TOP = ADC_0 ADC_IR1 = ADC_1 ADC_IR2 = ADC_2 diff --git a/conf/boards/umarim_1.0.makefile b/conf/boards/umarim_1.0.makefile index 793cc91778..3ebc16dbcd 100644 --- a/conf/boards/umarim_1.0.makefile +++ b/conf/boards/umarim_1.0.makefile @@ -29,6 +29,8 @@ GPS_BAUD = B38400 endif GPS_LED = 2 +RADIO_CONTROL_LED = none + ifndef MODEM_PORT MODEM_PORT = UART1 endif diff --git a/sw/airborne/firmwares/fixedwing/datalink.c b/sw/airborne/firmwares/fixedwing/datalink.c index 106156e564..bbd43d3eb1 100644 --- a/sw/airborne/firmwares/fixedwing/datalink.c +++ b/sw/airborne/firmwares/fixedwing/datalink.c @@ -187,14 +187,18 @@ void dl_parse_msg(void) { #endif // USE_JOYSTICK #if defined RADIO_CONTROL && defined RADIO_CONTROL_TYPE_DATALINK if (msg_id == DL_RC_3CH /*&& DL_RC_3CH_ac_id(dl_buffer) == TX_ID*/) { -LED_TOGGLE(3); +#ifdef RADIO_CONTROL_DATALINK_LED + LED_TOGGLE(RADIO_CONTROL_DATALINK_LED); +#endif parse_rc_3ch_datalink( DL_RC_3CH_throttle_mode(dl_buffer), DL_RC_3CH_roll(dl_buffer), DL_RC_3CH_pitch(dl_buffer)); } else if (msg_id == DL_RC_4CH && DL_RC_4CH_ac_id(dl_buffer) == AC_ID) { -LED_TOGGLE(3); +#ifdef RADIO_CONTROL_DATALINK_LED + LED_TOGGLE(RADIO_CONTROL_DATALINK_LED); +#endif parse_rc_4ch_datalink( DL_RC_4CH_mode(dl_buffer), DL_RC_4CH_throttle(dl_buffer), diff --git a/sw/airborne/subsystems/gps/gps_mtk.c b/sw/airborne/subsystems/gps/gps_mtk.c index aaa96859e6..79a157db86 100644 --- a/sw/airborne/subsystems/gps/gps_mtk.c +++ b/sw/airborne/subsystems/gps/gps_mtk.c @@ -386,6 +386,8 @@ static bool_t user_gps_configure(bool_t cpt) { case 1: MtkSend_CFG(MTK_DIY_OUTPUT_RATE); return FALSE; + default: + break; } return TRUE; /* Continue, except for the last case */ } diff --git a/sw/airborne/subsystems/ins.c b/sw/airborne/subsystems/ins.c index d25b367a84..c5b87519bf 100644 --- a/sw/airborne/subsystems/ins.c +++ b/sw/airborne/subsystems/ins.c @@ -91,16 +91,16 @@ void ins_init() { ins_ltp_initialised = TRUE; /** FIXME: should use the same code than MOVE_WP in firmwares/rotorcraft/datalink.c */ - struct LlaCoor_i llh; /* Height above the ellipsoid */ - llh.lat = INT32_RAD_OF_DEG(NAV_LAT0); - llh.lon = INT32_RAD_OF_DEG(NAV_LON0); + struct LlaCoor_i llh_nav0; /* Height above the ellipsoid */ + llh_nav0.lat = INT32_RAD_OF_DEG(NAV_LAT0); + llh_nav0.lon = INT32_RAD_OF_DEG(NAV_LON0); /* NAV_ALT0 = ground alt above msl, NAV_MSL0 = geoid-height (msl) over ellipsoid */ - llh.alt = NAV_ALT0 + NAV_MSL0; + llh_nav0.alt = NAV_ALT0 + NAV_MSL0; - struct EcefCoor_i nav_init; - ecef_of_lla_i(&nav_init, &llh); + struct EcefCoor_i ecef_nav0; + ecef_of_lla_i(&ecef_nav0, &llh_nav0); - ltp_def_from_ecef_i(&ins_ltp_def, &nav_init); + ltp_def_from_ecef_i(&ins_ltp_def, &ecef_nav0); ins_ltp_def.hmsl = NAV_ALT0; #else ins_ltp_initialised = FALSE;