;--------------------------------------------------------
; File Created by ChiponCC : aolisn inc.
; Version 3.0.4#6752 (Jul  6 2017 15:09:47) (MSVC)
; This file was generated Tue Apr 03 20:27:15 2018
;--------------------------------------------------------
; chipon port for the 16-bit core
;--------------------------------------------------------
;	.file	"../kf8spsw_lib_touch_lib.c"
	.radix dec
	.include "KF8S1025.inc"
;--------------------------------------------------------
; external declarations
;--------------------------------------------------------
	.extern	_init_mcu
	.extern	__R2PCL
	.extern	_TOUCH_DEBUG_TRS_DEAL
	.extern	_TOUCH_DEBUG_TRS_BAIHUALV
	.extern	_TOUCH_DEBUG_SEND_OUT
	.extern	_delay_ms
	.extern	_delay_us
	.extern	__mulint
	.extern	__divuint
	.extern	_PSW_bits
	.extern	_P0_bits
	.extern	_P2_bits
	.extern	_P1_bits
	.extern	_P3_bits
	.extern	_INTCTL_bits
	.extern	_EIF1_bits
	.extern	_T1CTL_bits
	.extern	_T2CTL_bits
	.extern	_PWMCTL_bits
	.extern	_CMCTL1_bits
	.extern	_ADCCTL0_bits
	.extern	_OPTR_bits
	.extern	_TR0_bits
	.extern	_TR2_bits
	.extern	_TR1_bits
	.extern	_TR3_bits
	.extern	_EIE1_bits
	.extern	_PCTL_bits
	.extern	_OSCCTL_bits
	.extern	_ANSEL_bits
	.extern	_PUR_bits
	.extern	_IOCL_bits
	.extern	_BADDRH_bits
	.extern	_ADCCTL1_bits
	.extern	_T3L_bits
	.extern	_CTCTL_bits
	.extern	_OSCLDOCAL_bits
	.extern	_sentbuf1
	.extern	_sentbuf2
	.extern	_sentbuf3
	.extern	_sentbuf4
	.extern	__KF8_Disturb_Protect_Circle_
	.extern	__KF8_Up_BaseLine_Circle_
	.extern	__KF8_LIBi_channel_flag_
	.extern	__KF8_LIBi_Date_Change_
	.extern	__KF8_LIBc_channel_
	.extern	__KF8_LIBi_buff_hit_
	.extern	__KF8_LIBi_buff_baseline_
	.extern	__KF8_LIBi_buff_refline_
	.extern	__KF8_LIBc_touch_count_
	.extern	_CHS_AMOUNT
	.extern	_TCS_AMOUNT
	.extern	__KF8_Inside_Reference_Channel_Disturb_Threshold_Set_
	.extern	__KF8_Disturb_Protect_Circle_Define
	.extern	__KF8_Up_BaseLine_Circle_Define
	.extern	__KF8_Inside_Reference_Channel_Order
	.extern	__KF8_Config_Finger_Threshold
	.extern	_CONFIG_NO_FINGER_THRESHOLD
	.extern	__KF8_TOUCH_CH_EN
	.extern	_T0
	.extern	_PCL
	.extern	_PSW
	.extern	_P0
	.extern	_P2
	.extern	_P1
	.extern	_P3
	.extern	_PCH
	.extern	_INTCTL
	.extern	_EIF1
	.extern	_T1L
	.extern	_T1H
	.extern	_T1CTL
	.extern	_T2
	.extern	_T2CTL
	.extern	_PWM1L
	.extern	_PWM1H
	.extern	_PWMCTL
	.extern	_PP1
	.extern	_CMCTL1
	.extern	_VRECAL
	.extern	_ADCDATAH
	.extern	_ADCCTL0
	.extern	_OPTR
	.extern	_TR0
	.extern	_TR2
	.extern	_TR1
	.extern	_TR3
	.extern	_EIE1
	.extern	_PCTL
	.extern	_OSCCTL
	.extern	_OSCCAL0
	.extern	_ANSEL
	.extern	_PP2
	.extern	_PWM2L
	.extern	_PWM2H
	.extern	_PUR
	.extern	_IOCL
	.extern	_OSCCAL1
	.extern	_BADDRH
	.extern	_BADDRL
	.extern	_EECTL1
	.extern	_EECTL2
	.extern	_ADCDATAL
	.extern	_ADCCTL1
	.extern	_T3L
	.extern	_CTCTL
	.extern	_T2CCR
	.extern	_OSCLDOCAL
	.extern	_T1U

	.extern STK12
	.extern STK11
	.extern STK10
	.extern STK09
	.extern STK08
	.extern STK07
	.extern STK06
	.extern STK05
	.extern STK04
	.extern STK03
	.extern STK02
	.extern STK01
	.extern STK00
;--------------------------------------------------------
; global declarations
;--------------------------------------------------------
	.global	__KF8spsw_LIBf_touch_process_
	.global	__KF8spsw_LIBf_init_touch_
	.global	__KF8spsw_Lib_SET_MCU_Parameter
	.global	_write_eep_tsw_
	.global	_read_data_eep_tsw_
	.global	__KF8spsw_Lib_BaseLine_Reget_
	.global	__KF8spsw_Lib_DateChange_get_
	.global	__KF8spsw_LIBf_scan_channel_
	.global	__KF8spsw_Get_Ver_WaterLevel_
	.global	__KF8_lib_bahualvtemportemp_SW_
	.global	_ii_buf_SW_
	.global	_Date_Save_Buf_SW_
	.global	__KF8_lib_Date_Uchar_Temp_SW_
	.global	__KF8_LIBi_Touch_New_Date_SW_
	.global	_change_buf_SW_
	.global	__KF8_Temp_Cur_A_SW_
	.global	__KF8_Temp_Cur_B_SW_
	.global	_eeprom_data_SW_
	.global	_Arr_erom_SW_
	.global	_Arr_erom_SW_Check
	.global	_oscctlbuf_SW_
	.global	_intctlbuf_SW_
	.global	__KF8_LIBt_buff_bit_SW_

;--------------------------------------------------------
; global definitions
;--------------------------------------------------------
UD_kf8spsw_lib_touch_lib_0	.udata
__KF8_Touch_Bits_	.res	1

UD_kf8spsw_lib_touch_lib_1	.udata
__KF8_lib_bahualvtemportemp_SW_	.res	2

UD_kf8spsw_lib_touch_lib_2	.udata
_ii_buf_SW_	.res	1

UD_kf8spsw_lib_touch_lib_3	.udata
_Date_Save_Buf_SW_	.res	1

UD_kf8spsw_lib_touch_lib_4	.udata
__KF8_lib_Date_Uchar_Temp_SW_	.res	1

UD_kf8spsw_lib_touch_lib_5	.udata
__KF8_LIBi_Touch_New_Date_SW_	.res	2

UD_kf8spsw_lib_touch_lib_6	.udata
_change_buf_SW_	.res	2

UD_kf8spsw_lib_touch_lib_7	.udata
__KF8_Temp_Cur_A_SW_	.res	2

UD_kf8spsw_lib_touch_lib_8	.udata
__KF8_Temp_Cur_B_SW_	.res	2

UD_kf8spsw_lib_touch_lib_9	.udata
_eeprom_data_SW_	.res	2

UD_kf8spsw_lib_touch_lib_10	.udata
_Arr_erom_SW_	.res	24

UD_kf8spsw_lib_touch_lib_11	.udata
_Arr_erom_SW_Check	.res	24

UD_kf8spsw_lib_touch_lib_12	.udata
_oscctlbuf_SW_	.res	1

UD_kf8spsw_lib_touch_lib_13	.udata
_intctlbuf_SW_	.res	1

;--------------------------------------------------------
; absolute symbol definitions
;--------------------------------------------------------
;--------------------------------------------------------
; compiler-defined variables
;--------------------------------------------------------
UDL_kf8spsw_lib_touch_lib_0	.udata
r0x1019	.res	1
UDL_kf8spsw_lib_touch_lib_1	.udata
r0x101A	.res	1
UDL_kf8spsw_lib_touch_lib_2	.udata
r0x101C	.res	1
UDL_kf8spsw_lib_touch_lib_3	.udata
r0x101B	.res	1
;--------------------------------------------------------
; initialized data
;--------------------------------------------------------

ID_kf8spsw_lib_touch_lib_0	.code
__KF8_LIBt_buff_bit_SW_
	RRET R0, #0x01
	RRET R0, #0x00
	RRET R0, #0x02
	RRET R0, #0x00
	RRET R0, #0x04
	RRET R0, #0x00
	RRET R0, #0x08
	RRET R0, #0x00
	RRET R0, #0x10
	RRET R0, #0x00
	RRET R0, #0x20
	RRET R0, #0x00
	RRET R0, #0x40
	RRET R0, #0x00
	RRET R0, #0x80
	RRET R0, #0x00
	RRET R0, #0x00
	RRET R0, #0x01
	RRET R0, #0x00
	RRET R0, #0x02
	RRET R0, #0x00
	RRET R0, #0x04
	RRET R0, #0x00
	RRET R0, #0x08
	RRET R0, #0x00
	RRET R0, #0x10
	RRET R0, #0x00
	RRET R0, #0x20
	RRET R0, #0x00
	RRET R0, #0x40
	RRET R0, #0x00
	RRET R0, #0x80

;--------------------------------------------------------
; overlayable items in internal ram 
;--------------------------------------------------------
;	.udata_ovr


func.__KF8spsw_Get_Ver_WaterLevel_	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  __KF8spsw_Get_Ver_WaterLevel_	;Function start
; 2 exit points
;has an exit
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
__KF8spsw_Get_Ver_WaterLevel_	;Function start
; 2 exit points
;	op : RETURN
;	.line	2506; "../kf8spsw_lib_touch_lib.c"	return Ver_SP_T_W;
	MOV	R0,# 0xf2
;	op : LABEL
;	op : ENDFUNCTION
	CRET	
; exit point of __KF8spsw_Get_Ver_WaterLevel_



func.__KF8spsw_LIBf_touch_process_	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  __KF8spsw_LIBf_touch_process_	;Function start
; 2 exit points
;has an exit
;functions called:
;   _read_data_eep_tsw_
;   _write_eep_tsw_
;   __KF8spsw_Lib_DateChange_get_
;   __KF8spsw_Lib_BaseLine_Reget_
;   __KF8spsw_LIBf_scan_channel_
;   _read_data_eep_tsw_
;   _write_eep_tsw_
;   __KF8spsw_Lib_DateChange_get_
;   __KF8spsw_Lib_BaseLine_Reget_
;   __KF8spsw_LIBf_scan_channel_
;1 compiler assigned register :
;   r0x101B
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
__KF8spsw_LIBf_touch_process_	;Function start
; 2 exit points
;	op : INLINEASM
	BANKSEL _CTCTL
	JB _CTCTL,4
	JMP USE_T1_DATE_IN
USE_T13_DATE_IN:
	BANKSEL T1U
	MOV R1,T1U
	BANKSEL __KF8_Touch_Bits_
	JNB __KF8_Touch_Bits_,5 ;
	JMP USE_16bit_END
	CLR PSW,0
	RRC R1
USE_16bit_END:
	BANKSEL T3L
	MOV R0,T3L
	JMP DATE_READ_IN_VAR
USE_T1_DATE_IN:
	BANKSEL T1H
	MOV R1,T1H
	BANKSEL T1L
	MOV R0,T1L
DATE_READ_IN_VAR:
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_+1,R1
	MOV __KF8_LIBi_Touch_New_Date_SW_,R0
	
;	op : INLINEASM
	;;---------------------------------
	;;==
	CLR PSW,0
	BANKSEL __KF8_LIBc_channel_
	RLCR __KF8_LIBc_channel_
	ADD R0,#(__KF8_LIBi_buff_hit_+0)
	BANKSEL _Date_Save_Buf_SW_
	MOV _Date_Save_Buf_SW_,R0 ;
	;;==
	MOV R0,#(4)
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	ADD __KF8_LIBi_Touch_New_Date_SW_,R0
	JNB PSW,0
	INC __KF8_LIBi_Touch_New_Date_SW_+1
	;;==;
	MOV R0,#3
	INC R0
	JMP IIR_Deal_NEXT_1
IIR_Deal_DO_1:
	CLR PSW,0
	RRC __KF8_LIBi_Touch_New_Date_SW_+1
	RRC __KF8_LIBi_Touch_New_Date_SW_
