Tungsten C and NilEvent problem ?

2003-08-22 Thread Bertrand Simon
Does anybody knows about problems on nilEvent ONLY on Tungsten C.

Simple code like :

EvtGetEvent(event, sysTicksPerSecond);
if (event.eType==nilEvent)  UpdateDisplay();

does not work on T|C only ...

Any hints will be appreciated :-)

Bertrand Simon.
http://GPSpilot.com



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Tungsten C and NilEvent problem ?

2003-08-22 Thread Dave Lippincott
Just because you are not getting a nilEvent event, doesn't mean its broken.
The time out specified in EvtGetEvent generates a nilEvent IFF no event has
been placed in the queue within the specified time.  Could the Tungsten C
have a high frequency of events due to the radio?  I'd change the 'if
(event.eType==nilEvent)  UpdateDisplay();' line to fire on all events and
only call UpdateDisplay() when its time.  You could also increase  the time
out frequency.
Any chance you are allowing the system or another routine to process events
before you? (it could be eating up your nilEvents)

- Original Message - 
From: Bertrand Simon [EMAIL PROTECTED]
Newsgroups: palm-dev-forum
To: Palm Developer Forum [EMAIL PROTECTED]
Sent: Friday, August 22, 2003 8:44 AM
Subject: Tungsten C and NilEvent problem ?


 Does anybody knows about problems on nilEvent ONLY on Tungsten C.

 Simple code like :

 EvtGetEvent(event, sysTicksPerSecond);
 if (event.eType==nilEvent)  UpdateDisplay();

 does not work on T|C only ...

 Any hints will be appreciated :-)

 Bertrand Simon.
 http://GPSpilot.com



 -- 
 For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: nilEvent problem

2003-08-14 Thread Alan Ingleby
Perhaps you should be checking how long it's been since your last time bar
drop, an don't do it again if it's been less than 250ms.

You should also look into UserEvents, and generate them where needed, rather
than relying on nilEvents, as these can be generated when you don't expect
them.  nilEvents are generated by the system to flash the cursor on and off
for example.

Alan
Season Wong [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

 I have design an timing critical application that having a time bar
dropping
 every 250ms, so I used

 EvtGetEvent(event, SysTicksPerSecond() / 4)

 at my EventLoop routine and handled the dropping of time bar at nilEvent,
it
 works fine on PalmOS 3.x and 4.x, but having problem on Zire 71, the time
 bar drops very fast. Please help!


 Thanks!

 Tony







-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


nilEvent problem

2003-08-14 Thread Season Wong
I have design an timing critical application that having a time bar dropping
every 250ms, so I used

EvtGetEvent(event, SysTicksPerSecond() / 4)

at my EventLoop routine and handled the dropping of time bar at nilEvent, it
works fine on PalmOS 3.x and 4.x, but having problem on Zire 71, the time
bar drops very fast. Please help!


Thanks!

Tony



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: nilEvent problem

2003-08-14 Thread Tony
Aaron, thanks for help! It works perfect now!


Tony

Aaron Ardiri [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

  I have design an timing critical application that having a time bar
dropping
  every 250ms, so I used
 
  EvtGetEvent(event, SysTicksPerSecond() / 4)
 
  at my EventLoop routine and handled the dropping of time bar at
nilEvent, it
  works fine on PalmOS 3.x and 4.x, but having problem on Zire 71, the
time
  bar drops very fast. Please help!

 tony, you cannot rely on this.

 EvtGetEvent() uses the second parameter to say:

   well, if nothing happened by this time, send me a nilEvent

 there are many circumstances where the OS/3rd party applications can
 force extra nilEvents to happen, you need to get smart about this
 and use something like:

 myTimeOutMax = SysTicksPerSecond() / 4;
 myTimeOut= 1;
 myTimeA  = TimGetTicks()
 do
 {
EvtGetEvent(event, myTimeOut)
myTimeB = TimGetTicks();

if (event.eType == nilEvent)
{
  if ((myTimeB - myTimeA)  myTimeOutMax)
  {
myTimeA = TimGetTicks();

// handle nil event
  }
}

myTimeOut = (myTimeOutMax - (myTimeB - myTimeA));
if (myTimeOut  0) myTimeOut = 0;
  }
  ...

 NOTE: this is tested code (i have it in every one of my games), its
   just i typed it in from memory just as i woke up (ie: now),
   the concept is there - figure it out.

 ---
 Aaron Ardiri[EMAIL PROTECTED]
 CEO - CTO   +46 70 656 1143
 Mobile Wizardry  http://www.mobilewizardry.com/







-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: nilEvent problem

2003-08-14 Thread Aaron Ardiri
 I have design an timing critical application that having a time bar dropping
 every 250ms, so I used
 
 EvtGetEvent(event, SysTicksPerSecond() / 4)
 
 at my EventLoop routine and handled the dropping of time bar at nilEvent, it
 works fine on PalmOS 3.x and 4.x, but having problem on Zire 71, the time
 bar drops very fast. Please help!

tony, you cannot rely on this.

EvtGetEvent() uses the second parameter to say:

  well, if nothing happened by this time, send me a nilEvent

there are many circumstances where the OS/3rd party applications can
force extra nilEvents to happen, you need to get smart about this
and use something like:

myTimeOutMax = SysTicksPerSecond() / 4;
myTimeOut= 1;
myTimeA  = TimGetTicks()
do
{
   EvtGetEvent(event, myTimeOut)
   myTimeB = TimGetTicks();

   if (event.eType == nilEvent)
   {
 if ((myTimeB - myTimeA)  myTimeOutMax)
 {
   myTimeA = TimGetTicks();

   // handle nil event
 }
   }

   myTimeOut = (myTimeOutMax - (myTimeB - myTimeA));
   if (myTimeOut  0) myTimeOut = 0;
 }
 ...

NOTE: this is tested code (i have it in every one of my games), its 
  just i typed it in from memory just as i woke up (ie: now), 
  the concept is there - figure it out.

---
Aaron Ardiri[EMAIL PROTECTED]
CEO - CTO   +46 70 656 1143
Mobile Wizardry  http://www.mobilewizardry.com/



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/