⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.c

📁 以ST公司CPU为核心的彩色电视机的完整源程序。
💻 C
字号:
/*********************** SGS-THOMSON MICROELECTRONICS ************************
FILENAME     : MAIN.C
VERSION      : V3.1
DATE         : JUNE 1999
AUTHOR(s)    : ASHISH RUDOLA
PROCESSOR    : ST92195
DESCRIPTION  : This module contains the function which is used to update
	       processes of this chassis like time, tuning, OSD Menus and
	       so on...
MODIFICATIONS:
   -
*****************************************************************************/
#include "st92196.h"
#include "macro.h"
#include "tv_glob.h"
#include "register.h"
#include "utility.h"

#include "alarm.h"
#include "autosrch.h"
#include "control.h"
#include "display.h"
#include "power.h"
#include "sleep.h"
#include "source.h"
#include "timer.h"
#include "tuning.h"
#include "audio.h"
#include "video.h"
#include "channel.h"
#include "clock.h"
#include "i2c_bus.h"
#include "service.h"
/*****************************************************************************
INPUTS     : none
OUTPUTS    : see specific functions called by this function.
DESCRIPTION: This function, which loops for ever, updates processes of this
	     chassis.
*****************************************************************************/
#ifdef _emulate_

#include "emulate.c"


#endif

void main(void)
{
	unsigned char i;   /* Temporary storage */
	 
#ifdef _emulate_	
                                      
    use_external_font();
/* for test */
/*
write_eeprom(0x00,0x11);
write_eeprom(0x01,0x22);
write_eeprom(0x02,0x33);
write_eeprom(0x03,0x44);
i=read_eeprom(0x00);
i=read_eeprom(0x01);
i=read_eeprom(0x02);
i=read_eeprom(0x00);
read_video_new();
*/
/* for test end*/

#endif

    /* Loop forever */
	while(1)
	{
		/* Keep watching the power management */
	update_power();          /* power.c */

		i = check_time(CHECK_SECOND);    /* timer.c */
		
		/* Seconds have changed, do action required once a second */
		if (i == 1)
		{
			update_slow_timers();   /* timer.c */
			update_user_mute();  /* Monitor IDENT and Mute Flag */

			update_display_vco_stat();
		
					update_ntsc_set();
					update_50_60();
/*		read_status = read_nicam(0x09);*/

		}


/*		i = check_time(CHECK_HALF_SECOND);
		if (i == 1)
		{
		}*/

		i = check_time(CHECK_MINUTE);

		/* Minutes have changed, do action required once a minute */
		if (i == 1)
		{
	    /* Update alarm events */
	    update_alarm();               /* alarm.c */

			/* Update sleep timer */
	    update_sleep_timer();         /* sleep.c */
    	if (!(tuning_flags & AUTOSEARCH_REQUEST))
		 
	    update_autoshut_timer();      /* sleep.c */


		}

		/* Process command (new and/or valid commands) */
	process_command();       /* control.c */

			/* Update video source */
		update_source();  /* source.c, Switches to AV as
											S_SW Pin is high */

			/* Update tuning state manager */
		update_tuning();  /* tuning.c */

			/* Update autosearch procedure */
		if (fast_timers[AUTOSRCH_TIMER] == 0x00)
			update_autosearch();
		update_auto_vco_adjust();

		if (!(tuning_flags & AUTOSEARCH_REQUEST))
		{
			if (fast_timers[AFC_TIMER] == 0x00)
			{
	    	monitor_AFC();     

			fast_timers[AFC_TIMER] = 300/MS_PER_INTERRUPT;
			}
		}	
			/* check for station edit control */
			check_edit_channel();

			update_display_manager();       

	} /* end FOR */
} /* end MAIN */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -