From 09082f02fe3fd0ca77af40fb205db83cb1fa427e Mon Sep 17 00:00:00 2001 From: Niclas Finne Date: Fri, 23 Sep 2011 13:22:18 +0200 Subject: [PATCH] Changed clock_delay to use the nop instruction --- cpu/msp430/clock.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/cpu/msp430/clock.c b/cpu/msp430/clock.c index 06c737d2f..556fb6e82 100644 --- a/cpu/msp430/clock.c +++ b/cpu/msp430/clock.c @@ -272,17 +272,9 @@ clock_init(void) void clock_delay(unsigned int i) { - asm("add #-1, r15"); - asm("jnz $-2"); - /* - * 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); - */ + while(i--) { + asm("nop"); + } } /*---------------------------------------------------------------------------*/ /**