IIR_Deal_NEXT_1:
	DECJZ R0
	JMP IIR_Deal_DO_1
	;;-----------------------------------
	BANKSEL _Date_Save_Buf_SW_
	MOV R0, _Date_Save_Buf_SW_
	BANKSEL __KF8_LIBi_buff_hit_
	LD R1,[R0]
	BANKSEL __KF8_Temp_Cur_A_SW_
	MOV __KF8_Temp_Cur_A_SW_,R1
	INC R0
	BANKSEL __KF8_LIBi_buff_hit_
	LD R1,[R0]
	BANKSEL __KF8_Temp_Cur_A_SW_
	MOV __KF8_Temp_Cur_A_SW_+1,R1 ;
	BANKSEL __KF8_Temp_Cur_A_SW_
	MOV R0,__KF8_Temp_Cur_A_SW_
	BANKSEL __KF8_Temp_Cur_B_SW_
	MOV __KF8_Temp_Cur_B_SW_,R0
	MOV __KF8_Temp_Cur_B_SW_+1,R1 ;
	;;==
	MOV R0,#(4)
	BANKSEL __KF8_Temp_Cur_B_SW_
	ADD __KF8_Temp_Cur_B_SW_,R0
	JNB PSW,0
	INC __KF8_Temp_Cur_B_SW_+1
	;;==;
	MOV R0,#3
	INC R0
	JMP IIR_Deal_NEXT_2
IIR_Deal_DO_2:
	CLR PSW,0
	RRC __KF8_Temp_Cur_B_SW_+1
	RRC __KF8_Temp_Cur_B_SW_
IIR_Deal_NEXT_2:
	DECJZ R0
	JMP IIR_Deal_DO_2 ;
	MOV R0,__KF8_Temp_Cur_B_SW_
	MOV R1,__KF8_Temp_Cur_B_SW_+1
	BANKSEL __KF8_Temp_Cur_A_SW_
	SUB __KF8_Temp_Cur_A_SW_,R0
	JB PSW,0
	DEC __KF8_Temp_Cur_A_SW_+1
	SUB __KF8_Temp_Cur_A_SW_+1,R1
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV R1,__KF8_LIBi_Touch_New_Date_SW_+1
	MOV R0,__KF8_LIBi_Touch_New_Date_SW_
	BANKSEL __KF8_Temp_Cur_A_SW_
	ADD __KF8_Temp_Cur_A_SW_,R0
	JNB PSW,0
	INC R1
	ADD __KF8_Temp_Cur_A_SW_+1,R1 ;
	MOV R1,__KF8_Temp_Cur_A_SW_
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_
	BANKSEL __KF8_LIBi_buff_hit_
	ST[R0],R1
	BANKSEL __KF8_Temp_Cur_A_SW_
	MOV R1,__KF8_Temp_Cur_A_SW_+1
	INC R0
	BANKSEL __KF8_LIBi_buff_hit_
	ST[R0],R1
	;;-----------------------------------
	
;	op : GET_VALUE_AT_ADDRESS
;	.line	2137; "../kf8spsw_lib_touch_lib.c"	if(!_KF8_Touch_Bits_._KF8_Touch_Work_Flag)
	BANKSEL	__KF8_Touch_Bits_
	JNB	__KF8_Touch_Bits_, 0
	JMP	_00071_DS_
;	op : INLINEASM
	MOV R0,#0xF0
	DECJZ R0
	JMP $-1
	
;	op : LEFT_OP
;	.line	2145; "../kf8spsw_lib_touch_lib.c"	_KF8_LIBc_touch_count_[_KF8_LIBc_channel_]=0;	    //按下判 断计数不计数
	CLR	PSW, 0
	BANKSEL	__KF8_LIBc_channel_
	RLCR	__KF8_LIBc_channel_
	BANKSEL	r0x101B
	MOV	r0x101B, R0
;	op : +
	MOV	R0,# (__KF8_LIBc_touch_count_ + 0)
	BANKSEL	r0x101B
	ADD	r0x101B, R0
;	op : =
	MOV	R0,# 0x00
	BANKSEL	r0x101B
	MOV	R1, r0x101B
	BANKSEL	__KF8_LIBc_touch_count_
	ST	[R1], R0
	INC	R1
	MOV	R0,# 0x00
	BANKSEL	__KF8_LIBc_touch_count_
	ST	[R1], R0
;	op : IFX
;	.line	2147; "../kf8spsw_lib_touch_lib.c"	if(_KF8_LIBc_channel_==0)
	MOV	R0,# 0x00
	BANKSEL	__KF8_LIBc_channel_
	ORL	R0, __KF8_LIBc_channel_
	JB	PSW, 2
	JMP	_00072_DS_
;	op : +
;	.line	2149; "../kf8spsw_lib_touch_lib.c"	ii_buf_SW_++;
	BANKSEL	_ii_buf_SW_
	INC	_ii_buf_SW_
;	op : >
;swapping arguments (AOP_TYPEs 1/3)
;unsigned compare: left >= lit(0x79=121), size=1
;	.line	2150; "../kf8spsw_lib_touch_lib.c"	if(ii_buf_SW_>120) //每扫描1圈记一次，n圈后进入工作状态
	MOV	R0,# 0x79
	BANKSEL	_ii_buf_SW_
	SUB	R0, _ii_buf_SW_
;comparing bytes at offset 0
	JB	PSW, 0
	JMP	_00072_DS_
;	op : =
;	.line	2152; "../kf8spsw_lib_touch_lib.c"	_KF8_Touch_Bits_._KF8_Touch_Work_Flag=1;  //进入工作状态
	BANKSEL	__KF8_Touch_Bits_
	SET	__KF8_Touch_Bits_, 0
;	op : CALL
;	.line	2153; "../kf8spsw_lib_touch_lib.c"	read_data_eep_tsw_();
	PAGESEL	_read_data_eep_tsw_
	CALL	_read_data_eep_tsw_
	PAGESEL	$
;	op : INLINEASM
	BANKSEL _ii_buf_SW_
	CLR _ii_buf_SW_
FOR_NEXT_DO_1:
	MOV R1,# high (_CHS_AMOUNT+0)
	MOV R0,# low (_CHS_AMOUNT+0)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL _ii_buf_SW_
	MOV R1,_ii_buf_SW_
	SUB R0,R1 ;
	JNB PSW,0 ;
	JMP FOR_NEXT_DO_1_End
	;
	CLR PSW,0
	RLC R1 ;
	ADD R1,#(_Arr_erom_SW_+1)
	BANKSEL _Arr_erom_SW_
	LD R0,[R1]
	BANKSEL _eeprom_data_SW_
	MOV (_eeprom_data_SW_+1),R0
	DEC R1
	BANKSEL _Arr_erom_SW_
	LD R0,[R1]
	BANKSEL _eeprom_data_SW_
	MOV (_eeprom_data_SW_),R0 ;
	;;--------------------
	BANKSEL _ii_buf_SW_
	MOV R1,_ii_buf_SW_
	CLR PSW,0
	RLC R1 ;
	ADD R1,#__KF8_LIBi_buff_refline_
	BANKSEL _eeprom_data_SW_
	MOV R0,_eeprom_data_SW_
	BANKSEL __KF8_LIBi_buff_refline_
	ST [R1],R0
	BANKSEL _eeprom_data_SW_
	MOV R0,_eeprom_data_SW_+1
	INC R1
	BANKSEL __KF8_LIBi_buff_refline_
	ST [R1],R0 ;
	;;------------------
	BANKSEL _eeprom_data_SW_
	MOV R1,_eeprom_data_SW_
	MOV R0,_eeprom_data_SW_+1
	AND R0,R1
	MOV R1,#0xFF
	XOR R0,R1
	JB PSW,2 ;
	JMP FOR_DO_1_End
	BANKSEL __KF8_Touch_Bits_
	SET __KF8_Touch_Bits_,3 ;
	;
FOR_DO_1_End:
	BANKSEL _ii_buf_SW_
	INC _ii_buf_SW_
	JMP FOR_NEXT_DO_1
FOR_NEXT_DO_1_End:
	
;	op : GET_VALUE_AT_ADDRESS
;	.line	2234; "../kf8spsw_lib_touch_lib.c"	if(_KF8_Touch_Bits_._KF8_Touch_Need_Save_Flag)
	BANKSEL	__KF8_Touch_Bits_
	JB	__KF8_Touch_Bits_, 3
	JMP	_00064_DS_
;	op : INLINEASM
	BANKSEL _ii_buf_SW_
	CLR _ii_buf_SW_
FOR_NEXT_DO_2:
	MOV R1,# high (_CHS_AMOUNT+0)
	MOV R0,# low (_CHS_AMOUNT+0)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL _ii_buf_SW_
	MOV R1,_ii_buf_SW_
	SUB R0,R1 ;
	JNB PSW,0 ;
	JMP FOR_NEXT_DO_2_End
	;;
	CLR PSW,0
	BANKSEL _ii_buf_SW_
	RLCR _ii_buf_SW_
	BANKSEL _Date_Save_Buf_SW_
	MOV _Date_Save_Buf_SW_,R0 ;
	ADD R0,#(__KF8_LIBi_buff_hit_)
	BANKSEL __KF8_LIBi_buff_hit_
	LD R1,[R0];;
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_
	ADD R0,#(_Arr_erom_SW_+0)
	BANKSEL _Arr_erom_SW_
	ST [R0],R1;;
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_
	ADD R0,#(__KF8_LIBi_buff_hit_+1)
	BANKSEL __KF8_LIBi_buff_hit_
	LD R1,[R0];;
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_
	ADD R0,#(_Arr_erom_SW_+1)
	BANKSEL _Arr_erom_SW_
	ST [R0],R1;;
	;;------------------------------------
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_ ;
	ADD R0,#(__KF8_LIBi_buff_hit_)
	BANKSEL __KF8_LIBi_buff_hit_
	LD R1,[R0];;
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_
	ADD R0,#(__KF8_LIBi_buff_baseline_+0)
	BANKSEL __KF8_LIBi_buff_baseline_
	ST [R0],R1;;
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_
	ADD R0,#(__KF8_LIBi_buff_hit_+1)
	BANKSEL __KF8_LIBi_buff_hit_
	LD R1,[R0];;
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_
	ADD R0,#(__KF8_LIBi_buff_baseline_+1)
	BANKSEL __KF8_LIBi_buff_baseline_
	ST [R0],R1;;
	;;
	;;------------------------------------
	BANKSEL _Date_Save_Buf_SW_
	MOV R0, _Date_Save_Buf_SW_ ;
	ADD R0,#(__KF8_LIBi_buff_hit_)
	BANKSEL __KF8_LIBi_buff_hit_
	LD R1,[R0];;
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_
	ADD R0,#(__KF8_LIBi_buff_refline_+0)
	BANKSEL __KF8_LIBi_buff_refline_
	ST [R0],R1;;
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_
	ADD R0,#(__KF8_LIBi_buff_hit_+1)
	BANKSEL __KF8_LIBi_buff_hit_
	LD R1,[R0];;
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_
	ADD R0,#(__KF8_LIBi_buff_refline_+1)
	BANKSEL __KF8_LIBi_buff_refline_
	ST [R0],R1;;
	;;
	;;
	BANKSEL _ii_buf_SW_
	INC _ii_buf_SW_
	JMP FOR_NEXT_DO_2
FOR_NEXT_DO_2_End:
	
;	op : CALL
;	.line	2340; "../kf8spsw_lib_touch_lib.c"	write_eep_tsw_(); // 写入基准比例对照关系
	PAGESEL	_write_eep_tsw_
	CALL	_write_eep_tsw_
	PAGESEL	$
;	op : GOTO
	JMP	_00072_DS_
;	op : LABEL
;	op : INLINEASM
_00064_DS_
	MOV R1,# high (__KF8_Inside_Reference_Channel_Order+0)
	MOV R0,# low (__KF8_Inside_Reference_Channel_Order+0)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	CLR PSW,0
	RLC R0
	BANKSEL _Date_Save_Buf_SW_
	MOV _Date_Save_Buf_SW_,R0 ;;
	;;-------------------------------
	ADD R0,#(__KF8_LIBi_buff_hit_+0)
	BANKSEL __KF8_LIBi_buff_hit_
	LD R1,[R0] ;;
	BANKSEL __KF8_Temp_Cur_A_SW_
	MOV __KF8_Temp_Cur_A_SW_,R1
	INC R0
	BANKSEL __KF8_LIBi_buff_hit_
	LD R1,[R0] ;;
	BANKSEL __KF8_Temp_Cur_A_SW_
	MOV (__KF8_Temp_Cur_A_SW_+1),R1 ;;
	;;-----------------------------
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_
	ADD R0,#(__KF8_LIBi_buff_refline_+0)
	BANKSEL __KF8_LIBi_buff_refline_
	LD R1,[R0] ;;
	BANKSEL __KF8_Temp_Cur_B_SW_
	MOV __KF8_Temp_Cur_B_SW_,R1
	INC R0
	BANKSEL __KF8_LIBi_buff_refline_
	LD R1,[R0] ;;
	BANKSEL __KF8_Temp_Cur_B_SW_
	MOV (__KF8_Temp_Cur_B_SW_+1),R1 ;;
	;;-----------------------------
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_
	ADD R0,#(__KF8_LIBi_buff_baseline_+0)
	BANKSEL __KF8_Temp_Cur_B_SW_
	MOV R1,__KF8_Temp_Cur_B_SW_
	BANKSEL __KF8_LIBi_buff_baseline_
	ST [R0],R1;
	INC R0
	BANKSEL __KF8_Temp_Cur_B_SW_
	MOV R1,__KF8_Temp_Cur_B_SW_+1
	BANKSEL __KF8_LIBi_buff_baseline_
	ST [R0],R1;
	
