gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Using the "sleep" LED blink rate

#92975 - kvance - Sun Jul 16, 2006 4:51 am

I have a simple problem with the following sleep handler:
Code:
void lid_opened() /* Called on IRQ_LID. */
{
        writePowerManagement(PM_CONTROL_REG,
                             PM_SOUND_PWR |
                             PM_SOUND_VOL |
                             PM_BACKLIGHT_BOTTOM |
                             PM_BACKLIGHT_TOP |
                             PM_LED_ON);
}

void lid_closed() /* Called on REG_KEYXY & BIT(7) */
{
        writePowerManagement(PM_CONTROL_REG, PM_LED_SLEEP);
        swiSleep();
}


The power LED stays solid the whole time. The actual sleep mode seems to work: the sound and backlights are off, and I can see everything power back up when I open the lid.

If I change PM_LED_SLEEP to PM_LED_BLINK, it does the "wi-fi is in use" blink while sleeping, and then goes back to solid when the lid opens. Are there other preconditions to setting PM_LED_SLEEP?
_________________
Corner Office: dev LJ
HexxagonDS, dsmzx, more...

#92982 - Zeep - Sun Jul 16, 2006 7:08 am

I don't know anything about development, but it really bugs me that no homebrew program yet accurately replicates the sleep/wifi blink pattern. sgstair's wifi lib that everyone uses (which has one long blink) doesn't blink the same as a normal wifi game (which has two rapid blinks). I know it's not really important, but can it really be so difficult to just make it blink regularly?