All Forums
 Microsoft Windows CE
 CE Drivers
 mpm.h (BitsyX CE.NET power management)
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

mattlevy

11 Posts

Posted - 03 Nov 2003 :  20:16:17  Show Profile  Email Poster
I am attempting to use the new Power Management featues in CE.net on your BitsyX device but the file pm.h is looking for another file called mpm.h that is no where to be found in the SDK???

Any input on this?

Also the ultimate goal I have here is to be able to cycle suspend/resume from the application...is this possible?

Thanks,

Matt

ctacke

877 Posts

Posted - 04 Nov 2003 :  09:47:10  Show Profile  Email Poster
Suspending the device can be done using a KernelIoControl control. See Topic 649 for some sample code.

You application cannot directly resume the device, because when in sleep mode, all processes are suspended. You can, however, use a notifcation to wake the device. Take a look at the CeRunAppAtEvent or CeRunAppAtTime APIs.
Go to Top of Page

mattlevy

11 Posts

Posted - 04 Nov 2003 :  19:16:59  Show Profile  Email Poster
I would like to try your example, but I am not able to find pnotify.h and mnotify.h in your SDK, which the compiler needs:

notify.h
-------------
#ifdef WINCEOEM
#include
#ifdef WINCEMACRO
#include // internal defines
#endif
#endif

Is there another way to reference these functions?
Go to Top of Page

ctacke

877 Posts

Posted - 06 Nov 2003 :  14:22:57  Show Profile  Email Poster
I'm not sure why your compiler is complaining. Neither WINCEOEM or WINCEMACRO should be defined unless you're building with Platform Builder, in which case pnotify.h and mnotify.h are both in \public\common\oak\inc.

Where are these getting defined in your project?
Go to Top of Page

mattlevy

11 Posts

Posted - 06 Nov 2003 :  18:17:41  Show Profile  Email Poster
That's just the thing, there is no where in my settings where I am defining WINCEOEM or WINCEMACRO. And I am not building with Platform Builder.

Any more suggestions?
Go to Top of Page

ctacke

877 Posts

Posted - 07 Nov 2003 :  09:45:00  Show Profile  Email Poster
Based on the fact that it's looking for these files, they must be defined somewhere. You might try undefining them in your code, just prior to including notify.h like this:


#undef WINCEOEM
#undef WINCEMACRO
#include "notify.h"

...
Go to Top of Page

mattlevy

11 Posts

Posted - 07 Nov 2003 :  15:23:33  Show Profile  Email Poster
Thanks Chris, I got it to work finally.

But now we are having another problem. We have two different engines putting the bitsy to sleep and waking it up...The application I am working on and another module that is waking it up and putting it to sleep by shorting the pins physically using "System Wake Up" on the top board. What happens is:

1. I put the device to sleep through code using GwesPowerOffSystem()
2. Our other module (a BASIC STAMP) attempts to wake it up using "system wake up" on the top board.
3. The green LED on the Bitsy's bottom board comes on for a second as if to power-up.
4. The light goes off after about 1.5 seconds with a "PowerInterruptThread WAIT_OBJECT_0" message
aand goes back to sleep again.

I need to know if I can tell the Bitsy to shut down through code and then have the BASIC STAMP tell it to wake up by shorting the pins on the system wake-up? Can this work harmoniously?

Thanks for all your help,

Matt
Go to Top of Page

ctacke

877 Posts

Posted - 07 Nov 2003 :  15:35:00  Show Profile  Email Poster
Matt,

First, while compiling another sample, I noticed a pnotify.h/mnotify.h set of errors, but the app still compiled properly. So you might check to see if you were actually getting compile errors before, or if they were some strange errant output from the compiler that didn't actually stop the build.

Second, as to your question, yes the two methods *should* work harmoniously.

As an analogous situation, consider using a Pocket PC, where you have a calendar notification to happen at a certain time (Calendar simply uses CeRunAppAtTime). If the device is "off" at the time, the system will wake, and the notification will be displayed. If the system is "on", the Calendar will come to the fore and the notification will be displayed.

Putting your ADS system to sleep is the same as turning Pocket PC "off", as PPCs are never actually powered down (unless the battery dies).

However, I just tested this with a BitsyX running Build 4.10.28 and see the same problem, so we'll look into it.
Go to Top of Page

mattlevy

11 Posts

Posted - 07 Nov 2003 :  15:40:40  Show Profile  Email Poster
Thanks...Please let me know.
Go to Top of Page

mattlevy

11 Posts

Posted - 07 Nov 2003 :  16:05:19  Show Profile  Email Poster
Chris...

Another point I wanted to state/ask you about is that when we power on/off physically we can get the display to come back up, but when I use GwesPowerOffSystem() and then attempt to wake the system up through CERunAppAtTime(appl, st), it runs "appl" but we don't get the display back. This may be completely unrelated to the above problem, but as a side question, what do i need to call to get the display back?
Go to Top of Page

anatolyk

9 Posts

Posted - 09 Dec 2003 :  16:03:18  Show Profile  Email Poster
When BitsyX suspended via taskbar menu "Suspend", I can't wake it up by tapping touch-screen / using keyboard.

When system goes to sleep on its own, it wakes up just fine.

CE 4.10, Build 908, 5-wire screen/Burr Brown controller.

Go to Top of Page

ctacke

877 Posts

Posted - 10 Dec 2003 :  13:50:01  Show Profile  Email Poster
anatolyk: I think you are confused about the state of the device, as the BitsyX does not currently support waking on a touchscreen interrupt.

When your device has been idle for a period of time (which can be adjusted using the 'Display' Control Panel applet), the backlight will shut off. While this provides significant power savings, the device itself is still running and operating. Touching the touchscreen or keyboard will turn the backlight back on.

When you choose 'Suspend' from the Start menu, the processor goes into suspend mode and most of the board is completely powered down. In this state the device uses only enough power to maintain DRAM, but it also cannot respond to interrupts.

If you specifically need the ability to wake on a touchscreen interrupt, please contact our Sales staff.
Go to Top of Page

akidder

1519 Posts

Posted - 10 Dec 2003 :  13:58:41  Show Profile  Email Poster
Take a look at the links to the inactivity timer posts in the CE Power management topic index (topic 785) for details about the registry keys to use and how to set them programmatically.
Go to Top of Page

anatolyk

9 Posts

Posted - 10 Dec 2003 :  14:30:23  Show Profile  Email Poster
So, currently there is no way to wake up BitsyX suspended by "Suspend"?
Go to Top of Page

ctacke

877 Posts

Posted - 10 Dec 2003 :  14:34:29  Show Profile  Email Poster
Sure, short the RQONOFF pins (J36 on the BitsyX connector board).
Go to Top of Page
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.05 seconds. Snitz Forums 2000