;	op : CALL
;	.line	2399; "../kf8spsw_lib_touch_lib.c"	_KF8spsw_Lib_DateChange_get_();
	PAGESEL	__KF8spsw_Lib_DateChange_get_
	CALL	__KF8spsw_Lib_DateChange_get_
	PAGESEL	$
;	op : CALL
;	.line	2401; "../kf8spsw_lib_touch_lib.c"	_KF8spsw_Lib_BaseLine_Reget_();
	PAGESEL	__KF8spsw_Lib_BaseLine_Reget_
	CALL	__KF8spsw_Lib_BaseLine_Reget_
	PAGESEL	$
;	op : GOTO
	JMP	_00072_DS_
;	op : LABEL
;	op : CALL
_00071_DS_
;	.line	2409; "../kf8spsw_lib_touch_lib.c"	_KF8spsw_LIBf_scan_channel_(); //扫描AD通道,计算变化率，做变化统计
	PAGESEL	__KF8spsw_LIBf_scan_channel_
	CALL	__KF8spsw_LIBf_scan_channel_
	PAGESEL	$
;	op : LABEL
;	op : INLINEASM
_00072_DS_
	MOV R1,# high (_CHS_AMOUNT+0)
	MOV R0,# low (_CHS_AMOUNT+0)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBc_channel_
	INC __KF8_LIBc_channel_
	XOR R0,__KF8_LIBc_channel_
	JNB PSW,2
	CLR __KF8_LIBc_channel_
	
;	op : INLINEASM
	BANKSEL _CTCTL
	JNB _CTCTL,4
	JMP USE_T3L_COUNT_FLAG
	BANKSEL _T1L
	CLR _T1L
	BANKSEL _T1H
	CLR _T1H
	BANKSEL EIF1
	CLR EIF1,_T1IF
	JMP START_CT_DO
USE_T3L_COUNT_FLAG:
	CLR _T3L
START_CT_DO:
	BANKSEL __KF8_LIBc_channel_
	MOV R0, __KF8_LIBc_channel_
	ADD R0, # low (__KF8_TOUCH_CH_EN+0)
	MOV R1, # high (__KF8_TOUCH_CH_EN+0)
	JNB _PSW,0
	INC R1
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	MOV R1,#0xF0
	BANKSEL _CTCTL
	AND _CTCTL,R1 ;
	ORL _CTCTL,R0
	MOV R0,#0x01
	DECJZ R0
	JMP $-1
	SET _CTCTL,6 ;
	NOP
	JB _CTCTL,6
	JMP $-3
START_CT_END_DO:
	BANKSEL _CTCTL
	JNB _CTCTL,4
	CLR _T1U
	
;	op : LABEL
;	op : ENDFUNCTION
	CRET	
; exit point of __KF8spsw_LIBf_touch_process_



func.__KF8spsw_LIBf_scan_channel_	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  __KF8spsw_LIBf_scan_channel_	;Function start
; 2 exit points
;has an exit
;functions called:
;   __KF8spsw_Lib_DateChange_get_
;   __KF8spsw_Lib_BaseLine_Reget_
;   __KF8spsw_Lib_DateChange_get_
;   __KF8spsw_Lib_BaseLine_Reget_
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
__KF8spsw_LIBf_scan_channel_	;Function start
; 2 exit points
;	op : INLINEASM
	CLR PSW,0
	BANKSEL __KF8_LIBc_channel_
	RLCR __KF8_LIBc_channel_
	BANKSEL _Date_Save_Buf_SW_
	MOV _Date_Save_Buf_SW_,R0
	
;	op : INLINEASM
	BANKSEL _Date_Save_Buf_SW_
	MOV R1,_Date_Save_Buf_SW_
	ADD R1,#(__KF8_LIBi_buff_hit_+0)
	;;;;
	BANKSEL __KF8_LIBi_buff_hit_
	LD R0,[R1]
	BANKSEL __KF8_Temp_Cur_A_SW_
	MOV __KF8_Temp_Cur_A_SW_, R0
	;;;;
	INC R1
	BANKSEL __KF8_LIBi_buff_hit_
	LD R0,[R1]
	BANKSEL __KF8_Temp_Cur_A_SW_
	MOV (__KF8_Temp_Cur_A_SW_+1), R0
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	BANKSEL _Date_Save_Buf_SW_
	MOV R1,_Date_Save_Buf_SW_
	ADD R1,#(__KF8_LIBi_buff_baseline_+0)
	;;;;
	BANKSEL __KF8_LIBi_buff_baseline_
	LD R0,[R1]
	BANKSEL __KF8_Temp_Cur_B_SW_
	MOV __KF8_Temp_Cur_B_SW_, R0
	;;;;
	INC R1
	BANKSEL __KF8_LIBi_buff_baseline_
	LD R0,[R1]
	BANKSEL __KF8_Temp_Cur_B_SW_
	MOV (__KF8_Temp_Cur_B_SW_+1), R0
	
;	op : CALL
;	.line	978; "../kf8spsw_lib_touch_lib.c"	_KF8spsw_Lib_DateChange_get_();
	PAGESEL	__KF8spsw_Lib_DateChange_get_
	CALL	__KF8spsw_Lib_DateChange_get_
	PAGESEL	$
;	op : INLINEASM
	MOV R1,#high (__KF8_Inside_Reference_Channel_Order+0)
	MOV R0,#low (__KF8_Inside_Reference_Channel_Order+0)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBc_channel_
	MOV R1,__KF8_LIBc_channel_
	XOR R0,R1
	JB PSW,2
	JMP NOT_Reference_Channel_Order_Deal_1
	
;	op : INLINEASM
Reference_Channel_Order_Deal_1:
	
;	op : INLINEASM
	CLR PSW,0
	BANKSEL __KF8_LIBc_channel_
	RLCR __KF8_LIBc_channel_
	ADD R0,#(__KF8_LIBi_Date_Change_+0)
	;;;;
	BANKSEL __KF8_LIBi_Date_Change_
	LD R1,[R0]
	BANKSEL _change_buf_SW_
	MOV _change_buf_SW_,R1
	INC R0
	BANKSEL __KF8_LIBi_Date_Change_
	LD R1,[R0]
	BANKSEL _change_buf_SW_
	MOV _change_buf_SW_+1,R1
	;;;;
	BANKSEL __KF8_lib_bahualvtemportemp_SW_
	MOV R1, __KF8_lib_bahualvtemportemp_SW_
	BANKSEL _change_buf_SW_
	SUB _change_buf_SW_,R1
	JB PSW,0
	DEC _change_buf_SW_+1
	BANKSEL __KF8_lib_bahualvtemportemp_SW_
	MOV R1, __KF8_lib_bahualvtemportemp_SW_+1
	BANKSEL _change_buf_SW_
	SUB _change_buf_SW_+1,R1 ;
	;;-----------------------------
	BANKSEL _change_buf_SW_
	JB _change_buf_SW_+1, 7
	JMP lable_qufanover
	CPL _change_buf_SW_
	CPL _change_buf_SW_+1
	INC _change_buf_SW_
	JNB PSW,2
	INC _change_buf_SW_+1
lable_qufanover:
	;
	
;	op : INLINEASM
	CLR PSW,0
	BANKSEL __KF8_LIBc_channel_
	RLCR __KF8_LIBc_channel_
	ADD R0,#(__KF8_LIBi_Date_Change_+0)
	BANKSEL __KF8_lib_bahualvtemportemp_SW_
	MOV R1,__KF8_lib_bahualvtemportemp_SW_
	BANKSEL __KF8_LIBi_Date_Change_
	ST [R0],R1
	BANKSEL __KF8_lib_bahualvtemportemp_SW_
	MOV R1,__KF8_lib_bahualvtemportemp_SW_+1
	INC R0
	BANKSEL __KF8_LIBi_Date_Change_
	ST [R0],R1
	
;	op : INLINEASM
	MOV R1,# high (__KF8_Inside_Reference_Channel_Disturb_Threshold_Set_+0)
	MOV R0,# low (__KF8_Inside_Reference_Channel_Disturb_Threshold_Set_+0)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_,R0
	MOV R1,#high(__KF8_Inside_Reference_Channel_Disturb_Threshold_Set_+1)
	MOV R0,#low(__KF8_Inside_Reference_Channel_Disturb_Threshold_Set_+1)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_+1,R0 ;
	;;------------------------------
	BANKSEL _change_buf_SW_
	MOV R0,_change_buf_SW_+1
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	SUB R0,__KF8_LIBi_Touch_New_Date_SW_+1
	JB PSW,0 ;
	JMP DATE_CHANGE_BIG_FLG_DO_1
	JB PSW, 2 ;
	JMP NOT_DATE_CHANGE_BIG_FLG_DO_1
	BANKSEL _change_buf_SW_
	MOV R0,_change_buf_SW_
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	SUB R0,__KF8_LIBi_Touch_New_Date_SW_
	JNB PSW,0
	JMP NOT_DATE_CHANGE_BIG_FLG_DO_1
	
;	op : INLINEASM
DATE_CHANGE_BIG_FLG_DO_1:
	
;	op : =
;	.line	1103; "../kf8spsw_lib_touch_lib.c"	_KF8_Touch_Bits_._KF8_Touch_Protect_Flag=1;
	BANKSEL	__KF8_Touch_Bits_
	SET	__KF8_Touch_Bits_, 1
;	op : =
;	.line	1104; "../kf8spsw_lib_touch_lib.c"	_KF8_Disturb_Protect_Circle_=0;
	BANKSEL	__KF8_Disturb_Protect_Circle_
	CLR	__KF8_Disturb_Protect_Circle_
	BANKSEL	__KF8_Disturb_Protect_Circle_
	CLR	(__KF8_Disturb_Protect_Circle_ + 1)
;	op : =
;	.line	1105; "../kf8spsw_lib_touch_lib.c"	_KF8_Up_BaseLine_Circle_=0;
	BANKSEL	__KF8_Up_BaseLine_Circle_
	CLR	__KF8_Up_BaseLine_Circle_
	BANKSEL	__KF8_Up_BaseLine_Circle_
	CLR	(__KF8_Up_BaseLine_Circle_ + 1)
;	op : INLINEASM
	JMP DATE_CHANGE_FLG_END
	
;	op : INLINEASM
NOT_DATE_CHANGE_BIG_FLG_DO_1:
	
;	op : GET_VALUE_AT_ADDRESS
;	.line	1117; "../kf8spsw_lib_touch_lib.c"	if(_KF8_Touch_Bits_._KF8_Touch_Protect_Flag)
	BANKSEL	__KF8_Touch_Bits_
	JB	__KF8_Touch_Bits_, 1
	JMP	_00054_DS_
;	op : INLINEASM
	;;------------------------
	MOV R1,# high (__KF8_Disturb_Protect_Circle_Define+0)
	MOV R0,# low (__KF8_Disturb_Protect_Circle_Define+0)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_,R0
	MOV R1,# high (__KF8_Disturb_Protect_Circle_Define+1)
	MOV R0,# low (__KF8_Disturb_Protect_Circle_Define+1)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_+1,R0 ;
	;;------------------------
	BANKSEL __KF8_Disturb_Protect_Circle_
	INC __KF8_Disturb_Protect_Circle_
	JNB PSW,2
	INC __KF8_Disturb_Protect_Circle_+1 ;;
	;;-------------------------
	MOV R0,__KF8_Disturb_Protect_Circle_
	MOV R1,__KF8_Disturb_Protect_Circle_+1
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	SUB R1,__KF8_LIBi_Touch_New_Date_SW_+1
	JB PSW,0
	JMP Protect_Time_End_Deal_Flag ;
	JB PSW,2
	JMP Protect_Time_Deal_End_Flag ;
	SUB R0,__KF8_LIBi_Touch_New_Date_SW_
	JNB PSW,0 ;
	JMP Protect_Time_Deal_End_Flag
	;;--------------------
