Printf("\r\nEntering POWER_STATE_SUSPEND ...");
// alarm should be set here
SetSystemPowerState(NULL,POWER_STATE_SUSPEND, POWER_FORCE);
Printf("\r\nExiting POWER_STATE_SUSPEND ...");
So how can I setup RTC alarm so the OS resumes at particular time? And also
how do I configure to resume on COMM event (character) ?
Make sure your platform support power management.
Chuck
"Alexander Kovachev" <alex...@sontek.com> wrote in message
news:ex0XtMjC...@TK2MSFTNGP09.phx.gbl...
SetWakeupTime(...) - or something like that which will end up in
OEMSetAlarmTime
SetSystemPowerState(SUSPEND)
Any ideas ?
"Chuck Lin" <clin[at]applieddata[dot]net> wrote in message
news:uiQoiUkC...@TK2MSFTNGP10.phx.gbl...
If your system is in Sleep Mode and it hits Alarm Timer, System will wake up
and run your application.
If your System is not in Sleep Mode and it hits Alarm Timer, Registered Apps
will be launched.
Here I have undocumented important information.
I have to have two processes which one is for making system Sleep, another
for calling CeRunAppAtTime.
I have to set Alarm Timer 15 Secs or more later than current time.
As you know, Xscale can wake up GPIO Line Status Changes.
If you can wire one of GPIO line to Serial Control Line, you may wake up
your system.
But this require H/W implementation.
If you want to sample code, send me email(John...@hotmail.com).
Thanks
John Baik
"Alexander Kovachev" <alex...@sontek.com> wrote in message
news:ex0XtMjC...@TK2MSFTNGP09.phx.gbl...
You can try the other way without the fancy power management feature.
This is the easy way to do it. Please try it.
while(true)
{
// get current time
GetLocalTime(&st);
// increment 1 second
SystemTimeToFileTime(&st, &ft);
// *** store file time to time64
time64 = ft.dwHighDateTime;
time64 *= 0x100000000;
time64 |= ((LONGLONG) ft.dwLowDateTime);
// ***
time64 += (delay * 10000000);
// *** store time64 back to file time
ft.dwHighDateTime = (DWORD) (time64/0x100000000);
ft.dwLowDateTime = (DWORD) (time64%0x100000000);
// ***
FileTimeToSystemTime(&ft, &st);
// register app to run --> anything to wake up system
CeRunAppAtTime(_T("\\Storage Card\\WriteTest.exe"), &st);
Sleep(1000);
// suspend
GwesPowerOffSystem();
}
"Chuck Lin" <clin[at]applieddata[dot]net> wrote in message
news:uiQoiUkC...@TK2MSFTNGP10.phx.gbl...