Changed clock_delay to use the nop instruction

This commit is contained in:
Niclas Finne 2011-09-23 13:22:18 +02:00
parent b6fd166155
commit 09082f02fe

View file

@ -272,17 +272,9 @@ clock_init(void)
void void
clock_delay(unsigned int i) clock_delay(unsigned int i)
{ {
asm("add #-1, r15"); while(i--) {
asm("jnz $-2"); asm("nop");
/* }
* This means that delay(i) will delay the CPU for CONST + 3x
* cycles. On a 2.4756 CPU, this means that each i adds 1.22us of
* delay.
*
* do {
* --i;
* } while(i > 0);
*/
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /**