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

📄 ecrsys.h

📁 一款收款机C源代码!因为是几年前的代码了
💻 H
📖 第 1 页 / 共 5 页
字号:
/*
 * Module: ECRSYS.H
 * Modified by: X.C.Zheng WeiHua
 * Modified on: Date:  03-8-11 14:02
 * Copyright(c) WeiHua Tech Ltd.
 */
#ifndef ECRSYS_H
#define ECRSYS_H
#include "ver.h"
#include "tft.h"
#include "sfr80144.h"
#include "mathes.h"
#include <string.h>


//////////////////////////////////////////////////////////
////////////// Version Control    start.//////////////////
//////////////////////////////////////////////////////////

#define		DEBUG										// 调试用.
//#define	HIGH_LOW_TEMPERATURE_TEST			// 高低温测试,上电即进入测试状态.
//#define	POWER_SUPPLY_TEST						// 电源负载能力调试.
#define		GREECE_SAMPLE							/* 希腊样机,电源和电池有缺陷.
																每次上电时自动全清,不检测电池.
																并选择打印点少的LOGO.
																-- 已查明电池问题因掉电处理不佳,导致漏电大.
															*/
#define		DEBUG_LCM(statement)				statement
#define		DEBUG_SERIAL(statement)			statement
#define		DEBUG_LOGO(statement)			statement
#define		DEBUG_DEL(statement)
#define		DEBUG_DESC(statement)			statement

#define		DEBUG_PRN(statement)				statement
#define		DEBUG_BUZZER(statement)			statement
#define		DEBUG_HW(statement)				statement
#define		DEBUG_TMP(statement)				statement
#define		DEBUG_SET(statement)				statement
#define		DEBUG_SC(statement)

//#define		STACK_CHK

#define	    G_FOSC			14
#define		FOSC_20				20.00
#define 	FOSC     			FOSC_20

/*********************** HW VERSION (AUTO) ****************/
#define	HW_V2					20				/* V2 */
#define	HW_V3					30				/* V3 29F080 */
#define	HW_V3_020			31				/* V3 27C020 */
//#define	HW_VER				HW_V3
#define	HW_VER				HW_V3_020

/*********************** SW VERSION (AUTO) ****************/
#define	DEBUG_TEST							/* 调试语句, 生成正式版本的时候, 这里还需要进行删除 */

#define	SW_NE2				0				/* NE2, the fiscal version, used in Greek, Turkey, Hungary */
#define	SW_WD2				1				/* WD2, also the normal electronic cash register, used in England(BBM, Gold) */
//#define	SW_VER				SW_NE2		/* The current software version */
#define	SW_VER				SW_WD2		/* The current software version */

#define	CHINA					0				/* China */
#define	THAILAND				1				/* Thailand */
#define	GREECE				2				/* Greece */
#define	KOREA					3				/* Korea */
#define	ENGLAND				4				/* England */
#define	HUNGARY				5				/* Hungary */
#define	AMERICA				6				/* America */
#define	CANADA				7				/* Canada */
#define	VIETNAM				8				/* Vietnam */
#define	AUSTRALIA			9				/* Australia */
#define	TURKEY				10				/* Turkey */
#define	SWEDEN				11				/* Sweden */
#define HONGKONG            12
//#define	COUNTRY				AMERICA	/* 美国的样机演示版本 */
#define	COUNTRY             HONGKONG

#define	SWEDEN_FONT			1				/* 瑞典特殊字库的宏定义, 这一处只是一个假的宏定义, 真正的宏定义需要在font.a30中继续说明 */

#if	COUNTRY == CHINA
//	#define	CN_USA			0				/* USA 唐人街. 	*/
//	#define	CN_HK_D			1				/* 香港 快餐店 测试版. */
//	#define	CN_GZ				2				/* 广州叶生特别版(修改了键盘初始定义) */
//	#define	CN_HK				3				/* 香港 谢生 */
//	#define	CN_ST				4				/* 四通 */
//	#define	VEREX				CN_HK
//	#if	VEREX ==	CN_USA
//		#define	DFT_DATE_FMT		0		/* USA Chinese Version */
//	#elif (VEREX == CN_HK) || (VEREX == CN_HK_D)
//		#define	DFT_DATE_FMT		1		/* HongKong */
//	#else
//		#define	DFT_DATE_FMT		2		/* China MainLand */
//	#endif
#elif COUNTRY == THAILAND
	#define	TH_				10
	#define	VEREX				TH_
	#define	DFT_DATE_FMT	1
#elif COUNTRY == GREECE
	#define	GR_				20
	#define	VEREX				GR_
	#define	DFT_DATE_FMT	1
