59 lines
1.8 KiB
C
Raw Normal View History

2012-08-14 18:00:48 -04:00
/*
* Copyright 2010 by Spectrum Digital Incorporated.
* All rights reserved. Property of Spectrum Digital Incorporated.
*/
#include "stdio.h"
#include "usbstk5515.h"
/* ------------------------------------------------------------------------ *
* *
* Testing Function *
* *
* ------------------------------------------------------------------------ */
void TEST_execute( Int16 ( *funchandle )( ), char *testname, Int16 testid )
{
Int16 status;
/* Display test ID */
printf( "%02d Testing %s...\n", testid, testname );
/* Call test function */
status = funchandle( );
/* Check for test fail */
if ( status != 0 )
{
/* Print error message */
printf( " FAIL... error code %d... quitting\n", status );
/* Software Breakpoint to Code Composer */
SW_BREAKPOINT;
}
else
{
/* Print error message */
printf( " PASS\n" );
}
}
extern Int16 norflash_writer( );
/* ------------------------------------------------------------------------ *
* *
* main( ) *
* *
* ------------------------------------------------------------------------ */
void main( void )
{
/* Initialize BSL */
USBSTK5515_init( );
printf("EXBUSSEL = %02x\n", SYS_EXBUSSEL);
TEST_execute( norflash_writer, "NOR Flash Writer", 1 );
printf( "\n***ALL Tests Passed***\n" );
SW_BREAKPOINT;
}