Analog Devices ADSP-BF537 EZ-KIT Lite Getting Started page 48

Hide thumbs Also See for ADSP-BF537 EZ-KIT Lite:
Table of Contents

Advertisement

Listing 1-3. Exercise 1, Part 3
unsigned int clock = *pRTC_STAT;
/* seconds */
unsigned int seconds = ( clock & 0x3f );
/* minutes */
seconds += 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 ] )
{
}
}
}
}
1-26
www.BDTIC.com/ADI
int temp = v[ i ];
v[ i ] = v[ j ];
v[ j ] = temp;
Getting Started with ADSP-BF537 EZ-KIT Lite

Advertisement

Table of Contents
loading

Table of Contents