/****************************************************************************/
/* Copyright 2002 MBARI														*/
/****************************************************************************/
/* Summary	: Debug routines for OASIS3 Mooring Controller					*/
/* Filename : debug.c														*/
/* Author	: Robert Herlien (rah)											*/
/* Project	: OASIS Mooring Replacement (OASIS3)							*/
/* Revision: 0.1															*/
/* Created	: 10/25/2002													*/
/*																			*/
/* MBARI provides this documentation and code "as is", with no warranty,	*/
/* express or implied, of its quality or consistency. It is provided without*/
/* support and without obligation on the part of the Monterey Bay Aquarium	*/
/* Research Institute to assist in its use, correction, modification, or	*/
/* enhancement. This information should not be published or distributed to	*/
/* third parties without specific written permission from MBARI.			*/
/*																			*/
/****************************************************************************/
/* Modification History:													*/
/* 25oct2002 rah - created													*/
/****************************************************************************/

#include <mbariTypes.h>					/* MBARI type definitions			*/
#include <mbariConst.h>					/* MBARI constants					*/
#include <oasis.h>						/* OASIS controller definitions		*/
#include <debug.h>						/* OASIS debug definitions			*/

#include <istdio.h>
#include <stdarg.h>

SerDesc dbgSerDesc = 
	{SER_CONSOLE, (NO_PTY | BIT8 | STOP1 | FLOW | ECHO | AUTOCR), 0};


/************************************************************************/
/* Function	   : dprintf												*/
/* Purpose	   : Printf routine for debugging							*/
/* Input	   : Same as printf											*/
/* Output	   : Same as printf											*/
/************************************************************************/
int dprintf( const char *format, ... )
{
#ifdef DEBUG
	va_list		ap;
	int			rtn;

	va_start(ap, format);
	rtn = vprintf(format, ap);
	SCITxWaitCompletion();
	Delay1ms();
	va_end(ap);

	return(rtn);
#else
	return(0);
#endif

} /* dprintf() */

#endif