Protect_Time_End_Deal_Flag:
	BANKSEL __KF8_Disturb_Protect_Circle_
	CLR __KF8_Disturb_Protect_Circle_
	CLR __KF8_Disturb_Protect_Circle_+1 ;;
	BANKSEL __KF8_Touch_Bits_
	CLR __KF8_Touch_Bits_,1 ;
	;;--------------------
Protect_Time_Deal_End_Flag:
	
;	op : GOTO
;	.line	1171; "../kf8spsw_lib_touch_lib.c"	if(1);
	JMP	_00055_DS_
;	op : LABEL
;	op : INLINEASM
_00054_DS_
	MOV R1,# high (__KF8_Up_BaseLine_Circle_Define+0)
	MOV R0,# low (__KF8_Up_BaseLine_Circle_Define+0)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_,R0
	MOV R1,# high (__KF8_Up_BaseLine_Circle_Define+1)
	MOV R0,# low (__KF8_Up_BaseLine_Circle_Define+1)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_+1,R0 ;
	;;----------------------------
	BANKSEL __KF8_Up_BaseLine_Circle_
	INC __KF8_Up_BaseLine_Circle_
	JNB PSW,2
	INC __KF8_Up_BaseLine_Circle_+1
	MOV R0,__KF8_Up_BaseLine_Circle_
	MOV R1,__KF8_Up_BaseLine_Circle_+1
	;;----------------------------
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	SUB R1,__KF8_LIBi_Touch_New_Date_SW_+1
	JB PSW,0 ;;
	JMP Update_Baseline_Deal_Flag
	JB PSW,2
	JMP UP_BaseLine_End ;
	SUB R0,__KF8_LIBi_Touch_New_Date_SW_
	JNB PSW,0 ;;
	JMP UP_BaseLine_End
	
;	op : INLINEASM
Update_Baseline_Deal_Flag:
	BANKSEL __KF8_Up_BaseLine_Circle_
	CLR __KF8_Up_BaseLine_Circle_
	CLR __KF8_Up_BaseLine_Circle_+1
	
;	op : CALL
;	.line	1221; "../kf8spsw_lib_touch_lib.c"	_KF8spsw_Lib_BaseLine_Reget_();
	PAGESEL	__KF8spsw_Lib_BaseLine_Reget_
	CALL	__KF8spsw_Lib_BaseLine_Reget_
	PAGESEL	$
;	op : INLINEASM
UP_BaseLine_End:
	
;	op : LABEL
;	op : INLINEASM
_00055_DS_
DATE_CHANGE_FLG_END:
	
;	op : INLINEASM
	JMP Channel_Order_Deal_END
	
;	op : INLINEASM
NOT_Reference_Channel_Order_Deal_1:
	
;	op : GET_VALUE_AT_ADDRESS
;	.line	1245; "../kf8spsw_lib_touch_lib.c"	if(!_KF8_Touch_Bits_._KF8_Touch_Protect_Flag)
	BANKSEL	__KF8_Touch_Bits_
	JNB	__KF8_Touch_Bits_, 1
	JMP	_00057_DS_
;	op : INLINEASM
	CLR PSW,0
	BANKSEL __KF8_LIBc_channel_
	RLCR __KF8_LIBc_channel_
	ADD R0,#(__KF8_LIBi_Date_Change_)
	BANKSEL __KF8_lib_bahualvtemportemp_SW_
	MOV R1,__KF8_lib_bahualvtemportemp_SW_
	BANKSEL __KF8_LIBi_Date_Change_
	ST [R0],R1
	BANKSEL __KF8_lib_bahualvtemportemp_SW_
	MOV R1,__KF8_lib_bahualvtemportemp_SW_+1
	INC R0
	BANKSEL __KF8_LIBi_Date_Change_
	ST [R0],R1
	
;	op : INLINEASM
	CLR PSW,0
	BANKSEL __KF8_LIBc_channel_
	RLCR __KF8_LIBc_channel_
	BANKSEL _Date_Save_Buf_SW_
	MOV _Date_Save_Buf_SW_,R0 ;
	
;	op : INLINEASM
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_
	ADD R0,#(__KF8_LIBi_Date_Change_+0)
	BANKSEL __KF8_LIBi_Date_Change_
	LD R1,[R0]
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_,R1
	INC R0
	BANKSEL __KF8_LIBi_Date_Change_
	LD R1,[R0]
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_+1,R1
	JNB R1,7
	JMP Key_Up_State_Flag_1
	;;-------------
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_
	ADD R0,#Low(_CONFIG_NO_FINGER_THRESHOLD+1)
	MOV R1,#High(_CONFIG_NO_FINGER_THRESHOLD+1)
	JNB PSW,0
	INC R1
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	SUB R0,__KF8_LIBi_Touch_New_Date_SW_+1
	JB PSW,0
	JMP Key_Up_State_Flag_1
	JB PSW,2
	JMP KEY_UNDO_DEAL_1 ;
	;;===
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_
	ADD R0,#Low(_CONFIG_NO_FINGER_THRESHOLD+0)
	MOV R1,#High(_CONFIG_NO_FINGER_THRESHOLD+0)
	JNB PSW,0
	INC R1
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	SUB R0,__KF8_LIBi_Touch_New_Date_SW_
	JNB PSW,0
	JMP KEY_UNDO_DEAL_1
	
;	op : INLINEASM
Key_Up_State_Flag_1:
	
;	op : INLINEASM
	MOV R1,# high (_TCS_AMOUNT+0)
	MOV R0,# low (_TCS_AMOUNT+0)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_,R0
	MOV R1,# high (_TCS_AMOUNT+1)
	MOV R0,# low (_TCS_AMOUNT+1)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_+1,R0 ;;
	;;--------------
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_
	ADD R0,#(__KF8_LIBc_touch_count_+1)
	BANKSEL __KF8_LIBc_touch_count_
	LD R1,[R0]
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	SUB R1,__KF8_LIBi_Touch_New_Date_SW_+1
	JB PSW,0
	JMP Key_Down_To_Know_UP
	JB PSW,2
	JMP KEY_UNDO_END_FLAG
	DEC R0
	BANKSEL __KF8_LIBc_touch_count_
	LD R1,[R0]
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	SUB R1,__KF8_LIBi_Touch_New_Date_SW_
	JNB PSW,0
	JMP KEY_UNDO_END_FLAG
	
;	op : INLINEASM
Key_Down_To_Know_UP:
	
;	op : INLINEASM
	MOV R1,# high (_TCS_AMOUNT+0)
	MOV R0,# low (_TCS_AMOUNT+0)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_,R0
	MOV R1,# high (_TCS_AMOUNT+1)
	MOV R0,# low (_TCS_AMOUNT+1)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_+1,R0
	CLR PSW,0
	RLC __KF8_LIBi_Touch_New_Date_SW_
	RLC __KF8_LIBi_Touch_New_Date_SW_+1 ;;
	;;
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_
	ADD R0,#(__KF8_LIBc_touch_count_+1)
	BANKSEL __KF8_LIBc_touch_count_
	LD R1,[R0]
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	SUB R1, __KF8_LIBi_Touch_New_Date_SW_+1
	JB PSW,0
	JMP KEY_UP_FLAG_DEAL_1
	JB PSW,2
	JMP Key_Down_To_Up_Delay
	DEC R0
	BANKSEL __KF8_LIBc_touch_count_
	LD R1,[R0]
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	SUB R1, __KF8_LIBi_Touch_New_Date_SW_
	JB PSW,0 ;
	JMP KEY_UP_FLAG_DEAL_1 ;;
	
;	op : INLINEASM
Key_Down_To_Up_Delay:
	
;	op : INLINEASM
	BANKSEL __KF8_LIBc_touch_count_
	LD R1,[R0]
	ADD R1,#0x01
	ST [R0],R1
	JB PSW,0
	JMP KEY_UNDO_END_FLAG
	INC R0
	LD R1,[R0]
	INC R1
	ST [R0],R1
	JMP KEY_UNDO_END_FLAG
	
;	op : INLINEASM
KEY_UP_FLAG_DEAL_1:
	
;	op : INLINEASM
	CLR R1
	BANKSEL __KF8_LIBc_touch_count_
	ST [R0],R1
	INC R0
	ST [R0],R1
	
;	op : INLINEASM
	;;-----------------------------
	BANKSEL __KF8_LIBc_channel_
	MOV R0, __KF8_LIBc_channel_
	ADD R0, #low (__KF8_TOUCH_CH_EN)
	MOV R1, #high (__KF8_TOUCH_CH_EN)
	JNB PSW,0
	INC R1
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	;;===
	CLR PSW,0
	RLC R0
	BANKSEL __KF8_lib_Date_Uchar_Temp_SW_
	MOV __KF8_lib_Date_Uchar_Temp_SW_ , R0
	;;;;;;;;;;;;;;;;;;;;
	ADD R0,#low(__KF8_LIBt_buff_bit_SW_+0)
	MOV R1,#high(__KF8_LIBt_buff_bit_SW_+0)
	JNB PSW,0
	INC R1
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	CPL R0
	BANKSEL __KF8_LIBi_channel_flag_
	AND __KF8_LIBi_channel_flag_, R0 ;
	;;;;
	BANKSEL __KF8_lib_Date_Uchar_Temp_SW_
	MOV R0, __KF8_lib_Date_Uchar_Temp_SW_
	ADD R0,#low(__KF8_LIBt_buff_bit_SW_+1)
	MOV R1,#high(__KF8_LIBt_buff_bit_SW_+1)
	JNB PSW,0
	INC R1
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	CPL R0
	BANKSEL __KF8_LIBi_channel_flag_
	AND (__KF8_LIBi_channel_flag_+1), R0 ;
	;;-------------------------
	JMP KEY_UNDO_END_FLAG
	
;	op : INLINEASM
	JMP KEY_UNDO_END_FLAG
	
;	op : INLINEASM
KEY_UNDO_DEAL_1:
	
;	op : INLINEASM
	MOV R1,# high (_TCS_AMOUNT+0)
	MOV R0,# low (_TCS_AMOUNT+0)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_,R0
	MOV R1,# high (_TCS_AMOUNT+1)
	MOV R0,# low (_TCS_AMOUNT+1)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_+1,R0
	INC __KF8_LIBi_Touch_New_Date_SW_
	JNB PSW,2
	INC __KF8_LIBi_Touch_New_Date_SW_+1 ;;
	;;--------------------------------
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_
	ADD R0,#(__KF8_LIBc_touch_count_+1)
	BANKSEL __KF8_LIBc_touch_count_
	LD R1,[R0]
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	SUB R1,__KF8_LIBi_Touch_New_Date_SW_+1
	JB PSW,0 ;
	JMP Key_Up_Back_Count_DS_1
	JB PSW,2 ;
	JMP KEY_UNDO_END_FLAG
	DEC R0
	BANKSEL __KF8_LIBc_touch_count_
	LD R1,[R0]
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	SUB R1,__KF8_LIBi_Touch_New_Date_SW_
	JNB PSW,0 ;;
	JMP KEY_UNDO_END_FLAG ;
	;;-------------------------------
	;;
Key_Up_Back_Count_DS_1:
	BANKSEL __KF8_LIBc_touch_count_
	LD R1,[R0]
	ADD R1,#0xFF
	ST [R0],R1
	JNB PSW,0
	JMP KEY_UNDO_END_FLAG
	INC R0
	BANKSEL __KF8_LIBc_touch_count_
	LD R1,[R0]
	DEC R1
	ST [R0],R1
	;;
	
;	op : INLINEASM
KEY_UNDO_END_FLAG:
	
;	op : INLINEASM
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_
	ADD R0,#low(__KF8_Config_Finger_Threshold+0)
	MOV R1,#high(__KF8_Config_Finger_Threshold+0)
	JNB PSW,0
	INC R1
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_,R0
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_
	ADD R0,#low(__KF8_Config_Finger_Threshold+1)
	MOV R1,#high(__KF8_Config_Finger_Threshold+1)
	JNB PSW,0
	INC R1
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_+1,R0 ;
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_
	ADD R0,#(__KF8_LIBi_Date_Change_+1)
	BANKSEL __KF8_LIBi_Date_Change_
	LD R1,[R0]
	JNB R1,7
	JMP Key_Down_Deal_No_Down_1 ;
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	SUB R1,__KF8_LIBi_Touch_New_Date_SW_+1
	JB PSW,0 ;;
	JMP Key_Down_Deal_Down_1
	JB PSW,2 ;;
	JMP Key_Down_Deal_No_Down_1
	DEC R0
	BANKSEL __KF8_LIBi_Date_Change_
	LD R1,[R0]
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	SUB R1,__KF8_LIBi_Touch_New_Date_SW_
	JNB PSW,0 ;;
	JMP Key_Down_Deal_No_Down_1
	
