none
how do I force touch driver to use new calibration data? RRS feed

  • General discussion

  • In WinCE 6, I am switching from a hive registry to a ram-based registry.  Our touchscreens are individually different enough that we use the built-in calibration UI in control panel.  So, I cloned CPLMAIN and added code to the calibrate dialog so that the new calibration data gets written to a text file for me.  I know I can read that text file and stuff its contents into the registry upon power-up.    But, I'm struggling to determine how early I can transfer that info to the registry, so that the correct calibration data is in use when the touch screen becomes active.   I have a default calibration in the registry from the CE build, so typically there is no need for operator to calibrate at power-up, but the default is not good enough for use all of the time.

    My reginit.ini looks like the following.  can I run a simple utility after gwes and before explorer and have it take effect?  Or maybe I need to stuff the values in before GWES?   Oh, BTW, I don't have the technical chops right this moment to write some low-level driver for revising the registry, so I really need to be able to use RegSetValueEx to update the registry.  Is that available after GWES, or only after Explorer?

    Would it preferable to wait until AutoLaunch, stuff the registry there, and then call some routine in the driver?  Maybe DDsiTouchPanelAttach?  If so, how does one accomplish that?

    [HKEY_LOCAL_MACHINE\init]
    "Launch20"="device.dll"

    "Launch30"="gwes.dll"
    "Depend30"=hex:14,00

    "Launch50"="explorer.exe"
    "Depend50"=hex:14,00, 1e,00

    "Launch60"="servicesStart.exe"
    "Depend60"=hex:14,00

    "Launch99"="AutoLaunch.exe"
    "Depend99"=hex:0a,00,14,00,1e,00,32,00


    Tuesday, June 5, 2012 1:54 PM

All replies

  • Didn't you have this working a year ago?  http://social.msdn.microsoft.com/Forums/en-US/winembplatdev/thread/4a9c1786-9048-4330-b13a-eae2f7c9a48f

    Of course one way would be from a driver, I have the code on my blog that you could modify to read your file and update the registry. see http://geekswithblogs.net/BruceEitman/archive/2008/08/13/windows-ce-stream-interface-driver-power-management.aspx


    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com

    Tuesday, June 5, 2012 3:44 PM
    Moderator
  • Yes, the touch driver issues from last year are working fine.  Other problems with memory chips and drivers are forcing a switch to RAM-based registry.  Thanks for the reference to the 2008 article from your blog.   First, I'm gonna try stuffing the CalibrationData info into the registry as part of DdsiTouchPanelAttach, since it appears that this is the first bit of activity taking place in my touch driver, before the touch cal calculations are performed.  
    Tuesday, June 5, 2012 5:14 PM
  • I've struggled with this exact situation before as well. I resolved it by adding a named event in the touch driver that reloads the calibration data from the registry when signaled.

    At boot, a small application starts that reads the calibration data from disk, puts it in the registry, flushes HKEY_LOCAL_MACHINE and then sets the event. The touchdriver then loads the calibration data from the registry and applies it in the driver.

    If I remember correctly there was no point early enough to stuff it in the RAM based registry that allowed the touch driver to load it. IOCTL_INIT_REGISTRY was too early (filesystem not mounted), same with the DdsiTouchPanelAttach and anything else was too late (touch driver already loaded).


    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: http://guruce.com/blog

    GuruCE
    Microsoft Embedded Partner
    http://guruce.com
    Consultancy, training and development services.

    Wednesday, June 6, 2012 12:39 AM
    Moderator
  • Thanks for that info.  It is the "applies it in the driver" part that I don't see how to get implemented; i.e., I don't know what needs to be invoked or signaled in order to force the method that I see called "Error Analysis" that recomputes the mapping between raw touch ADC values and the screen coordinates.
    Wednesday, June 6, 2012 2:21 PM
  • You simply have to go through all the calibration points using TouchDriverCalibrationPointGet, fill in the calibration data and finally apply the calibration data using TouchPanelSetCalibration. The code should already be there (as the touch driver has to do all this already). All you do is copy that code into a thread that waits for the event to be set.

    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: http://guruce.com/blog

    GuruCE
    Microsoft Embedded Partner
    http://guruce.com
    Consultancy, training and development services.

    Wednesday, June 6, 2012 9:44 PM
    Moderator
  • Michel, thanks very much for the help.  I think I understand your explanation... I did not see how the "calibrationData" string was actually getting used until I mulled over what you wrote here.  I'll give that a try.
    Thursday, June 7, 2012 2:30 AM