From 8a07e78a06f0c0d25307b72af36bc5d09098956d Mon Sep 17 00:00:00 2001 From: Rob Purchase Date: Sun, 11 Jul 2010 22:21:33 +0000 Subject: D2: Fix another timing loop that broke when we switched to the EABI compiler, this time in the LCD driver. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27395 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c b/firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c index 3f1e2e0312..ab50769983 100644 --- a/firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c +++ b/firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c @@ -77,9 +77,12 @@ void lcd_set_contrast(int val) /* Delay loop based on CPU frequency (FREQ>>23 is 3..22 for 32MHz..192MHz) */ static void delay_loop(void) { - unsigned long x; - for (x = (unsigned)(FREQ>>23); x; x--); + asm volatile (" mov %[freq], %[freq], asr#23 \n\t" + "1: subs %[freq], %[freq], #1 \n\t" + " bne 1b" + : : [freq] "r" (cpu_frequency) : "memory"); } + #define DELAY delay_loop() static void ltv250qv_write(unsigned int command) -- cgit v1.2.3