From 053d453438815f1ffa555bc56a0738bfbcb2c035 Mon Sep 17 00:00:00 2001 From: Andreas Kleinert Date: Mon, 22 Oct 2007 13:15:53 +0000 Subject: [PATCH] added a rc status led --- conf/airframes/booz.xml | 2 +- sw/airborne/radio_control.h | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/conf/airframes/booz.xml b/conf/airframes/booz.xml index ccfb21e966..453ec8d8dd 100644 --- a/conf/airframes/booz.xml +++ b/conf/airframes/booz.xml @@ -76,7 +76,7 @@ ctl.srcs += booz_estimator.c booz_control.c booz_autopilot.c ctl.CFLAGS += -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017 -DSERVOS_4017_CLOCK_FALLING ctl.srcs += $(SRC_ARCH)/servos_4017_hw.c actuators.c -ctl.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA +ctl.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA -DRC_LED=4 ctl.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c ctl.srcs += commands.c diff --git a/sw/airborne/radio_control.h b/sw/airborne/radio_control.h index cef4c65b18..ec266ca302 100644 --- a/sw/airborne/radio_control.h +++ b/sw/airborne/radio_control.h @@ -65,9 +65,6 @@ static inline void radio_control_periodic_task ( void ) { _1Hz = 0; last_ppm_cpt = ppm_cpt; ppm_cpt = 0; - //#if defined TIME_LED - // LED_TOGGLE(TIME_LED); - //#endif } if (time_since_last_ppm >= RC_REALLY_LOST_TIME) { @@ -76,7 +73,17 @@ static inline void radio_control_periodic_task ( void ) { if (time_since_last_ppm >= RC_LOST_TIME) rc_status = RC_LOST; time_since_last_ppm++; - } + } + +#if defined RC_LED + if (rc_status == RC_OK) { + LED_OFF(RC_LED); + } + else { + LED_ON(RC_LED); + } +#endif + } /********** EVENT ************************************************************/