/*****************************************************************************

Copyright (c) 2006 Analog Devices, Inc. All Rights Reserved. 

This software is proprietary and confidential to Analog Devices, Inc. 
and its licensors.

*****************************************************************************

$RCSfile: VideoInEdgeDetection_BF561_main.c,v $
$Revision: 1.2 $
$Date: 2007/11/13 00:58:22 $

Project:	BlackfinSDK (Edge Detection on ITU656 Video In)
Title:		Main program
Author(s):	bmk
Revised by: 

Description:
			Main program for Edge Detection on ITU 656 Video Input for BF561

References:
			None

*****************************************************************************
Tab Setting:			4

Target Processor:		ADSP-BF561
Target Tools Revision:	ADSP VisualDSP++ v4.5
******************************************************************************

Modification History:
====================
$Log: VideoInEdgeDetection_BF561_main.c,v $
Revision 1.2  2007/11/13 00:58:22  randreol
Modified initialisation

Revision 1.1  2007/05/22 18:38:08  gstephan
Creating VDSP 5.00 release folder.  Created from the head copy of
VDSP 4.50 release folder.

Revision 1.2  2006/07/06 07:26:53  bmk
modified project to use video utility file macros

Revision 1.1  2006/06/30 01:33:04  bmk
Initial entry


*****************************************************************************/

#include <VideoInEdgeDetection_System.h>	// Video In Edge detection system includes
#include <SDK-ezkitutilities.h>				// EZ-Kit utility definitions

/*********************************************************************

    Function:       main

    Description:    Edge Detection main function

*********************************************************************/
section ("App_Code_L1")
void main (void)
{
	
    SystemFlag.KeepRunningFlag	= TRUE;	// Initialise flag to continue executing this application
    
	//InitSystem ();						// Initialise EZ kit & Video Parameters
	
	InstallSystemServices ();			// Installs system services
	
	InstallVideoDecoder ();				// Instal Video decoder (video input - ADV7183)
				
	InstallVideoEncoder ();				// Instal Video Encoder (video output - ADV717x)
	
	SubmitVideoOutBuffers();			// submit Video Out buffer(s)	

	EnableVideoIn(TRUE);				// enable video in dataflow (ADV7183)
			
	EnableVideoOut(TRUE);				// enable video out dataflow (ADV717x)
	
	// Continue executing the app until Terminate button (SW9) is pressed
	while (SystemFlag.KeepRunningFlag == TRUE)
	{
		// check sobel edge detection is enabled
		if (SystemFlag.SobelEnable)
		{
			do_SobelEdgeDetection ();	// if so, do sobel edge detection
		}
	}
		
	TerminateSystem();			// Close all devices and terminate this app	
}


/****/

