[tuxdroid-svn] r822 - in firmware: tuxcore/trunk tuxdefs
Status: Beta
Brought to you by:
ks156
From: jaguarondi <c2m...@c2...> - 2008-01-04 11:39:23
|
Author: jaguarondi Date: 2008-01-04 12:39:24 +0100 (Fri, 04 Jan 2008) New Revision: 822 Modified: firmware/tuxcore/trunk/led.c firmware/tuxcore/trunk/led.h firmware/tuxdefs/defines.h Log: * Lowercased a typedef. Modified: firmware/tuxcore/trunk/led.c =================================================================== --- firmware/tuxcore/trunk/led.c 2008-01-04 11:30:15 UTC (rev 821) +++ firmware/tuxcore/trunk/led.c 2008-01-04 11:39:24 UTC (rev 822) @@ -166,7 +166,7 @@ old value is kept. 'cnt' can be set to 255 to trigger an infinite pulsing effect. */ -void led_pulse(LEDS_t leds, uint8_t const cnt, uint8_t const pulse_width) +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 @@ -206,7 +206,7 @@ \param max Maximum intensity \param min Minimum intensity */ -void led_pulse_range(LEDS_t leds, uint8_t const max, uint8_t const min) +void led_pulse_range(leds_t leds, uint8_t const max, uint8_t const min) { led_t *led = &left_led; @@ -235,7 +235,7 @@ 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) +void led_set_fade_speed(leds_t leds, uint8_t const delay, uint8_t const step) { led_t *led = &left_led; @@ -264,7 +264,7 @@ \param leds Set left, right or both leds. \param intensity 8 bits PWM value the led should be set to. */ -void led_set_intensity(LEDS_t leds, uint8_t const intensity) +void led_set_intensity(leds_t leds, uint8_t const intensity) { led_t *led = &left_led; Modified: firmware/tuxcore/trunk/led.h =================================================================== --- firmware/tuxcore/trunk/led.h 2008-01-04 11:30:15 UTC (rev 821) +++ firmware/tuxcore/trunk/led.h 2008-01-04 11:39:24 UTC (rev 822) @@ -78,11 +78,11 @@ void led_init(void); void led_shutdown(void); -void led_set_fade_speed(LEDS_t leds, uint8_t const delay, uint8_t const step); -void led_set_intensity(LEDS_t leds, uint8_t const intensity); -void led_pulse_range(LEDS_t leds, uint8_t const max, uint8_t const min); +void led_set_fade_speed(leds_t leds, uint8_t const delay, uint8_t const step); +void led_set_intensity(leds_t leds, uint8_t const intensity); +void led_pulse_range(leds_t leds, uint8_t const max, uint8_t const min); void pulse_led(led_t *const led, uint8_t const cnt, uint8_t const pulse_width); -void led_pulse(LEDS_t led, uint8_t const cnt, uint8_t const pulse_width); +void led_pulse(leds_t led, uint8_t const cnt, uint8_t const pulse_width); void led_control(bool mask); #endif /* _LED_H_ */ Modified: firmware/tuxdefs/defines.h =================================================================== --- firmware/tuxdefs/defines.h 2008-01-04 11:30:15 UTC (rev 821) +++ firmware/tuxdefs/defines.h 2008-01-04 11:39:24 UTC (rev 822) @@ -32,6 +32,7 @@ #ifndef _DEFINES_H_ #define _DEFINES_H_ +#include <stdint.h> /** * \name Identifiers and addresses. * @{ */ @@ -170,14 +171,16 @@ /** * Type indicating which led should be affected by the command. * The left LED is affected to bit0 and the right LED is at bit1. This - * simplifies comparisons. + * simplifies comparisons. Assigning an hex value helps keep in mind the bit + * relation. */ typedef enum { + LED_NONE = 0, LED_LEFT = 0x01, LED_RIGHT = 0x02, LED_BOTH = 0x03, -} LEDS_t; +} leds_t; /*! @} */ @@ -198,7 +201,14 @@ /*! @} */ +/** + * \name Various specifications + */ +/*! @{ */ +#define FW_MAIN_LOOP_DELAY 0.004 /*! @} */ +/*! @} */ + #endif /* _DEFINES_H_ */ |