📄 stm8_tsl_singlechannelkey.ls
字号:
562 0148 81 ret
591 ; 423 void TSL_SCKey_PreDetectTreatment(void)
591 ; 424 {
592 switch .text
593 0149 _TSL_SCKey_PreDetectTreatment:
597 ; 428 if ((pKeyStruct->Channel.LastMeasRejectNb <= MAX_REJECTED_MEASUREMENTS) &&
597 ; 429 (Delta >= pKeyStruct->DetectThreshold))
599 0149 be00 ldw x,_pKeyStruct
600 014b 6d07 tnz (7,x)
601 014d 2621 jrne L361
603 014f 9c rvf
604 0150 be00 ldw x,_pKeyStruct
605 0152 e60c ld a,(12,x)
606 0154 5f clrw x
607 0155 4d tnz a
608 0156 2a01 jrpl L62
609 0158 53 cplw x
610 0159 L62:
611 0159 97 ld xl,a
612 015a b300 cpw x,_Delta
613 015c 2c12 jrsgt L361
614 ; 442 TSL_SCKey_DxS();
616 015e cd0000 call _TSL_SCKey_DxS
618 ; 443 pKeyStruct->Channel.IntegratorCounter--;
620 0161 be00 ldw x,_pKeyStruct
621 0163 6a0a dec (10,x)
622 ; 444 if (!pKeyStruct->Channel.IntegratorCounter)
624 0165 be00 ldw x,_pKeyStruct
625 0167 6d0a tnz (10,x)
626 0169 2609 jrne L761
627 ; 446 TSL_SCKey_SetDetectedState();
629 016b cd0000 call _TSL_SCKey_SetDetectedState
631 016e 2004 jra L761
632 0170 L361:
633 ; 451 TSL_SCKey_BackToIdleState();
635 0170 cd0000 call _TSL_SCKey_BackToIdleState
637 ; 452 return;
640 0173 81 ret
641 0174 L761:
642 ; 454 }
645 0174 81 ret
675 ; 467 void TSL_SCKey_DetectedTreatment(void)
675 ; 468 {
676 switch .text
677 0175 _TSL_SCKey_DetectedTreatment:
681 ; 471 if ((pKeyStruct->Channel.LastMeasRejectNb <= MAX_REJECTED_MEASUREMENTS) &&
681 ; 472 (Delta <= pKeyStruct->EndDetectThreshold))
683 0175 be00 ldw x,_pKeyStruct
684 0177 6d07 tnz (7,x)
685 0179 261d jrne L102
687 017b 9c rvf
688 017c be00 ldw x,_pKeyStruct
689 017e e60d ld a,(13,x)
690 0180 5f clrw x
691 0181 4d tnz a
692 0182 2a01 jrpl L23
693 0184 53 cplw x
694 0185 L23:
695 0185 97 ld xl,a
696 0186 b300 cpw x,_Delta
697 0188 2f0e jrslt L102
698 ; 487 TSL_SCKey_SetPostDetectState();
700 018a cd0000 call _TSL_SCKey_SetPostDetectState
702 ; 488 if (!EndDetectionIntegrator)
704 018d 3d00 tnz _EndDetectionIntegrator
705 018f 2606 jrne L302
706 ; 490 pKeyStruct->Channel.IntegratorCounter++;
708 0191 be00 ldw x,_pKeyStruct
709 0193 6c0a inc (10,x)
710 ; 491 TSL_SCKey_PostDetectTreatment();
712 0195 ad05 call _TSL_SCKey_PostDetectTreatment
714 0197 L302:
715 ; 493 return;
718 0197 81 ret
719 0198 L102:
720 ; 496 TSL_SCKey_DetectionTimeout();
722 0198 cd0000 call _TSL_SCKey_DetectionTimeout
724 ; 497 }
727 019b 81 ret
755 ; 510 void TSL_SCKey_PostDetectTreatment(void)
755 ; 511 {
756 switch .text
757 019c _TSL_SCKey_PostDetectTreatment:
761 ; 514 if ((pKeyStruct->Channel.LastMeasRejectNb <= MAX_REJECTED_MEASUREMENTS) &&
761 ; 515 (Delta <= pKeyStruct->EndDetectThreshold))
763 019c be00 ldw x,_pKeyStruct
764 019e 6d07 tnz (7,x)
765 01a0 261e jrne L512
767 01a2 9c rvf
768 01a3 be00 ldw x,_pKeyStruct
769 01a5 e60d ld a,(13,x)
770 01a7 5f clrw x
771 01a8 4d tnz a
772 01a9 2a01 jrpl L63
773 01ab 53 cplw x
774 01ac L63:
775 01ac 97 ld xl,a
776 01ad b300 cpw x,_Delta
777 01af 2f0f jrslt L512
778 ; 530 pKeyStruct->Channel.IntegratorCounter--;
780 01b1 be00 ldw x,_pKeyStruct
781 01b3 6a0a dec (10,x)
782 ; 531 if (!pKeyStruct->Channel.IntegratorCounter)
784 01b5 be00 ldw x,_pKeyStruct
785 01b7 6d0a tnz (10,x)
786 01b9 2608 jrne L122
787 ; 533 TSL_SCKey_SetIdleState();
789 01bb cd0000 call _TSL_SCKey_SetIdleState
791 01be 2003 jra L122
792 01c0 L512:
793 ; 539 TSL_SCKey_BackToDetectedState();
795 01c0 cd0000 call _TSL_SCKey_BackToDetectedState
797 01c3 L122:
798 ; 541 }
801 01c3 81 ret
829 ; 554 void TSL_SCKey_PreRecalibrationTreatment(void)
829 ; 555 {
830 switch .text
831 01c4 _TSL_SCKey_PreRecalibrationTreatment:
835 ; 557 if ((pKeyStruct->Channel.LastMeasRejectNb <= MAX_REJECTED_MEASUREMENTS) &&
835 ; 558 (Delta <= pKeyStruct->RecalibrationThreshold))
837 01c4 be00 ldw x,_pKeyStruct
838 01c6 6d07 tnz (7,x)
839 01c8 261e jrne L332
841 01ca 9c rvf
842 01cb be00 ldw x,_pKeyStruct
843 01cd e60e ld a,(14,x)
844 01cf 5f clrw x
845 01d0 4d tnz a
846 01d1 2a01 jrpl L24
847 01d3 53 cplw x
848 01d4 L24:
849 01d4 97 ld xl,a
850 01d5 b300 cpw x,_Delta
851 01d7 2f0f jrslt L332
852 ; 563 pKeyStruct->Channel.IntegratorCounter--;
854 01d9 be00 ldw x,_pKeyStruct
855 01db 6a0a dec (10,x)
856 ; 564 if (!pKeyStruct->Channel.IntegratorCounter)
858 01dd be00 ldw x,_pKeyStruct
859 01df 6d0a tnz (10,x)
860 01e1 2608 jrne L732
861 ; 566 TSL_SCKey_SetCalibrationState();
863 01e3 cd0000 call _TSL_SCKey_SetCalibrationState
865 01e6 2003 jra L732
866 01e8 L332:
867 ; 571 TSL_SCKey_BackToIdleState();
869 01e8 cd0000 call _TSL_SCKey_BackToIdleState
871 01eb L732:
872 ; 573 }
875 01eb 81 ret
901 ; 586 void TSL_SCKey_CalibrationTreatment(void)
901 ; 587 {
902 switch .text
903 01ec _TSL_SCKey_CalibrationTreatment:
907 ; 589 if (pKeyStruct->Channel.LastMeasRejectNb <= MAX_REJECTED_MEASUREMENTS)
909 01ec be00 ldw x,_pKeyStruct
910 01ee 6d07 tnz (7,x)
911 01f0 262e jrne L152
912 ; 592 pKeyStruct->Channel.Reference += pKeyStruct->Channel.LastMeas;
914 01f2 be00 ldw x,_pKeyStruct
915 01f4 90be00 ldw y,_pKeyStruct
916 01f7 90ee05 ldw y,(5,y)
917 01fa 90bf00 ldw c_y,y
918 01fd 9093 ldw y,x
919 01ff 90ee08 ldw y,(8,y)
920 0202 72b90000 addw y,c_y
921 0206 ef08 ldw (8,x),y
922 ; 593 pKeyStruct->Counter--;
924 0208 be00 ldw x,_pKeyStruct
925 020a 6a03 dec (3,x)
926 ; 594 if (!pKeyStruct->Counter)
928 020c be00 ldw x,_pKeyStruct
929 020e 6d03 tnz (3,x)
930 0210 260e jrne L152
931 ; 597 pKeyStruct->Channel.Reference = (pKeyStruct->Channel.Reference >> 3);
933 0212 be00 ldw x,_pKeyStruct
934 0214 a603 ld a,#3
935 0216 L64:
936 0216 6408 srl (8,x)
937 0218 6609 rrc (9,x)
938 021a 4a dec a
939 021b 26f9 jrne L64
940 ; 598 TSL_SCKey_SetIdleState();
942 021d cd0000 call _TSL_SCKey_SetIdleState
944 0220 L152:
945 ; 601 }
948 0220 81 ret
974 ; 614 void TSL_SCKey_CheckDisabled(void)
974 ; 615 {
975 switch .text
976 0221 _TSL_SCKey_CheckDisabled:
980 ; 616 if (!pKeyStruct->Setting.b.ENABLED)
982 0221 be00 ldw x,_pKeyStruct
983 0223 e602 ld a,(2,x)
984 0225 a502 bcp a,#2
985 0227 2603 jrne L562
986 ; 618 TSL_SCKey_SetDisabledState();
988 0229 cd0000 call _TSL_SCKey_SetDisabledState
990 022c L562:
991 ; 620 }
994 022c 81 ret
1020 ; 633 void TSL_SCKey_CheckEnabled(void)
1020 ; 634 {
1021 switch .text
1022 022d _TSL_SCKey_CheckEnabled:
1026 ; 635 if (pKeyStruct->Setting.b.ENABLED && pKeyStruct->Setting.b.IMPLEMENTED)
1028 022d be00 ldw x,_pKeyStruct
1029 022f e602 ld a,(2,x)
1030 0231 a502 bcp a,#2
1031 0233 270b jreq L772
1033 0235 be00 ldw x,_pKeyStruct
1034 0237 e602 ld a,(2,x)
1035 0239 a501 bcp a,#1
1036 023b 2703 jreq L772
1037 ; 637 TSL_SCKey_SetCalibrationState();
1039 023d cd0000 call _TSL_SCKey_SetCalibrationState
1041 0240 L772:
1042 ; 639 }
1045 0240 81 ret
1070 ; 652 u8 TSL_SCKey_CheckErrorCondition(void)
1070 ; 653 {
1071 switch .text
1072 0241 _TSL_SCKey_CheckErrorCondition:
1076 ; 654 if ((pKeyStruct->Channel.LastMeas < SCKEY_MIN_ACQUISITION)
1076 ; 655 || (pKeyStruct->Channel.LastMeas > SCKEY_MAX_ACQUISITION))
1078 0241 be00 ldw x,_pKeyStruct
1079 0243 e606 ld a,(6,x)
1080 0245 ea05 or a,(5,x)
1081 0247 270d jreq L313
1083 0249 be00 ldw x,_pKeyStruct
1084 024b 9093 ldw y,x
1085 024d 90ee05 ldw y,(5,y)
1086 0250 90a31771 cpw y,#6001
1087 0254 2503 jrult L113
1088 0256 L313:
1089 ; 657 return 0xFF; // Error case !
1091 0256 a6ff ld a,#255
1094 0258 81 ret
1095 0259 L113:
1096 ; 660 return 0;
1098 0259 4f clr a
1101 025a 81 ret
1114 xref _TSL_SCKey_DetectionTimeout
1115 xref _TSL_SCKey_DxS
1116 xref _TSL_SCKey_SetDisabledState
1117 xref _TSL_SCKey_SetErrorState
1118 xref _TSL_SCKey_SetCalibrationState
1119 xref _TSL_SCKey_SetPreRecalibrationState
1120 xref _TSL_SCKey_BackToDetectedState
1121 xref _TSL_SCKey_SetPostDetectState
1122 xref _TSL_SCKey_SetDetectedState
1123 xref _TSL_SCKey_SetPreDetectState
1124 xref _TSL_SCKey_BackToIdleState
1125 xref _TSL_SCKey_SetIdleState
1126 xref _TSL_DeltaCalculation
1127 xref _TSL_SetStructPointer
1128 xref.b _TSL_TempGlobalState
1129 xref.b _TSL_TempGlobalSetting
1130 xref.b _Delta
1131 xref.b _KeyIndex
1132 xref _TSL_IO_Acquisition
1133 xref _Table_SCKEY_BITS
1134 xref.b _sTouchIO
1135 xref.b _EndDetectionIntegrator
1136 xref.b _DetectionIntegrator
1137 xref.b _sSCKeyInfo
1138 xref.b _pKeyStruct
1139 xdef _TSL_SCKey_CheckErrorCondition
1140 xdef _TSL_SCKey_CheckEnabled
1141 xdef _TSL_SCKey_CheckDisabled
1142 xdef _TSL_SCKey_CalibrationTreatment
1143 xdef _TSL_SCKey_PreRecalibrationTreatment
1144 xdef _TSL_SCKey_PostDetectTreatment
1145 xdef _TSL_SCKey_DetectedTreatment
1146 xdef _TSL_SCKey_PreDetectTreatment
1147 xdef _TSL_SCKey_IdleTreatment
1148 xdef _TSL_SCKey_Process
1149 xdef _TSL_SCKEY_P1_Acquisition
1150 xdef _TSL_SCKey_Init
1151 xref.b c_y
1170 end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -