Listing 1-3. Exercise 1, Part 3
1-26
Getting Started with ADSP-BF537 EZ-KIT Lite
unsigned int clock = *pRTC_STAT;
/* seconds */
unsigned int seconds = ( clock & 0x3f );
/* minutes */
s= 60 * ( ( clock & 0xfc0 ) >> 6 );
return seconds;
}
/* Initialize two arrays to the same set of random values */
void randomize_arrays ( int *v1, int *v2, unsigned int length )
{
unsigned int i;
for ( i = 0; i < length; ++i )
{
v1[ i ] = v2[ i ] = rand () % 1024;
}
}
/* A standard bubble sort algorithm, O(n^2) */
void bubble_sort ( int *v, unsigned int length )
{
unsigned int i, j;
for ( i = 0; i < length - 1; ++i )
{
for ( j = i + 1; j < length; ++j )
{
if ( v[ i ] > v[ j ] )
{
int temp = v[ i ];
v[ i ] = v[ j ];
v[ j ] = temp;
}
}
}
}
www.BDTIC.com/ADI
Содержание EZ-KIT Lite ADSP-BF537
Страница 4: ...www BDTIC com ADI ...
Страница 8: ...CONTENTS viii Getting Started with ADSP BF537 EZ KIT Lite www BDTIC com ADI ...
Страница 52: ...Listing 1 3 Exercise 1 Part 3 1 30 Getting Started with ADSP BF537 EZ KIT Lite www BDTIC com ADI ...
Страница 88: ...What s Next 3 22 Getting Started with ADSP BF537 EZ KIT Lite www BDTIC com ADI ...