Hi Susana,
Thanks for the input.
That's one of the solutions we tried, unfortunately, that solution can
only work when your application is running.
We needed a background application to monitor the port.
Eg. The user would be running notepad, and in the background, we're
polling the IR port to see if any keyboard commands have been sent, and
then we send the key presses to notepad.
Cheers
John

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Susana
Carranza
Sent: 12 May 2006 20:29
To: Palm Developer Forum
Subject: RE: can't run 1 second almsetalarm on Palm TX and Emulator


John,

I finally got it to work with one second.  I posted this question at the
PluggedIn forum and somebody suggested to use the nil event coupled with
TimGetTicks.  

Here is what I did:
1) on the EventLoop I used SysTicksPerSecond shr 3 as the time out, to
force a nil event a few times a second
2) on nilEvent, I call a procedure to check time
3) on my procedure, I check the time with TimGetTicks and compare with
an old time - if the time passed is >= my interval, then I call my
serial communications routine, otherwise, nothing happens

The timing is still not perfect, but it works well and it does not
freeze the commands, or overwork the system.  The added benefit is that
it allows me to use data rates < 1 second if I ever need it.

Susana


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of John Sutton
Sent: Wednesday, May 03, 2006 1:17 PM
To: Palm Developer Forum
Subject: RE: can't run 1 second almsetalarm on Palm TX and Emulator

Sorry to be the bearer of bad news Susan, but our application was
exactly like yours.
In fact, it's a bespoke chord keyboard that uses raw IR to communicate.
We needed to poll the IR receive port regularly (1 second would have
been just about adequate).
We tried a number of things similar to what you are suggesting, we got
nowhere - well we flattened a few batteries, but otherwise achieved
nothing!
The solution we finished with was to set the Alarm for 2 seconds, and
when the user wasn't using the keyboard for a while, there would be a
maximum 2 second delay before the system burst back into life.
What we then did was set it at 1 second (as you know, this results in
zero seconds, or an instant callback), we'd allow this to 'free run' for
around 20 seconds until no more activity was seen, then set it back to 2
seconds for the sake of the battery!
Regards
John 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Susana
Carranza
Sent: 03 May 2006 18:41
To: Palm Developer Forum
Subject: RE: can't run 1 second almsetalarm on Palm TX and Emulator


I considered using sysTaskDelay(SysTicksPerSecond) and setting an
immediate
alarm after for the special case of 1 second.   This makes the scan work
OK
(well, it is not quite always 1 sec, but I could live with that), but it
puts the user interface on hold during the delay (i.e., can't press any
buttons).  Besides, I think it may burden the system too much.

Are there any other types of time delay routines, or other approaches to
fixed time repeat loops?


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of John Sutton
Sent: Wednesday, May 03, 2006 11:15 AM
To: Palm Developer Forum
Subject: RE: can't run 1 second almsetalarm on Palm TX and Emulator

I have seen this problem before on a few different devices, it's in the
archives somewhere.
I never found a workaround for any of the devices I was using.
We just had to live with 2 seconds instead of 1 :(

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of scarranza
Sent: 03 May 2006 16:05
To: Palm Developer Forum
Subject: can't run 1 second almsetalarm on Palm TX and Emulator

I am pretty new to Palm OS.

I am creating an application to collect data via serial port at fixed
intervals.

I used the almsetalarm and I linked my send/receive procedure to that.
The program works well with rates 2 seconds and up, but when I try to
set 1 second, it seems to be setting an immediate alarm (i.e., the scan
keeps going as fast as the Palm can handle)

The application works perfectly on the Garnet simulators with the 1
second rate, so I don't understand why it does not work with the TX and
the Emulator. Does anyone know of this problem, or have any suggestions?



Side note - I tried a few times to transfer the TX ROM to use it with
the emulator, but no luck.  Anybody knows if there is a TX ROM available
online, or if it is compatible with the emulator?
--
For information on using the PalmSource Developer Forums, or to
unsubscribe, please see http://www.palmos.com/dev/support/forums/

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




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

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




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

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

Reply via email to