Here is another really nice piece i found. If you are an owner of the Maximus (1 or 2) or a Minimus (1 or 2), there is a way you can have the LED shut off after a certain amount of time. Some people like this and find it useful.
You need to edit the psgroove.c and make the following changes:
under the
enum section near the top of the file, add this:
Code:
done,
blinky,
} state = init;
Next do a search for "// done" without the quotes. For the
Maximus board add the following:
Code:
// done
if (state == done)
{
LED(GREEN);
_delay_ms(9999);
state = blinky;
}
// lights out binary 0b11000000 portb 7,6
if (state == blinky)
{
PORTB = 0xc0;
}
}
}
For the
Minimus board, add this:
Code:
// done
if (state == done)
{
LED(GREEN);
_delay_ms(9999);
state = blinky;
}
// lights out binary 0b01100000 portd 6,5
if (state == blinky)
{
PORTD = 0x60;
}
}
}
There is a maximum of 9999ms (10 seconds) in LUFA. If you wish to increase it to say 30 seconds, do something like this:
Code:
// done
if (state == done)
{
LED(GREEN);
_delay_ms(9999);
state = blinky;
LED(GREEN);
_delay_ms(9999);
state = blinky;
LED(GREEN);
_delay_ms(9999);
state = blinky;
}
// lights out binary 0b01100000 portd 6,5
if (state == blinky)
{
PORTD = 0x60;
}
}
}
Note: I am not sure how this was done but i would love to find out so we can add this to other boards. The coding part is my achilles heel, if anyone is willing to dig in and try some other boards and post back, that would be awesome !
Here are the compiled files for both with 30 second delay