|
Power management - the final solution?
After more tests, I believe we figured out the ultimate solution for the power issues, that does resolve most (if not all) issues related to using the ACPI pulse output of the power adapter or a hardware switch (out-of-sync state between the PSU and the computer).
We use our older method of watching the presence of externally powered USB device (such as a GPS receiver) on the USB bus to determine when to put the computer to sleep. Alternatively this information can be retrieved from the P2140 using USB connection. If P2140 is used, the software can decide to either go to sleep or just give the user a warning and ask whether he wants to turn the computer off (technically that is sleep mode). In our software, we just start countdown the way OS X does when you select "Log out" or "Shut down". If the user performs any action, the countdown sequence is extended or restarted. After the computer has determined it is really the time to sleep, it first turns off the PSU (=initiates its shutdown sequence) and then goes to sleep.
The PSU can be configured for either sleep or hibernation. The deep sleep is enabled in any case on the compuer. It can be awaken from a normal sleep using the change on the USB which occurs when the new (externally powered) devices are connected. This is however not sufficient to wake the computer from the deep sleep (which may be used by choice or entered by deadman timer of the PSU). To do this, you need to go to Energy saver pane of the System preferences and enable the "Restart automatically after power failure". This way, the Mac will wake up from the deep sleep whenever the power is re-applied (after PSU has been turned on).
This solution prevents the sync problems between the PSU and the Mac, can handle random wake-ups while the car is sleeping and the power drawn is not sufficient to trigger the PSU's built-in protection and allows us to remove the need for connection of the computer's power button, which is especially welcome in the dock, whose construction becomes significantly easier.
|