mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-21 11:02:45 -05:00
Fix the delay loops. Without scaling the CPU is always at 300MHz.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12229 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
6dd8fbe25d
commit
e645e2dcf2
2 changed files with 4 additions and 4 deletions
|
|
@ -90,7 +90,7 @@ static void i2c_delay(void)
|
|||
/* about 30 cycles overhead + X * 7 */
|
||||
/* 300MHz: 1000nS @3.36nS/cyc = 297cyc: X = 38*/
|
||||
/* 100MHz: 1000nS @10nS/cyc = 100cyc : X = 10 */
|
||||
for (_x = get_cpu_boost_counter() ? 38 : 10; _x; _x--)
|
||||
for (_x = 38; _x; _x--)
|
||||
{
|
||||
/* burn CPU cycles */
|
||||
/* gcc makes it an inc loop - check with objdump for asm timing */
|
||||
|
|
|
|||
|
|
@ -30,9 +30,9 @@
|
|||
/* cycles delayed = 30 + 7 * loops */
|
||||
/* 100MHz = 10nS per cycle: LO:1300nS=130:14 HI:600nS=60:9 */
|
||||
/* 300MHz = 3.36nS per cycle: LO:1300nS=387:51 HI:600nS=179:21 */
|
||||
#define DELAY_LO do{int x;for(x=get_cpu_boost_counter()?51:14;x;x--);} while (0)
|
||||
#define DELAY do{int x;for(x=get_cpu_boost_counter()?35:10;x;x--);} while (0)
|
||||
#define DELAY_HI do{int x;for(x=get_cpu_boost_counter()?21: 9;x;x--);} while (0)
|
||||
#define DELAY_LO do{int x;for(x=51;x;x--);} while (0)
|
||||
#define DELAY do{int x;for(x=35;x;x--);} while (0)
|
||||
#define DELAY_HI do{int x;for(x=21;x;x--);} while (0)
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue