// // Enable the Hibernation module. // SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE);
// // Per an erratum, sometimes on wake the Hibernation module control // register will be cleared when it should not be. As a workaround a // location in the non-volatile data area can be read instead. This data // area is cleared to 0 on reset, so if the first location is non-zero then // the Hibernation module is in use. In this case, re-enable the // Hibernation module which will ensure that the control register bits have // the proper value. // HibernateDataGet(&ulHibernateCount, 1); if(ulHibernateCount) { HibernateEnableExpClk(SysCtlClockGet()); HibernateClockSelect(HIBERNATE_CLOCK_SEL_DIV128); }
// // Check to see if Hibernation module is already active, which could mean // that the processor is waking from a hibernation. // if(HibernateIsActive()) { // // Read the status bits to see what caused the wake. // ulStatus = HibernateIntStatus(0); }
// // Enable the Hibernation module. This should always be called, even if // the module was already enabled, because this function also initializes // some timing parameters. // HibernateEnableExpClk(SysCtlClockGet());
// // If the wake was not due to button or RTC match, then it was a reset. // if(!(ulStatus & (HIBERNATE_INT_PIN_WAKE | HIBERNATE_INT_RTC_MATCH_0))) { // // Configure the module clock source. // HibernateClockSelect(HIBERNATE_CLOCK_SEL_DIV128);
// // Finish the wake cause message. // RIT128x96x4StringDraw("RESET", COL(7), ROW(4), 15);
// // Wait a couple of seconds in case we need to break in with the // debugger. // SysTickWait(3 * 100);
// // Allow time for the crystal to power up. This line is separated from // the above to make it clear this is still needed, even if the above // delay is removed. // SysTickWait(15); }
// |