;	op : INLINEASM
Key_Down_Deal_Down_1:
	
;	op : INLINEASM
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_
	ADD R0,#(__KF8_LIBc_touch_count_+0)
	BANKSEL __KF8_LIBc_touch_count_
	LD R1,[R0]
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_,R1
	INC R0
	BANKSEL __KF8_LIBc_touch_count_
	LD R1,[R0]
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_+1,R1 ;
	MOV R1,#High(_TCS_AMOUNT+1)
	MOV R0,#Low(_TCS_AMOUNT+1)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	SUB R0, __KF8_LIBi_Touch_New_Date_SW_+1
	JB PSW,0 ;
	JMP KEY_DOWN_DEAL_DELAY_1
	JB PSW,2 ;
	JMP Key_Down_ADD_Deal_End
	MOV R1,#High(_TCS_AMOUNT+0)
	MOV R0,#Low(_TCS_AMOUNT+0)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	SUB R0, __KF8_LIBi_Touch_New_Date_SW_
	JNB PSW,0 ;
	JMP Key_Down_ADD_Deal_End
	;;---------------------------
KEY_DOWN_DEAL_DELAY_1:
	CLR PSW,0
	BANKSEL __KF8_LIBc_channel_
	RLCR __KF8_LIBc_channel_
	ADD R0,#(__KF8_LIBc_touch_count_)
	BANKSEL __KF8_LIBc_touch_count_
	LD R1,[R0]
	INC R1
	ST [R0],R1
	JB PSW,2
	JMP Key_Down_ADD_Deal_End
	INC R0
	LD R1,[R0]
	INC R1
	ST [R0],R1
	JMP Key_Down_End_Deal_1
	
;	op : INLINEASM
Key_Down_ADD_Deal_End:
	MOV R1,# high (_TCS_AMOUNT+0)
	MOV R0,# low (_TCS_AMOUNT+0)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_,R0
	MOV R1,# high (_TCS_AMOUNT+1)
	MOV R0,# low (_TCS_AMOUNT+1)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_+1,R0
	;;====
	CLR PSW,0
	BANKSEL __KF8_LIBc_channel_
	RLCR __KF8_LIBc_channel_
	ADD R0,#__KF8_LIBc_touch_count_
	BANKSEL __KF8_LIBc_touch_count_
	LD R1,[R0]
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	XOR R1,__KF8_LIBi_Touch_New_Date_SW_
	JB PSW,2
	JMP Key_Down_End_Deal_1
	INC R0
	BANKSEL __KF8_LIBc_touch_count_
	LD R1,[R0]
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	XOR R1,__KF8_LIBi_Touch_New_Date_SW_+1
	JB PSW,2
	JMP Key_Down_End_Deal_1
	;;
	DEC R0
	BANKSEL __KF8_LIBc_touch_count_
	LD R1,[R0]
	ADD R1,#0x01
	ST [R0],R1
	JB PSW,0
	JMP SET_Key_Down_Flag
	INC R0
	LD R1,[R0]
	INC R1
	ST [R0],R1
SET_Key_Down_Flag:
	;;
	BANKSEL __KF8_LIBc_channel_
	MOV R0, __KF8_LIBc_channel_
	ADD R0, #low (__KF8_TOUCH_CH_EN)
	MOV R1, #high (__KF8_TOUCH_CH_EN)
	JNB PSW,0
	INC R1
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	CLR PSW,0
	RLC R0
	BANKSEL __KF8_lib_Date_Uchar_Temp_SW_
	MOV __KF8_lib_Date_Uchar_Temp_SW_ , R0
	;;;;;;;;;;;;;;;;;;;;
	ADD R0,#low(__KF8_LIBt_buff_bit_SW_)
	MOV R1,#high(__KF8_LIBt_buff_bit_SW_)
	JNB PSW,0
	INC R1
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	;;;;;;;;;;;;;;;;
	BANKSEL __KF8_LIBi_channel_flag_
	ORL __KF8_LIBi_channel_flag_,R0
	BANKSEL __KF8_lib_Date_Uchar_Temp_SW_
	MOV R0, __KF8_lib_Date_Uchar_Temp_SW_
	INC R0
	ADD R0,#low(__KF8_LIBt_buff_bit_SW_)
	MOV R1,#high(__KF8_LIBt_buff_bit_SW_)
	JNB PSW,0
	INC R1
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	;;;;;;;;;;;;;;;;;;;;;
	BANKSEL __KF8_LIBi_channel_flag_
	ORL (__KF8_LIBi_channel_flag_+1), R0
	
;	op : INLINEASM
Key_Down_End_Deal_1:
	JMP Key_Down_Deal_END
	
;	op : INLINEASM
Key_Down_Deal_No_Down_1:
	
;	op : INLINEASM
	CLR PSW,0
	BANKSEL __KF8_LIBc_channel_
	RLCR __KF8_LIBc_channel_
	ADD R0,#(__KF8_LIBc_touch_count_+0)
	BANKSEL __KF8_lib_Date_Uchar_Temp_SW_
	MOV __KF8_lib_Date_Uchar_Temp_SW_,R0 ;
	BANKSEL __KF8_LIBc_touch_count_
	LD R1,[R0]
	XOR R1,#0x00
	JB PSW,2
	JMP Key_Down_count_Condition
	INC R0
	BANKSEL __KF8_LIBc_touch_count_
	LD R1,[R0]
	XOR R1,#0x00
	JNB PSW,2
	JMP Key_Down_Count_Sub_End ;
Key_Down_count_Condition:
	;
	BANKSEL __KF8_lib_Date_Uchar_Temp_SW_
	MOV R0,__KF8_lib_Date_Uchar_Temp_SW_
	BANKSEL __KF8_LIBc_touch_count_
	LD R1,[R0]
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_,R1
	INC R0
	BANKSEL __KF8_LIBc_touch_count_
	LD R1,[R0]
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_+1,R1 ;
	MOV R1,# high (_TCS_AMOUNT+1)
	MOV R0,# low (_TCS_AMOUNT+1)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	SUB R0,__KF8_LIBi_Touch_New_Date_SW_+1
	JB PSW,0 ;
	JMP Key_Down_count_Sub
	JB PSW,2 ;
	JMP Key_Down_Count_Sub_End
	MOV R1,# high (_TCS_AMOUNT+0)
	MOV R0,# low (_TCS_AMOUNT+0)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	SUB R0,__KF8_LIBi_Touch_New_Date_SW_
	JNB PSW,0 ;;
	JMP Key_Down_Count_Sub_End
Key_Down_count_Sub:
	;
	BANKSEL __KF8_lib_Date_Uchar_Temp_SW_
	MOV R0,__KF8_lib_Date_Uchar_Temp_SW_
	BANKSEL __KF8_LIBc_touch_count_
	LD R1,[R0]
	ADD R1,#0xFF
	ST [R0],R1
	JNB PSW,0
	JMP Key_Down_Count_Sub_End
	INC R0
	LD R1,[R0]
	DEC R1
	ST [R0],R1
Key_Down_Count_Sub_End:
	
;	op : INLINEASM
Key_Down_Deal_END:
	
;	op : GOTO
;	.line	1895; "../kf8spsw_lib_touch_lib.c"	if(1);
	JMP	_00058_DS_
;	op : LABEL
;	op : INLINEASM
_00057_DS_
	CLR PSW,0
	BANKSEL __KF8_LIBc_channel_
	RLCR __KF8_LIBc_channel_
	ADD R0,#(__KF8_LIBc_touch_count_)
	BANKSEL __KF8_lib_Date_Uchar_Temp_SW_
	MOV __KF8_lib_Date_Uchar_Temp_SW_,R0 ;
	BANKSEL __KF8_LIBc_touch_count_
	LD R1,[R0]
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_,R1
	INC R0
	BANKSEL __KF8_LIBc_touch_count_
	LD R1,[R0]
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_+1,R1 ;;
	;;======
	MOV R1,# high (_TCS_AMOUNT+1)
	MOV R0,# low (_TCS_AMOUNT+1)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	SUB R0,__KF8_LIBi_Touch_New_Date_SW_+1
	JB PSW,0 ;
	JMP CLR_Key_Count_Do
	JB PSW,2 ;
	JMP SET_Key_Count_Know_Just
	MOV R1,# high (_TCS_AMOUNT+0)
	MOV R0,# low (_TCS_AMOUNT+0)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	SUB R0,__KF8_LIBi_Touch_New_Date_SW_
	JNB PSW,0 ;
	JMP SET_Key_Count_Know_Just
CLR_Key_Count_Do:
	;
	BANKSEL __KF8_lib_Date_Uchar_Temp_SW_
	MOV R0,__KF8_lib_Date_Uchar_Temp_SW_
	CLR R1
	BANKSEL __KF8_LIBc_touch_count_
	ST [R0],R1
	INC R0
	ST [R0],R1
	JMP SET_Key_Count_Know_OUT_END
SET_Key_Count_Know_Just:
	;
	MOV R1,# high (_TCS_AMOUNT+0)
	MOV R0,# low (_TCS_AMOUNT+0)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_,R0
	MOV R1,# high (_TCS_AMOUNT+1)
	MOV R0,# low (_TCS_AMOUNT+1)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV __KF8_LIBi_Touch_New_Date_SW_+1,R0
	INC __KF8_LIBi_Touch_New_Date_SW_
	JNB PSW,2
	INC __KF8_LIBi_Touch_New_Date_SW_+1
	;;==
	MOV R0,__KF8_LIBi_Touch_New_Date_SW_
	BANKSEL __KF8_lib_Date_Uchar_Temp_SW_
	MOV R1,__KF8_lib_Date_Uchar_Temp_SW_
	BANKSEL __KF8_LIBc_touch_count_
	ST [R1],R0
	INC R1
	BANKSEL __KF8_LIBi_Touch_New_Date_SW_
	MOV R0,__KF8_LIBi_Touch_New_Date_SW_+1
	BANKSEL __KF8_LIBc_touch_count_
	ST [R1],R0
SET_Key_Count_Know_OUT_END:
	
;	op : LABEL
;	op : INLINEASM
_00058_DS_
Channel_Order_Deal_END:
	
;	op : LABEL
;	op : ENDFUNCTION
;	.line	1997; "../kf8spsw_lib_touch_lib.c"	if(1);
	CRET	
; exit point of __KF8spsw_LIBf_scan_channel_



func.__KF8spsw_LIBf_init_touch_	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  __KF8spsw_LIBf_init_touch_	;Function start
; 2 exit points
;has an exit
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
__KF8spsw_LIBf_init_touch_	;Function start
; 2 exit points
;	op : =
;	.line	864; "../kf8spsw_lib_touch_lib.c"	_KF8_LIBi_channel_flag_ = 0x0000;//初始化
	BANKSEL	__KF8_LIBi_channel_flag_
	CLR	__KF8_LIBi_channel_flag_
	BANKSEL	__KF8_LIBi_channel_flag_
	CLR	(__KF8_LIBi_channel_flag_ + 1)
;	op : =
;	.line	865; "../kf8spsw_lib_touch_lib.c"	_KF8_LIBc_channel_ = 0;//初始化
	BANKSEL	__KF8_LIBc_channel_
	CLR	__KF8_LIBc_channel_
;	op : =
;	.line	868; "../kf8spsw_lib_touch_lib.c"	_KF8_Touch_Bits_._KF8_Touch_Work_Flag=0; //初始化
	BANKSEL	__KF8_Touch_Bits_
	CLR	__KF8_Touch_Bits_, 0
;	op : =
;	.line	869; "../kf8spsw_lib_touch_lib.c"	_KF8_Touch_Bits_._KF8_Touch_Protect_Flag=0;//初始化
	BANKSEL	__KF8_Touch_Bits_
	CLR	__KF8_Touch_Bits_, 1
;	op : =
;	.line	871; "../kf8spsw_lib_touch_lib.c"	_KF8_Touch_Bits_._KF8_Touch_Need_Save_Flag=0;
	BANKSEL	__KF8_Touch_Bits_
	CLR	__KF8_Touch_Bits_, 3
;	op : =
;	.line	873; "../kf8spsw_lib_touch_lib.c"	ii_buf_SW_=0;// 先开机取样计数
	BANKSEL	_ii_buf_SW_
	CLR	_ii_buf_SW_
;	op : =
;	.line	875; "../kf8spsw_lib_touch_lib.c"	CTIE=1; CTIF = 0;
	SET	_EIE1_bits, 7
;	op : =
	CLR	_EIF1_bits, 7
;	op : GET_VALUE_AT_ADDRESS
;	.line	877; "../kf8spsw_lib_touch_lib.c"	if(_KF8_Touch_Bits_._KF8_Touch_Work_USE_PWM)
	BANKSEL	__KF8_Touch_Bits_
	JB	__KF8_Touch_Bits_, 4
	JMP	_00048_DS_
