/* Configures the wake conditions for the Hibernation module. */
void HibernateWakeSet(unsigned long ulWakeFlags)
/* Configures the wake conditions for the Hibernation module. */
void HibernateWakeSet(unsigned long ulWakeFlags)
{
    ASSERT(!(ulWakeFlags & ~(HIBERNATE_WAKE_PIN | HIBERNATE_WAKE_RTC |
                            HIBERNATE_WAKE_LOW_BAT)));
    HWREG(HIB_CTL) = (ulWakeFlags |
                      (HWREG(HIB_CTL) & ~(HIBERNATE_WAKE_PIN
                                          | HIBERNATE_WAKE_RTC |
                                          HIBERNATE_WAKE_LOW_BAT)));
    HibernateWriteComplete();
}