#40543 - maniacdevnull - Wed Apr 20, 2005 4:07 am
I'm trying to write some power management code. I have something that seems to be working fine for now, I'm just looking if anyone has any suggestions / improvements for it.
That code seems to work fine for now, when the lid is shut, the screens power off, when the lid opens they come back on. I just wish I knew how to make the power light blink like in real DS games :-(
Code: |
uint8 xkeys = (~IPC->buttons); bool screenOn = true; ...snip... if (xkeys < 128 && screenOn) { POWER_CR = POWER_CR - 527; screenOn = false; } if (xkeys >= 128 && !screenOn) { POWER_CR = POWER_CR + 527; screenOn = true; } |
That code seems to work fine for now, when the lid is shut, the screens power off, when the lid opens they come back on. I just wish I knew how to make the power light blink like in real DS games :-(