cc2x3x clock_delay(len) now delays for approx. len usecs

This commit is contained in:
George Oikonomou 2012-04-03 14:52:54 +01:00
parent 3cb26adeda
commit 57969259ce
2 changed files with 10 additions and 9 deletions

View file

@ -56,17 +56,17 @@ static volatile __data clock_time_t count = 0; /* Uptime in ticks */
static volatile __data clock_time_t seconds = 0; /* Uptime in secs */
/*---------------------------------------------------------------------------*/
/**
* One delay is about 0.6 us, so this function delays for len * 0.6 us
* Each iteration is ~1.0xy usec, so this function delays for roughly len usec
*/
void
clock_delay(unsigned int len)
{
unsigned int i;
for(i = 0; i< len; i++) {
__asm
nop
__endasm;
DISABLE_INTERRUPTS();
while(len--) {
ASM(nop); ASM(nop); ASM(nop);
ASM(nop); ASM(nop);
}
ENABLE_INTERRUPTS();
}
/*---------------------------------------------------------------------------*/
/**

View file

@ -59,15 +59,16 @@ static volatile __data clock_time_t count = 0; /* Uptime in ticks */
static volatile __data clock_time_t seconds = 0; /* Uptime in secs */
/*---------------------------------------------------------------------------*/
/**
* One delay is about 0.6 us, so this function delays for len * 0.6 us
* Each iteration is ~1.0xy usec, so this function delays for roughly len usec
*/
void
clock_delay(unsigned int len)
{
unsigned int i;
for(i = 0; i< len; i++) {
DISABLE_INTERRUPTS();
while(len--) {
ASM(nop);
}
ENABLE_INTERRUPTS();
}
/*---------------------------------------------------------------------------*/
/**