At 5:02 PM +0100 4/24/01, Toby Boreham wrote:
>I have written a keyboard driver for the Palm OS, and I am having a problem with
>SrmOpen()
>
>Due to the event driven nature of the keyboard, we have to patch sysTrapEvtEnqueueKey.
>
>During that patched trap the following call fails:
>
> Err error = errNone;
> UInt32 nsmPresent = 0;
> UInt16 serRef = 0;
>
> // is the new serial manager installed? check the feature
> error = FtrGet(sysFileCSerialMgr, sysFtrNewSerialPresent, &nsmPresent);
>
> // if the new serial manager is present, try and open the port
> // if not, then we will jump straight to the end and return false
> if(!error && nsmPresent != 0)
> {
> // ** If we are reset during a hotsync, we crash here... **
> // the new serial manager is present, open the serial port
> error = SrmOpen(serPortID, serPortBaudRate, &serRef);
> // ** If we are reset during a hotsync, we crash here... **
> }
Do NOT do this. EvtEnqueueKey is called from within an interrupt service routine and
therefore must follow ISR coding rules. You absolutely may not call the feature
manager or open the serial port from within this type of trap function.
Regards,
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/