Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#8110 - Dimming Sansa wheel light

Attached to Project: Rockbox
Opened by jpcasainho (casainho) - Wednesday, 07 November 2007, 16:56 GMT+2
Last edited by Steve Bavin (pondlife) - Wednesday, 07 November 2007, 18:38 GMT+2
Task Type Feature Requests
Category Applications
Status Closed
Assigned To No-one
Player Type Sansa e200
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Private No

Details

I would like to see wheel light fade in/fade out. I think that should not be difficult to implement in software, maybe PWM, changing the duty-cycle.

Also the constant quantity of light in wheel.

Its a question of harmony, as the natural light of sun reach us, fading in on morning and out on evening. Rapid transitions are not natural to humans and I believe that behavior passes some stress to us, for example in illumination on our houses (at least in mine, here in Portugal).
This task depends upon

Closed by  Björn Stenberg (zagor)

Reason for closing:  
Additional comments about closing:  Closing all feature requests.
Comment by Bryan Childs (GodEater) - Wednesday, 07 November 2007, 18:00 GMT+2
For reference - this is a request for the sansa.
Comment by jpcasainho (casainho) - Wednesday, 07 November 2007, 18:29 GMT+2
Please see more information for the request and ideas at the mesage in the forum:
http://forums.rockbox.org/index.php?topic=13628.msg102659
Comment by jpcasainho (casainho) - Wednesday, 21 November 2007, 20:45 GMT+2
I got it :-) - I had to make function that runs with hight frequency, in this case, every 100us. First I tried with tick_add_task(); but It was not enought the 100Hz.

Now I need to have the timeout wheel light working and after put a menu entry in options for configure the value of the wheel_light_quantity.


FILE: firmware/drivers/button.c

timer_register(1, NULL, TIMER_FREQ/10000, 1, wheel_light_quantity_isr); /* Call "wheel_light_quantity_isr" every 100us. */

static signed char wheel_light_quantity = 10; /* 10% of light in whell. */

static void wheel_light_quantity_isr(void)
{
static char pwm_counter = 0;

if (wheel_light_quantity == 0) /* wheel_light turned off. */
{
GPIOG_OUTPUT_VAL &=~ 0x80; /* Button light OFF. */
return;
}

if (++pwm_counter > 100)
pwm_counter = 1;

if (pwm_counter <= wheel_light_quantity)
GPIOG_OUTPUT_VAL |= 0x80; /* Button light ON. */

else
GPIOG_OUTPUT_VAL &=~ 0x80; /* Button light OFF. */
}

Loading...