#elif COUNTRY == KOREA
	#define	KR_				30
	#define	VEREX				KR_
	#define	DFT_DATE_FMT	2
#elif COUNTRY == ENGLAND
	#define	UK_				40
	#define	VEREX				UK_
	#define	DFT_DATE_FMT	1
#elif COUNTRY == HUNGARY
	#define	HU_				50
	#define	VEREX				HU_
	#define	DFT_DATE_FMT	1
#elif COUNTRY == AMERICA
	#define	US_				60
	#define	VEREX				US_
	#define	DFT_DATE_FMT	0
#elif COUNTRY == CANADA
	#define	CA_				70
	#define	VEREX				CA_
	#define	DFT_DATE_FMT	0
#elif COUNTRY == VIETNAM
	#define	VN_				80
	#define	VEREX				VN_
	#define	DFT_DATE_FMT	1
#elif COUNTRY == AUSTRALIA
	#define	AU_				90
	#define	VEREX				AU_
	#define	DFT_DATE_FMT	0				/* Use the same date format with the America */
#elif COUNTRY == TURKEY
	#define	TR_				100
	#define	VEREX				TR_
	#define	DFT_DATE_FMT	1
#elif COUNTRY == SWEDEN
	#define	SE_				110
	#define	VEREX				SE_
	#define	DFT_DATE_FMT	1
#else
	#define	DFT_DATE_FMT	1
#endif

/* 注: 在最新的WD1+程序中, 打算把后来新加的功能在所有的版本上面都有, 所以新加的和更改的功能
		 都没有进行版本控制, 所以以后当考虑到版本控制的时候要小心一下. */
//#define	WD1VER								/* The version of WD1 */
#define	FCE_FUNC								/* Support the FCE function */
#define	RCPT_REPRN							/* Support the receipt reprint function */
#define	PLU_PTD_RPT							/* Support the PLU PTD report */
//#define	PLU_GROUP_FUNC                      /*PLU group function*/
//#define	REST_PLU_FUNC						/* Restaurant mode PLU additional fucntion */
#ifndef	WD1VER								/* Not the version of WD1 */
	#define	VER_RSNT							/* Support the restaurant function */
	#define	SCANNER							/* Support the scanner function */
	#define	STOCK								/* Support the stock function */
	#define	PC_COMM							/* Support the PC communication function */
//	#define	AUTO_PER							/* Support the department auto percent function */
	#if	SW_VER == SW_WD2
	#ifndef	DEBUG_TEST
//	#define	ELEC_JRNL						/* Support the electronic journal function */
	#endif
	#endif
#endif /* End WD1VER */
//#define	HW_PRN
//#define	ELEC_JRNL						/* Support the electronic journal function */
#define TE_01P		//for te_01p version
#define ROYAL

//////////////////////////////////////////////////////////
////////////// Version Control    end.////////////////////
//////////////////////////////////////////////////////////


#ifndef	WD1VER			/* The Wd1-E version */
//	#define	ALLOC_START_ADDR	(DATA_FE_TOP+76800)		/* 75*1024(75K), The srart address of the allocation data
//																			reserve 75K for the other variable */
	#define	ALLOC_START_ADDR	(DATA_FE_TOP+0x30000)		/* 128*1024(128K), The srart address of the allocation data
																			reserve 128K for the other variable */
	#define	ALLOC_END_ADDR		(DATA_FE_TOP+0x100000-512)/* 512*1024-1(512K), The end address of the allocation data */
	// The last 512 bytes has used for the isp function.
/* Note:	The memory allocation is only used in the WD1-E version. And allocate it in the last 437K, 
			the first 75K is used for the system flag and other variable. */
#endif /* End WD1VER */

/*********************** Keyboard VERSION ****************/
#define	KB_38					1				// WD1外壳用键盘. (38键)
#define	KB_59					2				// 韩国WD2另一个版本,仅59键键盘
#define	KB_59N24				3				// WD2(E6外壳)用键盘. (59+24键)
#define KB_TS                   4

#define	KB						KB_TS

/************************************************************************
                Const limit define
************************************************************************/
#define  MAXINT            65536       /* Maximum int(unsigned) value */
#define	MAX_PER_VALUE		99999			/* Maximum percentage value:xx.xxx%. */
#if	SW_VER == SW_NE2
	#define	MAX_VAT_TAX_VALUE 99				/* Maximum VAT/Tax value:xx.xxx%. */
#else
	#define	MAX_VAT_TAX_VALUE 99999			/* Maximum VAT/Tax value:xx.xxx%. */
