From 1d4dc9b3b0f094a70463395138fc920e5107eabc Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Mon, 14 Jun 2010 23:01:30 +0000 Subject: cowond2: make sure the i2c delay loop code is actually generated by the eabi compiler. This fix adds one nop instruction per loop (there were 3 before) and so i2c will be slightly slower, but this hardly a problem. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26850 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/i2c-telechips.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'firmware/target/arm/i2c-telechips.c') diff --git a/firmware/target/arm/i2c-telechips.c b/firmware/target/arm/i2c-telechips.c index 9226617b14..35f4cd41c5 100644 --- a/firmware/target/arm/i2c-telechips.c +++ b/firmware/target/arm/i2c-telechips.c @@ -28,8 +28,10 @@ static inline void delay_loop(void) { unsigned long x; - for (x = (unsigned)(FREQ>>22); x; x--); + for (x = (unsigned)(FREQ>>22); x; x--) + asm volatile("nop"); } + #define DELAY delay_loop() static struct mutex i2c_mtx; -- cgit v1.2.3