At 11:26 AM +0100 4/5/01, Toby Boreham wrote:
>>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.
Well, already you're calling about a dozen APIs which violate Interrupt Service
Routine coding rules, so I'm not surprised it's crashing.
>I've had to use PrefGetAppPreferences to get the address of the original trap.
That API also cannot be called from within an interrupt service routine.
>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?
Without going into lots of detailed discussion of ISR coding rules and the limitations
of trap patching, I'll just summarize that you cannot possibly do what you are trying
to do from within trap patches to the key routines. You'll have to find another way.
Good luck,
Jim Schram
Palm Incorporated
Partner Engineering
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/