This is a quite straight forward problem. If you are executing the delay called from the main() call-tree when you receive an interrupt, and then again call the delay from the ISR, the original local variables in the delay will be corrupted and the delay will be wrong when you exit the ISR. This is a problem since CC5X does not generate a software stack. A delay routine shouldn't be too big, so a quick and dirty way of doing it can be to implement one delay routine for each call-tree. Dag S STdF> Hello All, STdF> My earlier questions about delays is related to the STdF> following problem. STdF> I am usin CC5X and need to call these delays from the STdF> ISR ,MAIN or other routines. STdF> I know this is not the way ISR's are used but in STdF> practice no interrupts will occur when i am in the ISR STdF> handling the things i need to do (they are blocked any STdF> way). STdF> When i try to compile the code i get the following STdF> error : STdF> /* STdF> Error volume_ctrl.c 428: Shared function 'delay_us' STdF> contains local variables or parameters STdF> (A function called from two independent call paths STdF> can not contain local STdF> variables or parameters because address sharing can STdF> not be computed in STdF> advance. The main() routine, interrupt service STdF> routines and all extern STdF> functions are defined as independent call trees or STdF> paths) STdF> */ STdF> I made a function prototype above the ISR. STdF> Any suggestions ?! STdF> grtz STdF> Simon STdF> __________________________________________________ STdF> Do You Yahoo!? STdF> Everything you'll ever need on one web page STdF> from News and Sport to Email and Music Charts STdF> http://uk.my.yahoo.com STdF> -- STdF> http://www.piclist.com hint: The PICList is archived three different STdF> ways. See http://www.piclist.com/#archives for details. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.