[tuxdroid-svn] r739 - firmware/tuxcore/trunk
Status: Beta
Brought to you by:
ks156
From: jaguarondi <c2m...@c2...> - 2007-11-27 15:39:47
|
Author: jaguarondi Date: 2007-11-27 16:39:38 +0100 (Tue, 27 Nov 2007) New Revision: 739 Modified: firmware/tuxcore/trunk/led.c firmware/tuxcore/trunk/led.h Log: * Minor comment update. Modified: firmware/tuxcore/trunk/led.c =================================================================== --- firmware/tuxcore/trunk/led.c 2007-11-27 15:29:55 UTC (rev 738) +++ firmware/tuxcore/trunk/led.c 2007-11-27 15:39:38 UTC (rev 739) @@ -20,30 +20,30 @@ /* $Id$ */ /** \file led.c - \brief Blue leds control module + \brief Blue LEDs control module \ingroup led */ #include "led.h" -/** Buffer the leds values before being applied on the I/O port. +/** Buffer the LEDs values before being applied on the I/O port. * \ingroup led */ uint8_t leds_buffer = 0; -/** Counter for the delay between 2 toggles of the leds. */ +/** Counter for the delay between 2 toggles of the LEDs. */ static uint8_t led_delay; -/** Delay between 2 toggles of the leds when blinking them. */ +/** Delay between 2 toggles of the LEDs when blinking them. */ static uint8_t led_blinking_pw; -/** Number of times the leds should be toggled when blinking. */ +/** Number of times the LEDs should be toggled when blinking. */ static uint8_t led_blinking_cnt; /** - \brief Blink leds + \brief Blink LEDs \ingroup led \param cnt Number of blinks \param pulse_width Blinking pulse width - The leds will be toggled 'cnt' times. The pulse width can be used to change - the toggle frequency. + The LEDs will be toggled 'cnt' times. The pulse width can be used to change + the toggle frequency. */ void blink_leds(uint8_t cnt, uint8_t pulse_width) { @@ -61,17 +61,20 @@ } /** - \brief Refresh the leds I/O with the buffer value. + \brief Refresh the LEDs I/O with the buffer value. \ingroup led */ void refresh_leds(void) { + /* We should avoid glitches on the LEDs otherwise the IR receiver goes + * crazy. So we can't simply set the output pins to 0 then set them with + * leds_buffer. Only the pin that should be 0 has to be set to 0. */ LED_PT &= ~(leds_buffer ^ LED_MK); LED_PT |= leds_buffer; } /** - \brief Periodic routine that controls the leds. + \brief Periodic routine that controls the LEDs. \ingroup led This function should be called regularly as it controls the blinking. The Modified: firmware/tuxcore/trunk/led.h =================================================================== --- firmware/tuxcore/trunk/led.h 2007-11-27 15:29:55 UTC (rev 738) +++ firmware/tuxcore/trunk/led.h 2007-11-27 15:39:38 UTC (rev 739) @@ -20,12 +20,12 @@ /* $Id$ */ /** \file led.h - \brief Blue leds control interface. + \brief Blue LEDs control interface. \ingroup led */ /** \defgroup led Leds - The led module contains the functions that drive the eye leds. + The led module contains the functions that drive the eye LEDs. */ #ifndef _LED_H_ @@ -36,13 +36,13 @@ extern uint8_t leds_buffer; /** - \brief Turn both leds on. + \brief Turn both LEDs on. \ingroup led */ #define turn_leds_on() (leds_buffer |= LED_MK) /** - \brief Turn both leds off. + \brief Turn both LEDs off. \ingroup led */ #define turn_leds_off() (leds_buffer &= ~LED_MK) @@ -72,13 +72,13 @@ #define turn_right_led_off() (leds_buffer &= ~LED_R_MK) /** - \brief Read the value of the leds. + \brief Read the value of the LEDs. \ingroup led */ #define read_leds() (leds_buffer) /** - \brief Toggle leds. + \brief Toggle LEDs. \ingroup led */ #define toggle_leds() (leds_buffer ^= LED_MK) @@ -96,10 +96,10 @@ #define toggle_right_led() (leds_buffer ^= LED_R_MK) /** - \brief Turn both leds off directly on the I/O port. + \brief Turn both LEDs off directly on the I/O port. \ingroup led - This function is used to switch off the leds when the eyes are closed. + This function is used to switch off the LEDs when the eyes are closed. You shouldn't use this function elsewhere as the I/O port will be refreshed immediately with the leds_buffer value. */ |