;	op : =
;	.line	879; "../kf8spsw_lib_touch_lib.c"	CTCTL=0x90;	// 0x80 P12 T1H T1L;  0x90 P12 T1U T3L; 0xA0 P05 T1H T1L 0xB0 P05 T1U T3L
	MOV	R0,# 0x90
	MOV	_CTCTL, R0
;	op : =
;	.line	880; "../kf8spsw_lib_touch_lib.c"	T3L=0;
	CLR	_T3L
;	op : GOTO
	JMP	_00049_DS_
;	op : LABEL
;	op : =
_00048_DS_
;	.line	884; "../kf8spsw_lib_touch_lib.c"	T1IE=1; T1IF = 0;
	SET	_EIE1_bits, 0
;	op : =
	CLR	_EIF1_bits, 0
;	op : =
;	.line	885; "../kf8spsw_lib_touch_lib.c"	T1H=0;T1L=0;T1CTL=0x01;
	CLR	_T1H
;	op : =
	CLR	_T1L
;	op : =
	MOV	R0,# 0x01
	MOV	_T1CTL, R0
;	op : =
;	.line	886; "../kf8spsw_lib_touch_lib.c"	CTCTL=0x80;
	MOV	R0,# 0x80
	MOV	_CTCTL, R0
;	op : LABEL
;	op : INLINEASM
_00049_DS_
	MOV R0, # low (__KF8_TOUCH_CH_EN+0)
	MOV R1, # high (__KF8_TOUCH_CH_EN+0)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL _CTCTL
	ORL _CTCTL,R0
	MOV R0,#0x02
	DECJZ R0
	JMP $-1
Start_First_CT:
	BANKSEL _CTCTL
	SET _CTCTL,6 ;
	NOP
	JB _CTCTL,6
	JMP $-3
	JNB _CTCTL,4
	CLR _T1U ;
	
;	op : =
;	.line	916; "../kf8spsw_lib_touch_lib.c"	PUIE = 1;
	SET	_INTCTL_bits, 6
;	op : =
;	.line	917; "../kf8spsw_lib_touch_lib.c"	AIE = 1;
	SET	_INTCTL_bits, 7
;	op : LABEL
;	op : ENDFUNCTION
	CRET	
; exit point of __KF8spsw_LIBf_init_touch_



func.__KF8spsw_Lib_DateChange_get_	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  __KF8spsw_Lib_DateChange_get_	;Function start
; 2 exit points
;has an exit
;functions called:
;   __divuint
;   __divuint
;5 compiler assigned registers:
;   STK02
;   STK01
;   STK00
;   r0x1019
;   r0x101A
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
__KF8spsw_Lib_DateChange_get_	;Function start
; 2 exit points
;	op : INLINEASM
	BANKSEL __KF8_Temp_Cur_B_SW_
	MOV R0,__KF8_Temp_Cur_B_SW_
	BANKSEL __KF8_Temp_Cur_A_SW_
	SUB __KF8_Temp_Cur_A_SW_,R0
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	BANKSEL __KF8_Temp_Cur_B_SW_
	MOV R1,(__KF8_Temp_Cur_B_SW_+1)
	JB PSW,0
	INC R1
	BANKSEL __KF8_Temp_Cur_A_SW_
	SUB (__KF8_Temp_Cur_A_SW_+1),R1
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	JNB PSW,0
	JMP label_4_4_4
	;;
	BANKSEL __KF8_Touch_Bits_
	CLR __KF8_Touch_Bits_, 2
	BANKSEL __KF8_Temp_Cur_A_SW_
	CPL __KF8_Temp_Cur_A_SW_
	CPL (__KF8_Temp_Cur_A_SW_+1)
	INC __KF8_Temp_Cur_A_SW_
	JNB PSW,2
	INC (__KF8_Temp_Cur_A_SW_+1)
	JMP label_5_5_5
label_4_4_4:
	;;
	BANKSEL __KF8_Touch_Bits_
	SET __KF8_Touch_Bits_, 2
label_5_5_5:
	
;	op : BITWISEAND
;	.line	714; "../kf8spsw_lib_touch_lib.c"	if(_KF8_Temp_Cur_A_SW_<1024)  // 误差过大时直接认为按键有效类，固定变化率为大，否则按公式存在溢出风险
	BANKSEL	__KF8_Temp_Cur_A_SW_
	MOVZ	R0, (__KF8_Temp_Cur_A_SW_ + 1)
	AND	R0,# 0xfc
	JB	PSW, 2
	JMP	_00038_DS_
;	op : INLINEASM
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	BANKSEL __KF8_Temp_Cur_A_SW_
	MOV R0,# 0x06
	INC R0
	JMP Mul_64_Flag_1
Mul_2_DO_1:
	CLR PSW, 0
	RLC __KF8_Temp_Cur_A_SW_
	RLC (__KF8_Temp_Cur_A_SW_ + 1)
Mul_64_Flag_1:
	DECJZ R0
	JMP Mul_2_DO_1
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	MOV R0,# 0x08
	BANKSEL __KF8_Temp_Cur_B_SW_
	ADD __KF8_Temp_Cur_B_SW_, R0
	JNB PSW, 0
	INC (__KF8_Temp_Cur_B_SW_ + 1)
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
get_lable_001:
	MOV R0,# 0x04
	INC R0
	JMP Div_16_DO_1
Div_2_DO_1:
	CLR PSW, 0
	RRC (__KF8_Temp_Cur_B_SW_ + 1)
	RRC __KF8_Temp_Cur_B_SW_
Div_16_DO_1:
	DECJZ R0
	JMP Div_2_DO_1
	
;	op : GOTO
;	.line	754; "../kf8spsw_lib_touch_lib.c"	if(1);// 标号定位的冗余代码，由编译器优化掉同时简化嵌汇编逻辑
	JMP	_00039_DS_
;	op : LABEL
;	op : <
;unsigned compare: left < lit(0x3E80=16000), size=2
_00038_DS_
;	.line	757; "../kf8spsw_lib_touch_lib.c"	else if(_KF8_Temp_Cur_A_SW_<16000)
	MOV	R0,# 0x3e
	BANKSEL	__KF8_Temp_Cur_A_SW_
	SUB	R0, (__KF8_Temp_Cur_A_SW_ + 1)
;comparing bytes at offset 1
	JB	PSW, 2
	JMP	_00046_DS_
	MOV	R0,# 0x80
	BANKSEL	__KF8_Temp_Cur_A_SW_
	SUB	R0, __KF8_Temp_Cur_A_SW_
_00046_DS_
	JNB	PSW, 0
	JMP	_00035_DS_
;	op : INLINEASM
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	BANKSEL __KF8_Temp_Cur_A_SW_
	MOV R0,# 0x02
	INC R0
	JMP Mul_64_Flag_2
Mul_2_DO_2:
	CLR PSW, 0
	RLC __KF8_Temp_Cur_A_SW_
	RLC (__KF8_Temp_Cur_A_SW_ + 1)
Mul_64_Flag_2:
	DECJZ R0
	JMP Mul_2_DO_2
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	MOV R0,# 0x80
	BANKSEL __KF8_Temp_Cur_B_SW_
	ADD __KF8_Temp_Cur_B_SW_, R0
	JNB PSW, 0
	INC (__KF8_Temp_Cur_B_SW_ + 1)
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
get_lable_002:
	MOV R0,(__KF8_Temp_Cur_B_SW_+1)
	MOV __KF8_Temp_Cur_B_SW_,R0
	CLR (__KF8_Temp_Cur_B_SW_+1)
	
;	op : GOTO
;	.line	789; "../kf8spsw_lib_touch_lib.c"	if(1);// 标号定位的冗余代码，由编译器优化掉同时简化嵌汇编逻辑
	JMP	_00039_DS_
;	op : LABEL
;	op : INLINEASM
_00035_DS_
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	BANKSEL __KF8_Temp_Cur_A_SW_
	CLR PSW, 0
	RLC __KF8_Temp_Cur_A_SW_
	RLC (__KF8_Temp_Cur_A_SW_ + 1)
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	MOV R0,# 0x01
	BANKSEL __KF8_Temp_Cur_B_SW_
	ADD (__KF8_Temp_Cur_B_SW_+1), R0
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	CLR PSW, 0
	MOV R0,(__KF8_Temp_Cur_B_SW_+1)
	RRC R0
	MOV __KF8_Temp_Cur_B_SW_,R0
	CLR (__KF8_Temp_Cur_B_SW_+1)
	
;	op : LABEL
;	op : SEND
;	op : SEND
;	op : CALL
_00039_DS_
;	.line	832; "../kf8spsw_lib_touch_lib.c"	_KF8_lib_bahualvtemportemp_SW_=_KF8_Temp_Cur_A_SW_/_KF8_Temp_Cur_B_SW_;
	BANKSEL	__KF8_Temp_Cur_B_SW_
	MOVZ	R0, __KF8_Temp_Cur_B_SW_
	BANKSEL	STK02
	MOV	STK02, R0
	BANKSEL	__KF8_Temp_Cur_B_SW_
	MOVZ	R0, (__KF8_Temp_Cur_B_SW_ + 1)
	BANKSEL	STK01
	MOV	STK01, R0
	BANKSEL	__KF8_Temp_Cur_A_SW_
	MOVZ	R0, __KF8_Temp_Cur_A_SW_
	BANKSEL	STK00
	MOV	STK00, R0
	BANKSEL	__KF8_Temp_Cur_A_SW_
	MOVZ	R0, (__KF8_Temp_Cur_A_SW_ + 1)
	PAGESEL	__divuint
	CALL	__divuint
	PAGESEL	$
	BANKSEL	r0x1019
	MOV	r0x1019, R0
	BANKSEL	STK00
	MOVZ	R0, STK00
	BANKSEL	__KF8_lib_bahualvtemportemp_SW_
	MOV	__KF8_lib_bahualvtemportemp_SW_, R0
;;1	MOV	r0x101A, R0
;	op : CAST
;;99	MOVZ	R0, r0x101A
	BANKSEL	r0x1019
	MOVZ	R0, r0x1019
	BANKSEL	__KF8_lib_bahualvtemportemp_SW_
	MOV	(__KF8_lib_bahualvtemportemp_SW_ + 1), R0
;	op : INLINEASM
	BANKSEL __KF8_Touch_Bits_
	JB __KF8_Touch_Bits_,2 ;
	JMP ABS_CHANGE_END_1
	BANKSEL __KF8_lib_bahualvtemportemp_SW_
	CPL __KF8_lib_bahualvtemportemp_SW_
	CPL (__KF8_lib_bahualvtemportemp_SW_+1)
	INC __KF8_lib_bahualvtemportemp_SW_
	JNB PSW,2
	INC (__KF8_lib_bahualvtemportemp_SW_+1)
ABS_CHANGE_END_1:
	
;	op : LABEL
;	op : ENDFUNCTION
;	.line	853; "../kf8spsw_lib_touch_lib.c"	if(1);
	CRET	
; exit point of __KF8spsw_Lib_DateChange_get_



func.__KF8spsw_Lib_BaseLine_Reget_	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  __KF8spsw_Lib_BaseLine_Reget_	;Function start
; 2 exit points
;has an exit
;functions called:
;   __mulint
;   __mulint
;3 compiler assigned registers:
;   STK02
;   STK01
;   STK00
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
__KF8spsw_Lib_BaseLine_Reget_	;Function start
; 2 exit points
;	op : INLINEASM
	BANKSEL _ii_buf_SW_
	CLR _ii_buf_SW_
	;;-----------------------------
FOR_NEXT_DO_IN_Scan_1:
	MOV R1,# high (_CHS_AMOUNT+0)
	MOV R0,# low (_CHS_AMOUNT+0)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL _ii_buf_SW_
	MOV R1,_ii_buf_SW_
	SUB R0,R1 ;
	JNB PSW,0 ;
	JMP FOR_NEXT_DO_IN_Scan_End
	;;-----------------------------
	
;	op : INLINEASM
	MOV R1,# high (__KF8_Inside_Reference_Channel_Order+0)
	MOV R0,# low (__KF8_Inside_Reference_Channel_Order+0)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	BANKSEL _ii_buf_SW_
	XOR R0,_ii_buf_SW_
	JNB PSW,2
	JMP FOR_DO_IN_Scan_End
	
