I would suspect a reentrancy problem in their implementation of the software stack for passing variables to functions. Since constructing a stack frame may take several instructions, the code created by the compiler could easily be vulnerable to some sort of reentrancy problem if the same function is called both at base level and at interrupt level. It is entirely conceivable that the compiler creates a separate stack for interrupt code. With a processor architecture like the PIC, it is not at all easy to deal with some of these issues in a really general-purpose way. I have even heard rumors of compilers that construct and analyze a call tree, then emit non-reentrant code for functions that can never be called recursively. Doing that could result in very tight code -- good enough to be very hard to beat with hand coding, especially after a couple of design revisions... > On Mon, 30 Oct 2000 11:52:51 -0800 Michael Shiloh > writes: > > Hi Gang, > > > > Quick question: > > > > I'm using the C2C compiler with a 16C63. I'm writing some code > > around an interrupt driven serial port using the on-board USART. > > I use a circular buffer to queue characters for transmission. > > > > I have a function to remove a character from the buffer, and I > > call this from both an ISR and main code, and I get a warning > > for doing so: > > > > Warning: Function '_SerTxBufferRemove' used both in interrupt and > > main code > > > > > > Is it not permitted to call a function from both interrupt code > > and main code? > > > > Thanks, > > Michael > > > > -- > > http://www.piclist.com hint: The list server can filter out > > subtopics > > (like ads or off topics) for you. See http://www.piclist.com/#topics > > > > > > > > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.