[modules] digital_cam: add DC_POWER_OFF_LED

closes #478
This commit is contained in:
gtoonstra
2013-07-15 14:33:17 -03:00
committed by Felix Ruess
parent ba0c5b2941
commit 89aaaadeb9
2 changed files with 17 additions and 0 deletions
@@ -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;
@@ -35,6 +35,7 @@
* <define name="DC_ZOOM_IN_LED" value="7"/>
* <define name="DC_ZOOM_OUT_LED" value="8"/>
* <define name="DC_POWER_LED" value="9"/>
* <define name="DC_POWER_OFF_LED" value="10"/>
* @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
}