[tuxdroid-svn] r830 - daemon/trunk
Status: Beta
Brought to you by:
ks156
From: jaguarondi <c2m...@c2...> - 2008-01-04 16:58:59
|
Author: jaguarondi Date: 2008-01-04 17:59:01 +0100 (Fri, 04 Jan 2008) New Revision: 830 Modified: daemon/trunk/led.c daemon/trunk/led.h Log: * Updated the documentation of led_configure_effect() and added it to the module interface. This function can be used to set different effects on each LED so you can then use the led_set or led_pulse commands with the LAST effect to get everything you want. Modified: daemon/trunk/led.c =================================================================== --- daemon/trunk/led.c 2008-01-04 16:48:54 UTC (rev 829) +++ daemon/trunk/led.c 2008-01-04 16:59:01 UTC (rev 830) @@ -114,7 +114,19 @@ return ack; } -int config_effects(leds_t leds, int left_intensity_delta, +/** + * \brief Configure the hardware to the desired LED effect. + * \param leds Which LEDs are affected by the command + * \param left_intensity_delta Variation of intensity the left LED will have, + * necessary to handle timings. + * \param right_intensity_delta Variation of intensity the right LED will have, + * necessary to handle timings. + * \param effect Fading or gradient effect applied when changing the intensity. + * + * \sa The effect types and parameters are described in the documentation of + * effect_type_t. + */ +int led_configure_effects(leds_t leds, int left_intensity_delta, int right_intensity_delta, led_effect_t *effect) { int ack; @@ -328,8 +340,8 @@ left_intensity_delta = abs(intensity - get_led_left_intensity()); right_intensity_delta = abs(intensity - get_led_right_intensity()); - ack = config_effects(leds, left_intensity_delta, right_intensity_delta, - effect); + ack = led_configure_effects(leds, left_intensity_delta, + right_intensity_delta, effect); /*if (ack != ACK_CMD_OK)*/ /*return ack;*/ ack = send_usb_tux_cmd(LED_SET_CMD, leds, intensity, 0); @@ -350,7 +362,7 @@ * * The effect duration has priority on the pulse period. If you set the pulse * period to 0.2s but the fading effect to 0.5s, then you will have 2 effects - * per period (or per pulse) and the pulse period will spend 1s and not 0.2s. + * per period (or per pulse) and the pulse period will spend 1s and not 0.2s. */ int led_pulse(leds_t leds, int min_intensity, int max_intensity, \ int toggle_count, float pulse_period, led_effect_t *effect) @@ -370,7 +382,7 @@ assert(toggle_count > 0); delta = max_intensity - min_intensity; - ack = config_effects(leds, delta, delta, effect); + ack = led_configure_effects(leds, delta, delta, effect); pulse_width = roundf(pulse_period/FW_MAIN_LOOP_DELAY/2); if (pulse_width < 1) Modified: daemon/trunk/led.h =================================================================== --- daemon/trunk/led.h 2008-01-04 16:48:54 UTC (rev 829) +++ daemon/trunk/led.h 2008-01-04 16:59:01 UTC (rev 830) @@ -92,6 +92,8 @@ extern int led_set(leds_t leds, int intensity, led_effect_t *effect); extern int led_pulse(leds_t leds, int min_intensity, int max_intensity, \ int toggle_count, float pulse_period, led_effect_t *effect); +extern int led_configure_effects(leds_t leds, int left_intensity_delta, + int right_intensity_delta, led_effect_t *effect); /*! @} */ #endif /* _LED_H_ */ |