/* Check program */

#include <stdio.h>
#include <stdlib.h>
#include "ErrCode.h"
#include "ErrMsg.h"
#include "PCIreg.h"

#define FNAME	"0check_clr"
#define N_TM	0
#define	REPEAT	1

#define BUF_SIZE	16000


//------function prototype------
int MyProc(int nArg);


//=======================================
int main(int argc, char *argv[])
{
	int nErr;
	int nArg = N_TM;

	//-----<argument>-----
	if ( argc==2 )	nArg = atoi(argv[1]);
	
	//-----<operation>-----
	nErr = MyProc(nArg);
	
	//-----<operation result>-----
//	puts(FNAME);
//	printf( pszErrString[nErr] );
	
	return nErr;
}

//=======================================
int MyProc(int nArg)
{
	int nErr=0;

	if( nArg )
	{
		if ( CPCIreg::Dump() ) nErr=1;
		puts("");
	}

	
	if ( CPCIreg::ClearFiFo() ) nErr=2;


	if( nArg )
	{
		if ( CPCIreg::Dump() ) nErr=1;
		puts("");
	}

	return nErr;
}

