1
0
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:
Martin Guy 2012-01-02 14:26:29 +01:00
parent 89b78f288a
commit ffe0338b89
2 changed files with 5 additions and 6 deletions

View File

@ -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

View File

@ -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 */;
}