#endif
#define  MAXRFTCNT			99999			/* Maximum REFUND total count, not contain the decimal dots */
#define  MAXTCNT           99999       /* Maximum total count, not contain the decimal dots */
#define  MINTCNT          -99999			/* Min total count, not contain the decimal dots */
#define	MAX_RFND_PRICE		9999999		/* Maximum refund price */
#define	MAX_PCASH_PRICE	999999		/* Maximum PCASH price */
#define	MAX_PLU_PRICE		999999		/* Maximum PLU price */
#define	MAX_RA_NUM			9999999		/* Maximum RA price */
#define	MAX_PO_NUM			9999999		/* Maximum PO price */
#ifdef VER_RSNT 		/* Support the restautant function */
#define	MAX_TIPIN_NUM		9999999		/* Waiters max tip in number */
#define	MAX_TIPOUT_NUM		9999999		/* Waiters max tip out number */
#endif /* End VER_RSNT */
//#define	MAXQUNTY				9999999		/* Maximum quantity is 9999.999, contain 3 dots */
#define	MAXQUNTY				999999		/* Maximum quantity is 9999.999, contain 3 dots */
#define	MAX_DEPT_PRICE		9999999		/* Maximum department price */
#define  MAXCASH           99999999    /* Maximum of cash tender(8) */
#define	MAXCASHTTL			99999999		/* The maximum cash total in drawer */
#ifdef STOCK		/* Support the stock function */
#define	MAX_STOCK_CNT		99999999		/* Maximum of the stock price */
#endif /* End STOCK */
#define	MAX_HALO_PRICE		99999999		/* Maximum number of high amount lock out */
#define  MAXAMT            999999999   /* Maximum amount(9) */
#define  MINAMT           -999999999   /* Min amount (9) **/
#define  THREEMAX          16000000    /* Maximum of three bytes integer */
#define  MAXLONG           2147483647  /* Maximum long(signed) value */
#define	MIN_SIGNED_LONG	0x80000000	/* The signe long minimum data */
#define	MAX_RCPT_NUM		999999		/* The max receipt number */
#define MAX_HDLO_NUM        8

#define  SECT_NULL         0x00        /* Occupy a position, no especial mean */
#define  SECT_PO           0xAE        /* The PO sect */
#define  SECT_RA           0xB6        /* The RA sect */
#define  SECT_TAIL         0xFF        /* The tail of the sect array */



#define  TRUE              1
#define  FALSE                0
#define  ON                TRUE
#define  OFF                  FALSE
#define  YES               TRUE
#define  NO                   FALSE
#define  SET               TRUE
#define  CLR                  FALSE
#define  NOTCLEARD         TRUE
#define  CLEARD               FALSE
#define  PRINTD            TRUE        /* Has print the item */
#define  NOTPRINTD            FALSE    /* Did't print the item */
#define  PTD               1           /* Period to date mode */
#define  DAILY                0        /* Daily mode */
#define  DEPT_GROUP        1           /* The department group mode */
#define  PLU_GROUP            0        /* The PLU group mode */
#define	MULT					1				/* The Sale mode multiplicative operation mode */
#define	SNGL						0			/* The sale mode normal operaion mode */
#define	PUSH					TRUE
#define	POP						FALSE
#define	HEAD					1				/* Print the logo in the receipt head */
#define	TAIL						0			/* Print the logo in the receipt tail */
#define	DESC_NEW				1				/* The new print buffer */
#define	DESC_OLD					0			/* The old print buffer */
#define	WGT					1				/* Price */
#define	PRIC						0			/* Weight */

#define  LCD_BL_OFF        1
#define  LCD_BL_ON            0
#define  LEFT              1
#define  RIGHT                0
#ifdef VER_RSNT			/* Support the restaurant mode */
#define	RETAIL				0x55			/* Work in the retail mode */
#define	RSNT						0xAA		/* work in the restaurant mode */
#endif /* End VER_RSNT */


#ifdef	REST_PLU_FUNC
#define  PLU_NORMAL        0
#define  PLU_DESC             2
#define  PLU_GIFT                1
#endif

#define	PLU					0				/* The PLU transaction */
#define	DEPT					1				/* The DEPT transaction */
#define	CLERK					2				/* The clerk operation */
#define	TABLE					3				/* The table printing */

#define  OK                0           /* Normal  return */
#define  NG                1           /* No good return */
#define  NOTOK             0xFF        /* No good return */
#define	FAIL_BYTE			0xff			/* The abnormal return, for the input is illegal */

⌨️ 快捷键说明

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