startup.c

来自「一个免费的SMART CARD OS系统。」· C语言 代码 · 共 81 行

C
81
字号
/* ============================================================================   Project Name : jayaCard   Module Name  : proto/cos/sdcc/startup.c   Version : $Id: startup.c,v 1.3 2004/01/11 09:56:32 dgil Exp $	Description: main SDCC startup    The Original Code is jayaCard code.    The Initial Developer of the Original Code is Gilles Dumortier.	Portions created by the Initial Developer are Copyright (C) 2002-2004 the    Initial Developer. All Rights Reserved.    Contributor(s):    This program is free software; you can redistribute it and/or modify    it under the terms of the GNU General Public License as published by    the Free Software Foundation; either version 2 of the License, or    (at your option) any later version.    This program is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    GNU General Public License for more details.    You should have received a copy of the GNU General Public License    along with this program; see http://www.gnu.org/licenses/gpl.html   History Rev	Description   062403 dgil	wrote it from scratch   ============================================================================*/#include "precomp.h"/* ============================================================================	main() for the SDCC 8051 port   ========================================================================= */int main(void){	if_type = IF_TYPE_CONTACT;	while (1) {		if (if_type==IF_TYPE_CONTACT) {			/* 0x3B is sent here because in target card the interface auto-detection code			   will also send this byte to sense the contact			*/			HAL_T0_SEND(0x3B);		}		/* quick cos initialisation */		cos_init();		/* cos main */		if (if_type==IF_TYPE_CONTACT) {			/* long cos initialization */			cos_init2();			/* finish sending the ATR */			BIOS_ATR();			/* enter the COS command loop */			cos_main();		} else {			/* cos_init2(); -> will be called after receiving the RATS and before answering it */			/* cos_main(); -> will be called each time an IBLOCK is received */			if (tcl_type==TCL_TYPEA) {				/* low-level anticollision and selection */				HAL_TCL_ANTICOL_AND_SELECTA(gInBuffer.b);			} else {				BIOS_TCL_ANTICOL_AND_SELECTB();			}		}	}	return 0;}/* =========================================================================	That's all folks !   ========================================================================= */

⌨️ 快捷键说明

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