some cleanup

This commit is contained in:
David Welch
2012-05-26 15:27:04 -04:00
parent d00dab24f8
commit 250a069163
2 changed files with 11 additions and 6 deletions

View File

@@ -13,3 +13,8 @@ appears that the timer is runing at about a megahertz, 1 million ticks
per second. I am guessing it is divided down from the 700MHz somewhere,
will dig deeper.
Hmm, there are comments in the manual about the system clock coming up
at 250MHz. I wonder if this system timer is 250MHz/256 = 0.976MHz.

View File

@@ -11,6 +11,10 @@ extern void dummy ( unsigned int );
#define GPSET0 0x2020001C
#define GPCLR0 0x20200028
//0x01000000 17 seconds
//0x00400000 4 seconds
#define TIMER_BIT 0x00400000
//-------------------------------------------------------------------------
int notmain ( void )
{
@@ -27,17 +31,13 @@ int notmain ( void )
while(1)
{
ra=GET32(SYSTIMERCLO);
//0x01000000 17 seconds
if((ra&=0x01000000)==0x01000000) break;
//0x00400000 4 seconds
if((ra&=0x00400000)==0x01000000) break;
if((ra&=TIMER_BIT)==TIMER_BIT) break;
}
PUT32(GPCLR0,1<<16);
while(1)
{
ra=GET32(SYSTIMERCLO);
//if((ra&=0x01000000)==0x00000000) break;
if((ra&=0x00400000)==0x00000000) break;
if((ra&=TIMER_BIT)==0) break;
}
}
return(0);