Dave Tweed wrote: > To Bob Ammerman, you wrote: > > One can mark a function to be allowed to be called by two or more call > > trees (with "#pragma interrupt_level"). In this case it is the program's > > responsibility to make sure that this function never gets called from one > > call tree while it is already running in another; that is, the program > > needs to control access to it. (This is because these compilers don't > > support re-entrancy, as Bob said.) > > It's a little more subtle than that -- if the function *or any of the > other functions that share its local variable storage* are running, then > it cannot be called from an interrupt call tree. Perhaps the #pragma you > mention makes sure that it has truly private storage for its locals. I haven't been following this thread, mainly because of the tag BUT... XCSB uses a static stack and it identifies sections of the call tree that are used by the main line and also the ISR. It peels off a seperate static stack and generates safe efficient code where there is a conflict. Furthermore, XCSB supports multitasking natively and it does the same thing for functions that clash within the multitasking system. A very good argument for building multitasking into the language rather than as a bolt-on library :-) Also XCSB overlays function contexts at the assembly stage not the linker stage so it is possible to embed assembler source that can manipulate the layout and more importantly generate code conditionaly depening on variable placement. Regards Sergio Masci http://www.xcprod.com/titan/XCSB - optimising PIC compiler FREE for personal non-commercial use -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist