mirror of
https://github.com/elua/elua.git
synced 2025-01-08 20:56:17 +08:00
Fix commentary in previous commit
The new AVR32 delay code doesn't just handle up to 30 second delays; it handles the whole range.
This commit is contained in:
parent
89b78f288a
commit
ffe0338b89
@ -306,10 +306,9 @@ static void I2CDELAY()
|
||||
u32 delay_start_cycle = Get_system_register(AVR32_COUNT);
|
||||
|
||||
// at 60MHz the count register wraps every 71.68 secs, at 66MHz every 65s.
|
||||
// For delays <= 30 seconds, the following code in unsigned arithmetic
|
||||
// handles the wraparound condition as it should.
|
||||
// The following unsigned arithmetic handles the wraparound condition.
|
||||
while( (u32)Get_system_register(AVR32_COUNT) - delay_start_cycle < i2c_delay )
|
||||
;
|
||||
/* wait */;
|
||||
}
|
||||
|
||||
// Set SCL as input and return current level of line
|
||||
|
@ -61,9 +61,9 @@ static void sdramc_ck_delay(unsigned long ck)
|
||||
unsigned long delay_start_cycle = Get_system_register(AVR32_COUNT);
|
||||
|
||||
// at 60MHz the count register wraps every 71.68 secs, at 66MHz every 65s.
|
||||
// For delays <= 30 seconds, the following code in unsigned arithmetic
|
||||
// handles the wraparound condition as it should.
|
||||
while((unsigned long)Get_system_register(AVR32_COUNT) - delay_start_cycle < ck ) ;
|
||||
// The following unsigned arithmetic handles the wraparound condition.
|
||||
while ((unsigned long)Get_system_register(AVR32_COUNT) - delay_start_cycle < ck)
|
||||
/* wait */;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user