To control the backlight, you must know the relevant settings. The following is the configuration of the backlight in wince. It is read in the bl_readregistry function.
- [HKEY_CURRENT_USER/controlpanel/backlight]
- "Actimeout" = DWORD: 0000012c
- "Useext" = DWORD: 00000001
- "Usebattery" = DWORD: 00000001
- "Batterytimeout" = DWORD: 0000003c
The driver backlite is a backlight control driver, but it is an incomplete driver. You need to write code control based on your own platform. Different circuit control methods are different and related to LCD. First, complete void backlightctrl (bool blight), the control function of your platform ). Below are my own functions.
- Void backlightctrl (bool blight)
- {
- Volatile iopreg * s2410iop;
- S2410iop = (iopreg *) iop_base;
- S2410iop-> rgpgcon & = ~ (3 <8 );
- S2410iop-> rgpgcon | = (1 <8 );
- If (blight)
- {
- S2410iop-> rgpgdat | = (1 <4 );
- Retailmsg (1, (text ("turn on! /R/N ")));
- }
- Else
- {
- S2410iop-> rgpgdat & = ~ (1 <4 );
- Retailmsg (1, (text ("turn off! /R/N ")));
- }
- }
Then, in bl_monitorthread, the backlight will be switched ON and OFF based on different events. If your LCD supports brightness adjustment, it can be handled similarly. In addition, to enable automatic LCD recovery when operating the touch screen, you also need to add the "userinputevent" event to the touch screen driver and set the event by pressing or lifting it. In this way, it can be associated with the backlight driver. The keyboard driver is similar.
In addition, add
- [HKEY_LOCAL_MACHINE/Drivers/builtin/backlite]
- "Index" = DWORD: 0
- "Prefix" = "Bak"
- "DLL" = "backlite. dll"
- "Order" = DWORD: 29
Add in platform. bib
- Backlite. dll $ (_ flatreleasedir)/backlite. dll NK sh
Note: If the "Copy of dirs" and "dirs" files in the DRIVERS directory do not have driver information, you need to add them by yourself, this mainly enables PB to compile and copy the generated files to the $ (_ flatreleasedir) directory. If you do not add the files, manually compile the files with cmd and copy the files, finally, use make image to generate the system.