Posted by: tonyc
Fun with empeg_power - 21/08/2005 01:44
According to the comments in arch/arm/special/empeg_power.c, and a couple
of old BBS posts, the empeg's power PIC can wake up the empeg at more or
less user-definable intervals. I've tried to play with this functionality, but
so far I'm not seeing what I expect. Here's what I'm doing:
Code:
So, if I'm understanding the comments in empeg_power.c correctly, the above
code should be setting the power PIC's wakeup timer to wake up the empeg in
roughly 15 seconds, and then powering the empeg off. What I see is the empeg
does indeed power off, but doesn't wake up, or, rather, doesn't boot up.
Now, this part of the empeg_power.c comments is where I'm thinking I might
be losing:
Code:
What I don't understand is "if there are no events pending when the system wakes
up." What's a pending event in this context? Is my code fragment above actually
waking the empeg up, but it's going right back to sleep again? How can I get it to
actually wake itself up and boot into the player, for instance?
of old BBS posts, the empeg's power PIC can wake up the empeg at more or
less user-definable intervals. I've tried to play with this functionality, but
so far I'm not seeing what I expect. Here's what I'm doing:
Code:
int fd = open("/dev/empeg_power", O_RDONLY);
int time = 1;
if (fd < 1)
{
printf("couldn't open empeg_power\n");
exit(-1);
}
int rc = ioctl(fd, EMPEG_POWER_WAKETIME, &time);
sleep(1);
printf("goodbye, cruel world...\n");
rc = ioctl(fd, EMPEG_POWER_TURNOFF, NULL);
So, if I'm understanding the comments in empeg_power.c correctly, the above
code should be setting the power PIC's wakeup timer to wake up the empeg in
roughly 15 seconds, and then powering the empeg off. What I see is the empeg
does indeed power off, but doesn't wake up, or, rather, doesn't boot up.
Now, this part of the empeg_power.c comments is where I'm thinking I might
be losing:
Code:
* If there are no events pending when the system wakes up, it just powers
* itself off again. Generally, this brief flash of power lasts no more than
* 300ms (using 200mA - an average hourly drain of 16uAH).
What I don't understand is "if there are no events pending when the system wakes
up." What's a pending event in this context? Is my code fragment above actually
waking the empeg up, but it's going right back to sleep again? How can I get it to
actually wake itself up and boot into the player, for instance?