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

📄 _main_m04_c2.c

📁 sircs decoder, for amplifier.. this is to decode
💻 C
字号:
/****************************************************************************************************/
/* $Header  : 																					  	
/* AUTHOR 	: TC PUI																		  		
/* FILE NAME: _MAIN.C																		  		
/* PURPOSE	: MAIN LOOP CONTROL												 				 		
/* MODEL	: 2004 CIS 2-CH AMP 										  						
/* Copyright (c) 2004 Sony Corporation All Rights Reserved					  						
/****************************************************************************************************/
#define _MAIN_C

#include "_main_M04_C2.h"
/****************************************************************************************************/

#pragma asm
/************************** START-UP & STACK AREA RESERVE *******************************************/
#define STACK_SIZE	256		; stack size define
	.export	_Start
	.section	STACK,STACK
	.res.b		STACK_SIZE		; stack area reserve

stack_top:
    		.SECTION	CODE,     CODE
_Start:
/*--------------------------------------------------------------------------------------------------*/
/* system clock setup																				*/
/*--------------------------------------------------------------------------------------------------*/
		MOV		07h, #0FFh
/*--------------------------------------------------------------------------------------------------*/
/* set stack pointer																				*/
/*--------------------------------------------------------------------------------------------------*/
		MOVW	A, #stack_top
		MOVW	SP, A

/*--------------------------------------------------------------------------------------------------*/
/* set register bank is 0																			*/
/*--------------------------------------------------------------------------------------------------*/
		MOVW	A, PS
		MOVW	A, #0x07FF
		ANDW	A
		MOVW	PS, A

/*--------------------------------------------------------------------------------------------------*/
/* set ILM to the lowest level(3)																	*/
/*--------------------------------------------------------------------------------------------------*/
		MOVW	A, PS
		MOVW	A, #0x0030
		ORW	A
		MOVW	PS, A
/*--------------------------------------------------------------------------------------------------*/
/* call main routine																				*/
/*--------------------------------------------------------------------------------------------------*/
		CALL	_main
/****************************************************************************************************/
#pragma endasm

/****************************************************************************************************/
/* FUNCTION		:	main																			
/* PURPOSE		:	Main Loop Control						  										
/* INPUT		:	None																			
/* RETURN VALUE	:	None																			
/****************************************************************************************************/
void main(void)
{
	
	PotInitialize();			/* 	I/O port Initialize 			*/
	TimInitialize();			/* 	Software Timer Initialize 		*/
	BakInitialize();			/*	Backup Initialize				*/
	SirInitialize();			/*	Sircs Initialize				*/
	KeyInitialize();			/*  A/D Key Initialize				*/
	VR_Initialize();			/*	VR adjustment Initializw		*/
	TestModInitialize();		/* 	Test mode Initialize 			*/
	IniPower();					/*	Power Sequencer Initialize		*/
	IniExecute();				/*	Execute Initialize				*/
	VolInitialize();			/* 	Volume Initialize 				*/
	AuDetInitialize();			/*	Audio Detection Initialize 		*/
	SirOutInitialize();			/*	Initialize 16bit timer/counter register */
	LoadAllBackupVariable();	/* 	Load Backup Data From EEPROM	*/
	LoadNonBackupVariable();	/* 	Load Non-Backup Variable		*/
	/********************* SET INTERRUPT LEVEL **********************/
	ILR1.BYTE = 0xf3;			/* 	INT12-INT13 : L11,L10 = 00	 	*/
	ILR2.BYTE =	0xbf;   		/* 	PWC         : L70,L71 = 01	 	*/
	__EI();						/*	Enable Interrupt				*/
	/****************************************************************/
	
	do{
		TimControl();			/*	Timer Control 					*/
		KeyControl_0();			/*	A/D Key Control					*/
		MltplxKeyCheck();		/*	Check multiplex key				*/

	} while(!IsMltplxKeyEnd());
	
	for(;;) {					/*	Start Main Loop Control			*/
		if (IDSwitch.Test == ON){
			if (sircs_out_stt == _SOUT_END){
				TimControl();			/*	Timer Control					*/
				IopControlTest();		/*	LED Control						*/
				TestModControl();		/*	Test Mode Control				*/
				KeyControl();			/*	A/D Key Control					*/	
				SircsOutControl();		/*	Sircs Out Control				*/
			}
		}else{
			TimControl();			/*	Timer Control					*/
			IopControl();			/*	LED Control						*/
			BakControl();			/* 	Backup Control					*/
			KeyControl();			/*	A/D Key Control					*/	
			VR_Control();			/*	VR adjustment Control			*/
			AuDetControl();			/* 	Audio Detection control			*/
			TestModControl();		/*	Test Mode Control				*/
			PowControl();			/* 	Power Sequencer Control 		*/
			VolControl();			/* 	Volume Control 					*/
			SirControl();			/*	Sircs Control					*/
			SircsOutControl();		/*	Sircs Out Control				*/
			ExeControl();			/*	Execute Control					*/

		}
	}
}
/****************************************************************************************************/

⌨️ 快捷键说明

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