[tuxdroid-svn] r836 - firmware/tuxcore/trunk
Status: Beta
Brought to you by:
ks156
From: jaguarondi <c2m...@c2...> - 2008-01-07 16:30:35
|
Author: jaguarondi Date: 2008-01-07 17:30:37 +0100 (Mon, 07 Jan 2008) New Revision: 836 Modified: firmware/tuxcore/trunk/led.c firmware/tuxcore/trunk/parser.c Log: * Now pusing is stopped when a new led_set command is called. That's the way to stop pulsing. * Removed some old commands in order to save space, we're getting short now. Modified: firmware/tuxcore/trunk/led.c =================================================================== --- firmware/tuxcore/trunk/led.c 2008-01-07 16:08:17 UTC (rev 835) +++ firmware/tuxcore/trunk/led.c 2008-01-07 16:30:37 UTC (rev 836) @@ -169,8 +169,8 @@ void led_pulse(leds_t leds, uint8_t const cnt, uint8_t const pulse_width) { /* XXX we should really find a way to optimize this loop for the 2 leds. - * We don't want to add a new function call, bu don't want to have the code - * written twice. Maybe an inline function can do it with compiler + * We don't want to add a new function call, but don't want to have the + * code written twice. Maybe an inline function can do it with compiler * optimizations. */ led_t *led = &left_led; @@ -228,11 +228,12 @@ } /** - \brief Set the delay and step which determine the speed of the fading effect. + \brief Set the delay and step which determine the speed of the fading + effect. \ingroup led \param leds Which LEDs are affected by the command \param delay Number of 4ms loops before the intensity is changed. See struct - led_command. + led_command. \param step Intenisty step applied when fading. */ void led_set_fade_speed(leds_t leds, uint8_t const delay, uint8_t const step) @@ -282,6 +283,10 @@ } led->command.setpoint = intensity; led->status.fading = true; + /* Disable pulsing at the same time. */ + led->status.pulsing = false; + led->var.pulse_tmr = 0; + led->var.pulse_flag = false; } } Modified: firmware/tuxcore/trunk/parser.c =================================================================== --- firmware/tuxcore/trunk/parser.c 2008-01-07 16:08:17 UTC (rev 835) +++ firmware/tuxcore/trunk/parser.c 2008-01-07 16:30:37 UTC (rev 836) @@ -150,9 +150,8 @@ return; } - /* Deprecated functions, may be removed in firmware v0.5. */ - /* The first 3 can be kept for the standalone as they're simpler than the - * other LED functions. */ + /* Deprecated functions, though they can be kept for the standalone as + * they're simpler than the other LED functions. */ else if (command[0] == LED_ON_CMD) { led_set_intensity(LED_BOTH, 0xFF); @@ -172,22 +171,6 @@ led_pulse(LED_BOTH, command[1], command[2]); } } - else if (command[0] == LED_L_ON_CMD) - { - led_set_intensity(LED_LEFT, 0xFF); - } - else if (command[0] == LED_L_OFF_CMD) - { - led_set_intensity(LED_LEFT, 0x0); - } - else if (command[0] == LED_R_ON_CMD) - { - led_set_intensity(LED_RIGHT, 0xFF); - } - else if (command[0] == LED_R_OFF_CMD) - { - led_set_intensity(LED_RIGHT, 0x0); - } /* Moves */ else if (command[0] == BLINK_EYES_CMD) |