Integrate the Power Manager Sample PDD (Compact 2013)

3/26/2014

Windows Embedded Compact 2013 includes a default Power Manager platform dependent driver (PDD) implementation in this location:

%_WINCEROOT%\Public\Common\Oak\Drivers\Pm\Pdd\Default

This baseline PDD implementation supports the following system power states:

  • On
  • UserIdle
  • SystemIdle
  • Resuming
  • Suspend

Although you can use this default Power Manager PDD as the basis for a customized Power Manager implementation, we recommend that you use the updated, modularized Power Manager sample PDD described in this article. You can download the source code for this enhanced Power Manager sample PDD from CodePlex.

The Power Manager sample PDD supports the following system power states:

  • On
  • UserIdle
  • Unattended
  • Resuming
  • Suspend
  • ScreenOff
  • BacklightOff

The remainder of this article assumes that you are using this enhanced Power Manager sample PDD as the basis for your power management implementation.

Install the Power Manager PDD source code in your platform directory at the following location.

%_WINCEROOT%\Platform\<your platform>\Src\Drivers\Pm\Pdd

If this location already exists in your platform directory, you can copy the source files from the Power Manager sample PDD into this location. Be sure to backup any existing source files before copying new source files into this location.

If your platform directory does not have an existing Power Manager PDD folder, then you must create this location and configure two build files so that your OS design builds the Power Manager PDD source files and includes the resulting dynamic link library in your run-time image.

To integrate the Power Manager sample PDD into your platform directory

  1. Create the folder %_WINCEROOT%\Platform\<your platform>\Src\Drivers\Pm.

  2. Edit the drivers directory build file %_WINCEROOT%\Platform\<your platform>\Src\Drivers\Dirs and add pm to the list of directories to build. For example:

    DIRS= \
        ndis_dc21x4 \
        keybd \
        pm
    
  3. Create the folder %_WINCEROOT%\Platform\<your platform>\Src\Drivers\Pm\Pdd.

  4. Create the file %_WINCEROOT%\Platform\<your platform>\Src\Drivers\Pm\Dirs and add a directive that specifies the Pdd directory in the list of directories to build. You can add the following single-line directive to this file to cause the build system to build the Pdd directory:

    DIRS= pdd
    
  5. Copy the Power Manager sample PDD source files to %_WINCEROOT%\Platform\<your platform>\Src\Drivers\Pm\Pdd. Be sure that the following files are copied to this location: Platform.cpp, Pwstatemgr.h, Pwstatemgr.cpp, Pwstates.h, Pwstates.cpp, Makefile, and Sources.

After you integrate the Power Manager sample PDD into your platform directory, be sure to enable the Power Management catalog item in your OS design. Use the following steps to enable full power management support.

To enable power management support in your OS design

  1. With your OS design project open in Visual Studio, select the Catalog Items View pane. If the Catalog Items View pane is not visible, click the View menu, Other Windows, and Catalog Items View.

  2. In the Catalog Items View pane, expand Core OS Services and Power Management (Choose 1).

  3. Under Power Management (Choose 1), select the Power Management (Full) catalog item.

  4. On the File menu, click Save All to save your catalog item changes.

Alternately, if you are using a command-line build environment, you can set SYSGEN_PM to include full Power Manager functionality in your OS design. For more about the Windows Embedded Compact build system, see Build System Command Line Tools.

When you add this catalog item, the build system includes the Power Manager common code library, MDD, and PDD in your OS design. After you have followed these steps, rebuild your OS design and verify that there are no build errors. If you do not get build errors, the Power Manager DLL (Pm.dll) should be available in your OS design.

See Also

Concepts

Implement System Power States