If you need delay routines in the ISR, it may not use the same variable space as the one that you're using outside the ISR. I don't know how this compiler handles its variable space, but the message is to this effect. What you can do is for example write your own delay loop, use it only in the ISR and either look at the generated assembler and count how long it will delay or measure it with a scope, then call it with the appropriate parameter. Such a simple delay loop may look something like void custom_delay( unsigned int count ) { while( count > 0 ) --count; } You may have to declare the count parameter in a certain way to make sure the compiler doesn't optimize anything away that it shouldn't (usually that would be 'volatile', but I don't know your compiler). ge At 10:39 1/04/2002 +0000, Simon-Thijs de Feber wrote: >My earlier questions about delays is related to the >following problem. > >I am usin CC5X and need to call these delays from the >ISR ,MAIN or other routines. >I know this is not the way ISR's are used but in >practice no interrupts will occur when i am in the ISR >handling the things i need to do (they are blocked any >way). > >When i try to compile the code i get the following >error : > >/* >Error volume_ctrl.c 428: Shared function 'delay_us' >contains local variables or parameters > (A function called from two independent call paths >can not contain local > variables or parameters because address sharing can >not be computed in > advance. The main() routine, interrupt service >routines and all extern > functions are defined as independent call trees or >paths) >*/ > >I made a function prototype above the ISR. > >Any suggestions ?! -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.