hi mark,

we've been using this for years:

/* Following the suggestion of the mspgcc.sourceforge.net site for an intelligent pause routine
*/
void brief_pause(register unsigned int n)
{
  asm volatile( "1: \n\t"
                "dec    %0 \n\t"
                "jne    1b\n\t"
                :  "+r" (n));
}

#define TOSH_uwait(n) brief_pause((((unsigned long long)n) * TARGET_DCO_KHZ *\
 1024 / 1000000 - 2) / 3)

i have even found it more accurate than the current tinyos busywaitmicro routine. this routine does have excellent heritage, though (see comment).

i hope that this helps,

steve

Mark Rages wrote:
Before I implement my own routine, is there a standard busyloop delay
routine for mspgcc?

Regards,
Mark
markra...@gmail

Reply via email to