;	op : INLINEASM
	;;------------------------------------
	CLR PSW,0
	RLCR _ii_buf_SW_
	BANKSEL _Date_Save_Buf_SW_
	MOV _Date_Save_Buf_SW_,R0 ;
	;;-------------------------------------
	ADD R0,#(__KF8_LIBi_buff_refline_)
	BANKSEL __KF8_LIBi_buff_refline_
	LD R1,[R0]
	BANKSEL __KF8_Temp_Cur_B_SW_
	MOV __KF8_Temp_Cur_B_SW_,R1
	INC R0
	BANKSEL __KF8_LIBi_buff_refline_
	LD R1,[R0]
	BANKSEL __KF8_Temp_Cur_B_SW_
	MOV (__KF8_Temp_Cur_B_SW_+1),R1 ;;
	;;------------------------------------
	MOV R0,#0x20
	ADD __KF8_Temp_Cur_B_SW_,R0
	JB PSW,0
	INC __KF8_Temp_Cur_B_SW_+1;
	MOV R0,#0x06 ;
	INC R0
	JMP DIV_64_Get_B_IN_Scan_001
DIV_64_Get_B_IN_Scan_002:
	CLR PSW,0
	RRC __KF8_Temp_Cur_B_SW_+1
	RRC __KF8_Temp_Cur_B_SW_
DIV_64_Get_B_IN_Scan_001:
	DECJZ R0
	JMP DIV_64_Get_B_IN_Scan_002 ;;
	
;	op : INLINEASM
	;;----------------------------------
	BANKSEL __KF8_Touch_Bits_
	CLR __KF8_Touch_Bits_,2 ;;
	BANKSEL __KF8_lib_bahualvtemportemp_SW_
	MOV R0,__KF8_lib_bahualvtemportemp_SW_
	MOV R1,__KF8_lib_bahualvtemportemp_SW_+1
	BANKSEL __KF8_Temp_Cur_A_SW_
	MOV __KF8_Temp_Cur_A_SW_,R0
	MOV __KF8_Temp_Cur_A_SW_+1,R1
	BANKSEL __KF8_lib_bahualvtemportemp_SW_
	JB __KF8_lib_bahualvtemportemp_SW_+1,7
	JMP ABS_GET_DO_END_IN_Scan_1
	;;
	BANKSEL __KF8_Touch_Bits_
	SET __KF8_Touch_Bits_,2 ;;
	BANKSEL __KF8_Temp_Cur_A_SW_
	CPL __KF8_Temp_Cur_A_SW_+1
	CPL __KF8_Temp_Cur_A_SW_
	INC __KF8_Temp_Cur_A_SW_
	JNB PSW,2
	INC __KF8_Temp_Cur_A_SW_+1
	;----------------------------------
ABS_GET_DO_END_IN_Scan_1:
	
;	op : SEND
;	op : SEND
;	op : CALL
;	.line	497; "../kf8spsw_lib_touch_lib.c"	_KF8_Temp_Cur_B_SW_*=_KF8_Temp_Cur_A_SW_;
	BANKSEL	__KF8_Temp_Cur_A_SW_
	MOVZ	R0, __KF8_Temp_Cur_A_SW_
	BANKSEL	STK02
	MOV	STK02, R0
	BANKSEL	__KF8_Temp_Cur_A_SW_
	MOVZ	R0, (__KF8_Temp_Cur_A_SW_ + 1)
	BANKSEL	STK01
	MOV	STK01, R0
	BANKSEL	__KF8_Temp_Cur_B_SW_
	MOVZ	R0, __KF8_Temp_Cur_B_SW_
	BANKSEL	STK00
	MOV	STK00, R0
	BANKSEL	__KF8_Temp_Cur_B_SW_
	MOVZ	R0, (__KF8_Temp_Cur_B_SW_ + 1)
	PAGESEL	__mulint
	CALL	__mulint
	PAGESEL	$
	BANKSEL	__KF8_Temp_Cur_B_SW_
	MOV	(__KF8_Temp_Cur_B_SW_ + 1), R0
	BANKSEL	STK00
	MOVZ	R0, STK00
	BANKSEL	__KF8_Temp_Cur_B_SW_
	MOV	__KF8_Temp_Cur_B_SW_, R0
;	op : INLINEASM
	BANKSEL __KF8_Temp_Cur_B_SW_
	MOV R0,#0x08
	ADD __KF8_Temp_Cur_B_SW_,R0 ;
	JNB PSW,0
	INC __KF8_Temp_Cur_B_SW_+1
	MOV R0,#0x04
	INC R0
	JMP Get_Base_DIV_16_DO_IN_Scan_1
Get_Base_DIV_16_DO_IN_Scan_2:
	CLR PSW,0
	RRC __KF8_Temp_Cur_B_SW_+1
	RRC __KF8_Temp_Cur_B_SW_
Get_Base_DIV_16_DO_IN_Scan_1:
	DECJZ R0
	JMP Get_Base_DIV_16_DO_IN_Scan_2 ;;
	
;	op : INLINEASM
	;
	CLR PSW,0
	BANKSEL _ii_buf_SW_
	RLCR _ii_buf_SW_
	BANKSEL _Date_Save_Buf_SW_
	MOV _Date_Save_Buf_SW_,R0 ;
	;;
	ADD R0,#(__KF8_LIBi_buff_refline_)
	BANKSEL __KF8_LIBi_buff_refline_
	LD R1,[R0]
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_
	ADD R0,#(__KF8_LIBi_buff_baseline_)
	BANKSEL __KF8_LIBi_buff_baseline_
	ST [R0],R1 ;;
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_
	ADD R0,#(__KF8_LIBi_buff_refline_+1)
	BANKSEL __KF8_LIBi_buff_refline_
	LD R1,[R0]
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_
	ADD R0,#(__KF8_LIBi_buff_baseline_+1)
	BANKSEL __KF8_LIBi_buff_baseline_
	ST [R0],R1 ;;
	;;----------------------------------------
	BANKSEL __KF8_Touch_Bits_
	JB __KF8_Touch_Bits_,2 ;;
	JMP Ref_Sub_Date_DO_IN_Scan_1
	;;
	DEC R0
	BANKSEL __KF8_LIBi_buff_baseline_
	LD R1,[R0]
	BANKSEL __KF8_Temp_Cur_B_SW_
	ADD R1,__KF8_Temp_Cur_B_SW_
	BANKSEL __KF8_LIBi_buff_baseline_
	ST [R0],R1 ;
	INC R0
	BANKSEL __KF8_LIBi_buff_baseline_
	LD R1,[R0]
	JNB PSW,0
	INC R1
	BANKSEL __KF8_Temp_Cur_B_SW_
	ADD R1,__KF8_Temp_Cur_B_SW_+1
	BANKSEL __KF8_LIBi_buff_baseline_
	ST [R0],R1 ;
	JMP FOR_DO_IN_Scan_End
	;;
Ref_Sub_Date_DO_IN_Scan_1:
	DEC R0
	BANKSEL _Date_Save_Buf_SW_
	MOV _Date_Save_Buf_SW_,R0;
	BANKSEL __KF8_LIBi_buff_baseline_
	LD R1,[R0]
	BANKSEL __KF8_Temp_Cur_B_SW_
	MOV R0,__KF8_Temp_Cur_B_SW_
	SUB R0,R1
	BANKSEL _Date_Save_Buf_SW_
	MOV R1,_Date_Save_Buf_SW_
	BANKSEL __KF8_LIBi_buff_baseline_
	ST [R1],R0
	INC R1
	LD R0,[R1]
	JB PSW,0
	DEC R0
	BANKSEL __KF8_Temp_Cur_B_SW_
	MOV R1,__KF8_Temp_Cur_B_SW_+1
	SUB R1,R0
	BANKSEL _Date_Save_Buf_SW_
	MOV R0,_Date_Save_Buf_SW_
	INC R0
	BANKSEL __KF8_LIBi_buff_baseline_
	ST [R0],R1 ;
	
;	op : INLINEASM
FOR_DO_IN_Scan_End:
	
;	op : INLINEASM
	;
	BANKSEL _ii_buf_SW_
	INC _ii_buf_SW_
	JMP FOR_NEXT_DO_IN_Scan_1
FOR_NEXT_DO_IN_Scan_End:
	
;	op : LABEL
;	op : ENDFUNCTION
;	.line	623; "../kf8spsw_lib_touch_lib.c"	if(1);
	CRET	
; exit point of __KF8spsw_Lib_BaseLine_Reget_



func.__KF8spsw_Lib_SET_MCU_Parameter	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  __KF8spsw_Lib_SET_MCU_Parameter	;Function start
; 2 exit points
;has an exit
;1 compiler assigned register :
;   r0x101C
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
__KF8spsw_Lib_SET_MCU_Parameter	;Function start
; 2 exit points
;	op : RECEIVE
;	.line	347; "../kf8spsw_lib_touch_lib.c"	void _KF8spsw_Lib_SET_MCU_Parameter(unsigned char parameterin)
	BANKSEL	r0x101C
	MOV	r0x101C, R0
;	op : >
;swapping arguments (AOP_TYPEs 1/2)
;unsigned compare: left >= lit(0x3=3), size=1
;	.line	349; "../kf8spsw_lib_touch_lib.c"	switch(parameterin)
	MOV	R0,# 0x03
	BANKSEL	r0x101C
	SUB	R0, r0x101C
;comparing bytes at offset 0
	JNB	PSW, 0
	JMP	_00027_DS_
;	op : JUMPTABLE
	MOV	R0,#high _00031_DS_
	MOV	PCH, R0
	MOV	R0,#_00031_DS_
	BANKSEL	r0x101C
	ADD	R0, r0x101C
	JNB	PSW, 0
	INC	PCH
	MOV	PCL, R0
_00031_DS_
	JMP	_00022_DS_
	JMP	_00023_DS_
	JMP	_00024_DS_
;	op : LABEL
;	op : =
_00022_DS_
;	.line	353; "../kf8spsw_lib_touch_lib.c"	_KF8_Touch_Bits_._KF8_Touch_Work_USE_PWM=0;
	BANKSEL	__KF8_Touch_Bits_
	CLR	__KF8_Touch_Bits_, 4
;	op : =
;	.line	354; "../kf8spsw_lib_touch_lib.c"	_KF8_Touch_Bits_._KF8_Touch_Work_PWM_IS_16bit=0;
	BANKSEL	__KF8_Touch_Bits_
	CLR	__KF8_Touch_Bits_, 5
;	op : GOTO
;	.line	355; "../kf8spsw_lib_touch_lib.c"	}break;
	JMP	_00027_DS_
;	op : LABEL
;	op : =
_00023_DS_
;	.line	358; "../kf8spsw_lib_touch_lib.c"	_KF8_Touch_Bits_._KF8_Touch_Work_USE_PWM=1;
	BANKSEL	__KF8_Touch_Bits_
	SET	__KF8_Touch_Bits_, 4
;	op : =
;	.line	359; "../kf8spsw_lib_touch_lib.c"	_KF8_Touch_Bits_._KF8_Touch_Work_PWM_IS_16bit=0;
	BANKSEL	__KF8_Touch_Bits_
	CLR	__KF8_Touch_Bits_, 5
;	op : GOTO
;	.line	360; "../kf8spsw_lib_touch_lib.c"	}break;
	JMP	_00027_DS_
;	op : LABEL
;	op : =
_00024_DS_
;	.line	363; "../kf8spsw_lib_touch_lib.c"	_KF8_Touch_Bits_._KF8_Touch_Work_USE_PWM=1;
	BANKSEL	__KF8_Touch_Bits_
	SET	__KF8_Touch_Bits_, 4
;	op : =
;	.line	364; "../kf8spsw_lib_touch_lib.c"	_KF8_Touch_Bits_._KF8_Touch_Work_PWM_IS_16bit=1;
	BANKSEL	__KF8_Touch_Bits_
	SET	__KF8_Touch_Bits_, 5
;	op : LABEL
;	op : ENDFUNCTION
_00027_DS_
;	.line	370; "../kf8spsw_lib_touch_lib.c"	}
	CRET	
; exit point of __KF8spsw_Lib_SET_MCU_Parameter



func._write_eep_tsw_	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _write_eep_tsw_	;Function start
; 2 exit points
;has an exit
;functions called:
;   _read_data_eep_tsw_check
;   _read_data_eep_tsw_check
;2 compiler assigned registers:
;   r0x1019
;   r0x101A
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
_write_eep_tsw_	;Function start
; 2 exit points
;	op : =
;	.line	258; "../kf8spsw_lib_touch_lib.c"	intctlbuf_SW_=INTCTL;
	MOVZ	R0, _INTCTL
	BANKSEL	_intctlbuf_SW_
	MOV	_intctlbuf_SW_, R0
;	op : =
;	.line	259; "../kf8spsw_lib_touch_lib.c"	oscctlbuf_SW_=OSCCTL;
	MOVZ	R0, _OSCCTL
	BANKSEL	_oscctlbuf_SW_
	MOV	_oscctlbuf_SW_, R0
