diff options
author | Rob Purchase <shotofadds@rockbox.org> | 2010-07-11 22:21:33 +0000 |
---|---|---|
committer | Rob Purchase <shotofadds@rockbox.org> | 2010-07-11 22:21:33 +0000 |
commit | 8a07e78a06f0c0d25307b72af36bc5d09098956d (patch) | |
tree | 453c6528442109dc357bf764a48c9e4fb0176474 /firmware/target | |
parent | c9a4fb0d0d988447f7232855abdb9c681e01469b (diff) |
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
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c | 7 |
1 files 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) |