At 6:05 PM -0700 6/17/99, Jeff Ishaq wrote:
> >However, if the hardware is active (CPU running, display on, etc.)
> >then the supercap won't keep it running for more than a few ms.
>
>I guess my question would be, how many ms? Perhaps more useful info would
>be how many instructions can you execute per fraction-of-a-farad of
>supercap, and what size is the supercap on the Palm?
I don't have the exact figures, but it depends on how much of the
hardware is active. The CPU may be running full speed, or may be in
doze mode. The display is probably on. The serial port and/or IR
may or may not be on. The backlight may or may not be on.
As you can see it's not an easy calculation. Basically, each
additional library that is installed gets a sleep call, which costs
extra cycles. I consider each instruction executed to be important,
so the goal is to execute as few as possible in this critical time.
Besides, since the power-fail code is running at interrupt time, it's
not safe to call most Palm OS.
As I mentioned, if the library is not responsible for hardware, it
should return immediately. If the library IS responsible for
hardware, it should whack a bit to turn the hardware off, and THEN
return immediately. :-)
The 1ms (total) figure is not that far off. I once had some
sleep-time code that was taking about 1.5ms to execute (above and
beyond the other code that already runs), and the device never made
it into sleep mode. You don't know what else has to run at sleep
time, so the name of the game is to keep it brief.
--Steve