From 89aaaadeb9673877e5c1f1dc27ced81f4252f10c Mon Sep 17 00:00:00 2001 From: gtoonstra Date: Mon, 15 Jul 2013 14:33:17 -0300 Subject: [PATCH] [modules] digital_cam: add DC_POWER_OFF_LED closes #478 --- sw/airborne/modules/digital_cam/led_cam_ctrl.c | 6 ++++++ sw/airborne/modules/digital_cam/led_cam_ctrl.h | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/sw/airborne/modules/digital_cam/led_cam_ctrl.c b/sw/airborne/modules/digital_cam/led_cam_ctrl.c index 8928381f48..81b701f6af 100644 --- a/sw/airborne/modules/digital_cam/led_cam_ctrl.c +++ b/sw/airborne/modules/digital_cam/led_cam_ctrl.c @@ -52,6 +52,12 @@ void dc_send_command(uint8_t cmd) case DC_ON: DC_PUSH(DC_POWER_LED); break; +#endif +#ifdef DC_POWER_OFF_LED + case DC_OFF: + DC_PUSH(DC_POWER_OFF_LED); + dc_timer = DC_POWER_OFF_DELAY; + break; #endif default: break; diff --git a/sw/airborne/modules/digital_cam/led_cam_ctrl.h b/sw/airborne/modules/digital_cam/led_cam_ctrl.h index 37eb0a7f17..fde5cb4aa7 100644 --- a/sw/airborne/modules/digital_cam/led_cam_ctrl.h +++ b/sw/airborne/modules/digital_cam/led_cam_ctrl.h @@ -35,6 +35,7 @@ * * * + * * @endverbatim * Related bank and pin must also be defined: * @verbatim @@ -68,6 +69,10 @@ extern uint8_t dc_timer; #define DC_SHUTTER_DELAY 2 /* 4Hz -> 0.5s */ #endif +#ifndef DC_POWER_OFF_DELAY +#define DC_POWER_OFF_DELAY 3 +#endif + #ifndef DC_SHUTTER_LED #error DC: Please specify at least a SHUTTER LED #endif @@ -90,6 +95,9 @@ static inline void led_cam_ctrl_init(void) #ifdef DC_POWER_LED DC_RELEASE(DC_POWER_LED); #endif +#ifdef DC_POWER_OFF_LED + DC_RELEASE(DC_POWER_OFF_LED); +#endif } @@ -114,6 +122,9 @@ static inline void led_cam_ctrl_periodic( void ) #endif #ifdef DC_POWER_LED DC_RELEASE(DC_POWER_LED); +#endif +#ifdef DC_POWER_OFF_LED + DC_RELEASE(DC_POWER_OFF_LED); #endif }