Re: Precise timing



Hi Chris,

Thankyou so much for your reply. I would really appreciate if you could
provide me some example or pointers to how to define and declare the function
inorder to use it. I saw few tips on codeguru and tried myself. I end up
having lot of compile errors. My id rams@xxxxxxxxxxxxxxxxxxxxxxxxx

Thanks a million

Ram

"Chris Tacke, eMVP" wrote:

SetTImer registers for a timer, which communicates events via a windows
message. The priority of thread that called SetTimer is irrelevant becasue
dispatching isn't handled by that thread. Windows MEssage handling is not
designed to be fast or deterministic, whcih is why you have problems.
timeSetEvent doesn't use windows messages, it uses its own thread and a call
back (or an event, depending on how you use it) for the notification. Way
more reliable and deterministic.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com

"wceess" <wceess@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:37061807-8C8E-425B-B673-C7C2FF4C2AEE@xxxxxxxxxxxxxxxx
Hi Chris,

Thanks for your reply. I will implement that and let you know how it went.
Sorry for my ignorance. I thought the Settimer function runs from the
graphics thread and i had lots of other timers on my graphics. So the
timer
that i had for the precise 40msec in high priority was put in the graphics
queue and served on first come basis. I was expecting there would be some
priority on which thread calling this SetTimer function. Is my assumption
right and how different this timeSetEvent would be from SetTimer function.

Thanks

"Chris Tacke, eMVP" wrote:

I don't see timeGetHardwareFrequency as being supported in CE at all, so
the
fact it won't link isn't that surprising. I believe he recommended using
timeSetEvent, which is what I'd try.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com

"wceess" <wceess@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C17069DE-49CE-433D-B5CD-1F40E2EBE1F2@xxxxxxxxxxxxxxxx
Hi Brad,

This is the error i got when i tried to compile the code with the
function
timeGetHardwareFrequency and for that matter even timeGetDevCaps
function.
So i assume that the hardware doesnt support it. I tried with including
mmsystem.h

can_sync.obj : error LNK2019: unresolved external symbol
timeGetHardwareFrequency referenced in function "unsigned long __cdecl
ssod_sync_thread(void *)" (?ssod_sync_thread@@YAKPAX@Z)
ARMV4IDbg/SSOD.exe : fatal error LNK1120: 1 unresolved externals

Thanks

"Bradley Remedios" wrote:

On Oct 21, 10:08 am, wceess <wce...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Thanks Brad for your reply. I just have a hardware that is been
loaded
with
Windows CE by some OEM. I assume i don't have the luxury of writing
driver
or creating timer interrupt. Is there a way to find out whether they
have
hardware based timer or should i ask the OEM.

Actually, in some circumstances you can still have your own driver
loaded. I had done this a while ago for Windows CE 4.2. I don't know
if you can still do this for Windows CE 5.0 / Windows CE 6.0 though.
Regardless, you'll have to talk to the OEM to determine if they have
anything setup for that as you won't want to start messing with system
timers if you are not the OEM (one of the timers will be used for the
system timer.)

You may be able get away with using the multi-media timers
(timeSetEvent). See
http://msdn.microsoft.com/en-us/library/aa913048.aspx
for more information. This routine should be able to be configured in
a way that wouldn't drift (I believe.) Please note that I have never
used the timeSetEvent call before, it's just what I found via MSDN.)

Hope this helps,
Brad.



H



.



Relevant Pages

  • Re: Precise timing
    ... Your OEM may be able to supply a version with the same interface but which uses a hardware timer? ... Windows MEssage handling is not designed to be fast or deterministic, whcih is why you have problems. ... timeSetEvent doesn't use windows messages, it uses its own thread and a call back for the notification. ...
    (microsoft.public.windowsce.app.development)
  • Re: Precise timing
    ... Windows MEssage handling is not ... timeSetEvent doesn't use windows messages, it uses its own thread and a call ... graphics thread and i had lots of other timers on my graphics. ... Windows CE by some OEM. ...
    (microsoft.public.windowsce.app.development)
  • Re: Precise timing
    ... graphics thread and i had lots of other timers on my graphics. ... priority on which thread calling this SetTimer function. ... Windows CE by some OEM. ... I had done this a while ago for Windows CE 4.2. ...
    (microsoft.public.windowsce.app.development)
  • Re: timers
    ... Do you know if Windows98 supports high-resolution timers: ... In Microsoft Windows NT, the resolution of the timer is about 10 ... > Microsoft Online Partner Support ...
    (microsoft.public.vc.mfc)
  • Re: problem of ntpd on W2K DCs
    ... Guess that those 3 DCs just need some kicks. ... Please nothe that the Windows multimedia timers are not necessarily used ... It does not modify the Windows system time in any way, ...
    (comp.protocols.time.ntp)

Quantcast