;	op : INLINEASM
	BANKSEL _INTCTL
	CLR _INTCTL , _AIE
	CLR _INTCTL ,_PUIE
	JNB _INTCTL , _AIE
	JMP $-3
WRITE_EE_DO_DS_001:
	BANKSEL __KF8_Touch_Bits_
	SET __KF8_Touch_Bits_,6
	MOV R0 , #0x0F
	BANKSEL _BADDRH
	MOV _BADDRH , R0
	MOV R0 , #0xC0
	BANKSEL _BADDRL
	MOV _BADDRL , R0
	MOV R2 , #_Arr_erom_SW_
	
;	op : =
;	.line	282; "../kf8spsw_lib_touch_lib.c"	OSCCTL = 0x20;
	MOV	R0,# 0x20
	MOV	_OSCCTL, R0
;	op : INLINEASM
	NOP 
;	op : INLINEASM
	NOP 
;	op : =
;	.line	286; "../kf8spsw_lib_touch_lib.c"	for(i=0;i<12;i++)
	MOV	R0,# 0x0c
	BANKSEL	r0x101A
	MOV	r0x101A, R0
	BANKSEL	r0x1019
	MOV	r0x1019, R0
;	op : LABEL
;	op : INLINEASM
_00017_DS_
	BANKSEL _Arr_erom_SW_
	LD R0 , [ R2 ]
	MOV R6,R0
	INC R2
	BANKSEL _Arr_erom_SW_
	LD R0 , [ R2 ]
	INC R2
	MOV R7,R0
	MOV R5 , #0x84
	BANKSEL _EECTL1
	MOV _EECTL1 , R5
	MOV R5 , #0x69
	BANKSEL _EECTL2
	MOV _EECTL2 , R5
	MOV R5 , #0x96
	MOV _EECTL2 , R5
	BANKSEL _EECTL1
	SET _EECTL1 , 1
	.DW 0XFFFF
	.DW 0XFFFF
	.DW 0XFFFF
	.DW 0XFFFF
	.DW 0XFFFF
	.DW 0XFFFF
	.DW 0XFFFF
	.DW 0XFFFF
	.DW 0XFFFF
	.DW 0XFFFF
	.DW 0XFFFF
	.DW 0XFFFF
	MOV R5 , #0X80
	BANKSEL _EECTL1
	MOV _EECTL1,R5
	BANKSEL _BADDRL
	INC _BADDRL
	
;	op : CAST
;;100	MOVZ	R0, r0x1019
;	op : -
	BANKSEL	r0x101A
	DEC	r0x101A
;	op : CAST
	BANKSEL	r0x101A
	MOVZ	R0, r0x101A
	BANKSEL	r0x1019
	MOV	r0x1019, R0
;	op : IFX
;	.line	286; "../kf8spsw_lib_touch_lib.c"	for(i=0;i<12;i++)
	MOV	R0,# 0x00
	BANKSEL	r0x1019
	ORL	R0, r0x1019
	JB	PSW, 2
	JMP	_00017_DS_
;	op : CALL
;	.line	329; "../kf8spsw_lib_touch_lib.c"	read_data_eep_tsw_check();
	PAGESEL	_read_data_eep_tsw_check
	CALL	_read_data_eep_tsw_check
	PAGESEL	$
;	op : INLINEASM
	BANKSEL __KF8_Touch_Bits_
	JB __KF8_Touch_Bits_,6 ;;
	JMP WRITE_EE_DO_DS_001
	
;	op : =
;	.line	336; "../kf8spsw_lib_touch_lib.c"	OSCCTL = oscctlbuf_SW_;
	BANKSEL	_oscctlbuf_SW_
	MOVZ	R0, _oscctlbuf_SW_
	MOV	_OSCCTL, R0
;	op : INLINEASM
	NOP 
;	op : BITWISEAND
;	.line	338; "../kf8spsw_lib_touch_lib.c"	intctlbuf_SW_&=0xC0;
	MOV	R0,# 0xc0
	BANKSEL	_intctlbuf_SW_
	AND	_intctlbuf_SW_, R0
;	op : |
;	.line	339; "../kf8spsw_lib_touch_lib.c"	INTCTL|=intctlbuf_SW_;
	BANKSEL	_intctlbuf_SW_
	MOVZ	R0, _intctlbuf_SW_
	ORL	_INTCTL, R0
;	op : LABEL
;	op : ENDFUNCTION
	CRET	
; exit point of _write_eep_tsw_



func._read_data_eep_tsw_	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _read_data_eep_tsw_	;Function start
; 2 exit points
;has an exit
;functions called:
;   __R2PCL
;   _read_data_eep_tsw_check
;   __R2PCL
;   _read_data_eep_tsw_check
;2 compiler assigned registers:
;   r0x1019
;   r0x101A
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
_read_data_eep_tsw_	;Function start
; 2 exit points
;	op : =
;	.line	182; "../kf8spsw_lib_touch_lib.c"	intctlbuf_SW_=INTCTL;
	MOVZ	R0, _INTCTL
	BANKSEL	_intctlbuf_SW_
	MOV	_intctlbuf_SW_, R0
;	op : =
;	.line	183; "../kf8spsw_lib_touch_lib.c"	oscctlbuf_SW_=OSCCTL;
	MOVZ	R0, _OSCCTL
	BANKSEL	_oscctlbuf_SW_
	MOV	_oscctlbuf_SW_, R0
;	op : INLINEASM
	BANKSEL _INTCTL
	CLR _INTCTL,6
	CLR _INTCTL, 7
	JNB _INTCTL, 7
	JMP $-3
READ_EE_DO_DS_001:
	BANKSEL __KF8_Touch_Bits_
	SET __KF8_Touch_Bits_,6
	;;
	MOV R0,#0X0F ;BLOCK EEPROM首地址为
	BANKSEL BADDRH
	MOV BADDRH,R0 ;
	MOV R0,#0XC0 ;
	BANKSEL BADDRL
	MOV BADDRL,R0 ;
	NOP
	;;
	MOV R2 , #_Arr_erom_SW_
	
;	op : =
;	.line	210; "../kf8spsw_lib_touch_lib.c"	OSCCTL=0x20;
	MOV	R0,# 0x20
	MOV	_OSCCTL, R0
;	op : INLINEASM
	NOP 
;	op : INLINEASM
	NOP 
;	op : =
;	.line	214; "../kf8spsw_lib_touch_lib.c"	for(i=0;i<CHS_AMOUNT;i++)
	BANKSEL	r0x1019
	CLR	r0x1019
;	op : LABEL
;	op : =
;gen_assign from CODESPACE
_00005_DS_
	MOV	R1,# high (_CHS_AMOUNT+0)
	MOV	R0,# low (_CHS_AMOUNT+0)
	PAGESEL	__R2PCL
	CALL	__R2PCL
	PAGESEL	$
	BANKSEL	r0x101A
	MOV	r0x101A, R0
;	op : <
	BANKSEL	r0x101A
	MOVZ	R0, r0x101A
	BANKSEL	r0x1019
	SUB	R0, r0x1019
;comparing bytes at offset 0
	JNB	PSW, 0
	JMP	_00008_DS_
;	op : INLINEASM
	MOV R0,#0x81
	BANKSEL _EECTL1
	MOV _EECTL1,R0
	.DW 0XFFFF
	.DW 0XFFFF
	.DW 0XFFFF
	.DW 0XFFFF
	MOV R0,R6
	BANKSEL _Arr_erom_SW_
	ST [R2] , R0
	INC R2
	MOV R0,R7
	BANKSEL _Arr_erom_SW_
	ST [R2] , R0
	INC R2
	BANKSEL _BADDRL
	INC _BADDRL
	
;	op : +
;	.line	214; "../kf8spsw_lib_touch_lib.c"	for(i=0;i<CHS_AMOUNT;i++)
	BANKSEL	r0x1019
	INC	r0x1019
;	op : GOTO
	JMP	_00005_DS_
;	op : LABEL
;	op : CALL
_00008_DS_
;	.line	240; "../kf8spsw_lib_touch_lib.c"	read_data_eep_tsw_check();
	PAGESEL	_read_data_eep_tsw_check
	CALL	_read_data_eep_tsw_check
	PAGESEL	$
;	op : INLINEASM
	BANKSEL __KF8_Touch_Bits_
	JB __KF8_Touch_Bits_,6 ;;
	JMP READ_EE_DO_DS_001
	
;	op : =
;	.line	248; "../kf8spsw_lib_touch_lib.c"	OSCCTL = oscctlbuf_SW_;
	BANKSEL	_oscctlbuf_SW_
	MOVZ	R0, _oscctlbuf_SW_
	MOV	_OSCCTL, R0
;	op : INLINEASM
	NOP 
;	op : BITWISEAND
;	.line	250; "../kf8spsw_lib_touch_lib.c"	intctlbuf_SW_&=0xC0;
	MOV	R0,# 0xc0
	BANKSEL	_intctlbuf_SW_
	AND	_intctlbuf_SW_, R0
;	op : |
;	.line	251; "../kf8spsw_lib_touch_lib.c"	INTCTL|=intctlbuf_SW_;
	BANKSEL	_intctlbuf_SW_
	MOVZ	R0, _intctlbuf_SW_
	ORL	_INTCTL, R0
;	op : LABEL
;	op : ENDFUNCTION
	CRET	
; exit point of _read_data_eep_tsw_



func._read_data_eep_tsw_check	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  _read_data_eep_tsw_check	;Function start
; 2 exit points
;has an exit
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
_read_data_eep_tsw_check	;Function start
; 2 exit points
;	op : INLINEASM
	MOV R0,#0X0F ;BLOCK EEPROM首地址为
	BANKSEL BADDRH
	MOV BADDRH,R0 ;
	MOV R0,#0XC0 ;
	BANKSEL BADDRL
	MOV BADDRL,R0 ;
	NOP
	MOV R2 , #_Arr_erom_SW_Check
	
;	op : INLINEASM
	MOV R1,#high(_CHS_AMOUNT+0)
	MOV R0,#low(_CHS_AMOUNT+0)
	PAGESEL __R2PCHPCL_SW_
	CALL __R2PCHPCL_SW_
	PAGESEL $
	MOV R5,R0 ;
	MOV R4,R0 ;
	
;	op : INLINEASM
DO_CHECK_IN_READ:
	MOV R0,#0x81
	BANKSEL _EECTL1
	MOV _EECTL1,R0
	.DW 0XFFFF
	.DW 0XFFFF
	MOV R0,R6
	BANKSEL _Arr_erom_SW_Check
	ST [R2] , R0
	INC R2
	MOV R0,R7
	BANKSEL _Arr_erom_SW_Check
	ST [R2] , R0
	INC R2
	BANKSEL _BADDRL
	INC _BADDRL
	DECJZ R5
	JMP DO_CHECK_IN_READ
	
;	op : INLINEASM
	MOV R2,#_Arr_erom_SW_
	MOV R3,#_Arr_erom_SW_Check
DO_CHECK_IN_CHECK:
	BANKSEL _Arr_erom_SW_Check
	MOV R1 ,R3
	LD R0,[R1]
	MOV R5,R0
	BANKSEL _Arr_erom_SW_
	MOV R1,R2
	LD R0,[R1]
	XOR R0,R5
	JNB PSW,2
	JMP DO_CHECK_High
	BANKSEL __KF8_Touch_Bits_
	CLR __KF8_Touch_Bits_,6 ;;
DO_CHECK_High:
	INC R2
	INC R3
	BANKSEL _Arr_erom_SW_Check
	MOV R1 ,R3
	LD R0,[R1]
	MOV R5,R0
	BANKSEL _Arr_erom_SW_
	MOV R1,R2
	LD R0,[R1]
	XOR R0,R5
	JNB PSW,2
	JMP DO_CHECK_NEXT
	BANKSEL __KF8_Touch_Bits_
	CLR __KF8_Touch_Bits_,6 ;;
	;;
DO_CHECK_NEXT:
	INC R2
	INC R3
	DECJZ R4
	JMP DO_CHECK_IN_CHECK
	
;	op : LABEL
;	op : ENDFUNCTION
	CRET	
; exit point of _read_data_eep_tsw_check



func.__R2PCHPCL_SW_	.code
;***
;  PostBlock Stats: dbName = C
;***
;entry:  __R2PCHPCL_SW_	;Function start
; 2 exit points
;has an exit
;; Starting PostCode block
;	op : LABEL
;	op : FUNCTION
__R2PCHPCL_SW_	;Function start
; 2 exit points
;	op : INLINEASM
	MOV PCH,R1
	MOV PCL,R0
	
;	op : LABEL
;	op : ENDFUNCTION
	CRET	
; exit point of __R2PCHPCL_SW_


;	code size estimation:
;	  214+   82 =   296 instructions (  756 byte)


	.end
