>At 3:02 PM +0100 4/4/01, Toby Boreham wrote:
>>>>On Palm OS 3.3 this hangs up the system. Does anyone have any ideas?
>>>
>>>SysTaskDelay(time * ticksPerTenth);
>>>
>>>is the problem. SysTaskDelay wants a number of ticks. Why do you 
>>>multiple it by time, and what value is time set to?
>>>
>>>Also, if you want 10 ms, I think you want
>>>
>>>ticksPerSec = SysTicksPerSecond();
>>>ticksPerTenth = ticksPerSec / 100;
>>
>>The problem is with the system totally locking up after 
>>SysTaskDelay is called inside a trap on OS 3.3, I guess this is 
>>because it's a blocking operation... I think...
>
>No, that's definitely not the problem.
>
>Does the device lock up if you take out the call to SysTaskDelay and 
>replace it with a simple for-loop?

No

>What else are you doing in your trap patch? From your original post, 
>I assume you're only patching KeyWake... you do realize that this 
>function is sometimes called from within an interrupt service 
>routine, and therefore it cannot allocate memory, perform database 
>operations, use the feature manager, etc.?

I am opening the serial port, writing one byte out, opening a receive 
window, checking for a reply and passing back to the original wakeup 
handler.

I've had to use PrefGetAppPreferences to get the address of the original trap.

I've also patched sysTrapKeySleep to close the serial port at power 
down, but OS 3.3 locks up on this, too. Is it because it doesn't 
agree that the process is owned by the trap?

Thanks,

Toby


-- 
Toby Boreham
Research and Development Director
PBE Systems Ltd.

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

Reply via email to