/*********************************************************************** 
* NOTICE
* All files contained on this disk are subject to the licensing conditions
* issued by MOTOROLA Inc.
*
* All files are copyright 1993 by MOTOROLA Inc. 
************************************************************************/

/********************************************************
 * File:	tick.c
 *
 * Description:
 *	This file contains the sole routine tick.
 *	The routine should be called by the user code
 *	each time a real-time clock time is recognized.
 *
 * Routines:
 *	tick
 *
 * Author:
 *	Jonathan Masel
 ********************************************************/

#include "gct.h"
#include "msg.h"
#include "modules.h"
#include "types.h"
#include "mtypes.h"
#include "bss.h"

tick()
{
	register GCT *gct;
	register GWA *gwa;
	register int i;

	/*
	 * update system time in GCT
	 */
	GETGCT(gct);
	gct->time++;
	gwa = (GWA *)gct->driver->work_area;

	/*
	 * send messages where required
	 */
	i = (*gct->send)(DRIVER, &gwa->timer_tick);
	if( i )
		return(i);

	if( gct->flags & QUICC_POLLING )
		i = (*gct->send)(DRIVER, &gwa->timer_poll);

	return(i);
}
