///////////////////////////////////////////////////////////////////////////////
//
// IAR C/C++ Compiler V2.10.4.157 for STM8                10/Aug/2020  13:50:19
// Copyright 2010-2015 IAR Systems AB.
//
//    Source file  =  F:\2-Lora\Code\stm8l151K6T6-WLAN\USER\protools.c
//    Command line =  
//        F:\2-Lora\Code\stm8l151K6T6-WLAN\USER\protools.c -e -Ol --no_cse
//        --no_unroll --no_inline --no_code_motion --no_tbaa --no_cross_call
//        --debug --code_model small --data_model medium -o
//        F:\2-Lora\Code\stm8l151K6T6-WLAN\Debug\Obj\ --dlib_config
//        E:\IAR\stm8\LIB\dlstm8smf.h -lB
//        F:\2-Lora\Code\stm8l151K6T6-WLAN\Debug\List\ -I
//        F:\2-Lora\Code\stm8l151K6T6-WLAN\FWLIB\inc\ -I
//        F:\2-Lora\Code\stm8l151K6T6-WLAN\FWLIB\src\ -I
//        F:\2-Lora\Code\stm8l151K6T6-WLAN\USER\ -I
//        F:\2-Lora\Code\stm8l151K6T6-WLAN\BSP\ -I
//        F:\2-Lora\Code\stm8l151K6T6-WLAN\radio\ -I
//        F:\2-Lora\Code\stm8l151K6T6-WLAN\SX1278\ --vregs 16
//    List file    =  F:\2-Lora\Code\stm8l151K6T6-WLAN\Debug\List\protools.s
//
///////////////////////////////////////////////////////////////////////////////

        EXTERN ?b0
        EXTERN ?b1
        EXTERN ?b10
        EXTERN ?b2
        EXTERN ?b8
        EXTERN ?epilogue_w4
        EXTERN ?move1616_v_x_y_a
        EXTERN ?push_w4
        EXTERN ?w0
        EXTERN ?w1
        EXTERN ?w4
        EXTERN BeepStart
        EXTERN BeepStop
        EXTERN CarAction
        EXTERN FixedParaChange
        EXTERN GPIO_ReadInputDataBit
        EXTERN LockCarState
        EXTERN QMC5883LStr
        EXTERN SX78Str
        EXTERN SystemPara
        EXTERN UserBeep
        EXTERN bsp_beep_one
        EXTERN get_photoresistor_ad
        EXTERN memcpy
        EXTERN memset

        PUBLIC CarRecDataStr
        PUBLIC CmdDeal
        PUBLIC CycleDetection
        PUBLIC CycleDetectionTime
        PUBLIC SendData
        PUBLIC SingalCheck

// F:\2-Lora\Code\stm8l151K6T6-WLAN\USER\protools.c
//    1 #include "protools.h"

        SECTION `.near.bss`:DATA:REORDER:NOROOT(0)
//    2 struct CAR_DATA_STR CarRecDataStr = {0};
CarRecDataStr:
        DS8 64

        SECTION `.near.bss`:DATA:REORDER:NOROOT(0)
//    3 uint8_t CycleDetectionTime = 0;
CycleDetectionTime:
        DS8 1

        SECTION `.near_func.text`:CODE:REORDER:NOROOT(0)
        CODE
//    4 enum SIGNAL_STATE SingalCheck(void)
//    5 {
SingalCheck:
        SUB       SP, #0x1c
//    6     u8 reccs;
//    7     int i;
//    8     uint8_t DealRecData[25] = {0};
        LDW       Y, #?_0
        LDW       X, SP
        ADDW      X, #0x4
        PUSHW     X
        LD        A, #0x19
        CALL      L:?move1616_v_x_y_a
        POPW      X
//    9     uint8_t ID_LOCK[3] = {0x35,0x19,0x13};
        LDW       Y, #?_1
        LDW       X, SP
        ADDW      X, #0x1
        PUSHW     X
        LD        A, #0x3
        CALL      L:?move1616_v_x_y_a
        POPW      X
//   10     if(!SX78Str.Sx7xRxFlag)return ERR;
        LD        A, L:SX78Str + 4
        CP        A, #0x0
        JRNE      L:??SingalCheck_0
        LD        A, #0x6
        JP        L:??SingalCheck_1
//   11     if((SX78Str.SX7xRxStr[0]!=ID_LOCK[0])||(SX78Str.SX7xRxStr[1]!=ID_LOCK[1]))return ERR;
??SingalCheck_0:
        LD        A, (0x1,SP)
        CP        A, L:SX78Str + 19
        JRNE      L:??SingalCheck_2
        LD        A, (0x2,SP)
        CP        A, L:SX78Str + 20
        JREQ      L:??SingalCheck_3
??SingalCheck_2:
        LD        A, #0x6
        JP        L:??SingalCheck_1
//   12     SX78Str.Sx7xRxFlag = FALSE;
??SingalCheck_3:
        MOV       L:SX78Str + 4, #0x0
//   13     memcpy(DealRecData,SX78Str.SX7xRxStr+3,25*sizeof(uint8_t));
        LDW       X, #0x19
        LDW       S:?w0, X
        LDW       Y, #SX78Str + 22
        LDW       X, SP
        ADDW      X, #0x4
        CALL      L:memcpy
//   14     memset(SX78Str.SX7xRxStr,0,0x80*2*sizeof(uint8_t));
        LDW       X, #0x100
        LDW       S:?w0, X
        CLRW      Y
        LDW       X, #SX78Str + 19
        CALL      L:memset
//   15     if(DealRecData[0]==0xFB&&DealRecData[1]==0x00&&DealRecData[2]==0x00&&DealRecData[3]==0x00&&DealRecData[4]==0xFD)
        LD        A, (0x4,SP)
        CP        A, #0xfb
        JRNE      L:??SingalCheck_4
        TNZ       (0x5,SP)
        JRNE      L:??SingalCheck_4
        TNZ       (0x6,SP)
        JRNE      L:??SingalCheck_4
        TNZ       (0x7,SP)
        JRNE      L:??SingalCheck_4
        LD        A, (0x8,SP)
        CP        A, #0xfd
        JRNE      L:??SingalCheck_4
//   16     {
//   17         return BOOT ;
        LD        A, #0x31
        JP        L:??SingalCheck_1
//   18     }
//   19     if(DealRecData[0]==0xFB&&DealRecData[1]==0x11&&DealRecData[2]==0x11&&DealRecData[3]==0x11&&DealRecData[4]==0xFD)
??SingalCheck_4:
        LD        A, (0x4,SP)
        CP        A, #0xfb
        JRNE      L:??SingalCheck_5
        LD        A, (0x5,SP)
        CP        A, #0x11
        JRNE      L:??SingalCheck_5
        LD        A, (0x6,SP)
        CP        A, #0x11
        JRNE      L:??SingalCheck_5
        LD        A, (0x7,SP)
        CP        A, #0x11
        JRNE      L:??SingalCheck_5
        LD        A, (0x8,SP)
        CP        A, #0xfd
        JRNE      L:??SingalCheck_5
//   20     {
//   21         return TEST_REC ;
        LD        A, #0x32
        JP        L:??SingalCheck_1
//   22     }
//   23     if(DealRecData[0]==0X7B&&DealRecData[1]==0X10&&DealRecData[4]==0X07&&DealRecData[5]==0XFF&&DealRecData[19]==0X7D)
??SingalCheck_5:
        LD        A, (0x4,SP)
        CP        A, #0x7b
        JRNE      L:??SingalCheck_6
        LD        A, (0x5,SP)
        CP        A, #0x10
        JRNE      L:??SingalCheck_6
        LD        A, (0x8,SP)
        CP        A, #0x7
        JRNE      L:??SingalCheck_6
        LD        A, (0x9,SP)
        CP        A, #0xff
        JRNE      L:??SingalCheck_6
        LD        A, (0x17,SP)
        CP        A, #0x7d
        JRNE      L:??SingalCheck_6
//   24     {
//   25         return ERR;
        LD        A, #0x6
        JP        L:??SingalCheck_1
//   26     }
//   27     //enum SIGNAL_STATE MAG = 1;//photores_dete();//返回地磁变化状态。
//   28     //载荷长度为5的命令解析。
//   29     if(DealRecData[0]==0x7B&&DealRecData[8]==0x7D&&DealRecData[1]==0x05)
??SingalCheck_6:
        LD        A, (0x4,SP)
        CP        A, #0x7b
        JREQ      ??lb_10
        JP        L:??SingalCheck_7
??lb_10:
        LD        A, (0xc,SP)
        CP        A, #0x7d
        JREQ      ??lb_11
        JP        L:??SingalCheck_7
??lb_11:
        LD        A, (0x5,SP)
        CP        A, #0x5
        JREQ      ??lb_12
        JP        L:??SingalCheck_7
//   30     {
//   31 
//   32         reccs=0;
??lb_12:
        CLR       S:?b2
//   33         for(i=2; i<7; i++)
        LDW       X, #0x2
        JRA       L:??SingalCheck_8
//   34         {
//   35             reccs=reccs+DealRecData[i];
??SingalCheck_9:
        LDW       Y, SP
        ADDW      Y, #0x4
        LDW       S:?w0, X
        ADDW      Y, S:?w0
        LD        A, (Y)
        ADD       A, S:?b2
        LD        S:?b2, A
//   36         }
        INCW      X
??SingalCheck_8:
        CPW       X, #0x7
        JRSLT     L:??SingalCheck_9
//   37         if(reccs==DealRecData[7])//校验和正确。
        LD        A, (0xb,SP)
        CP        A, S:?b2
        JREQ      ??lb_13
        JP        L:??SingalCheck_7
//   38         {
//   39             if((DealRecData[2]==ID_LOCK[0]&&DealRecData[3]==ID_LOCK[1])||(DealRecData[2]==0xFF&&DealRecData[3]==0xFF))//lock地址或广播地址
??lb_13:
        LD        A, (0x1,SP)
        CP        A, (0x6,SP)
        JRNE      L:??SingalCheck_10
        LD        A, (0x2,SP)
        CP        A, (0x7,SP)
        JREQ      L:??SingalCheck_11
??SingalCheck_10:
        LD        A, (0x6,SP)
        CP        A, #0xff
        JREQ      ??lb_14
        JP        L:??SingalCheck_7
??lb_14:
        LD        A, (0x7,SP)
        CP        A, #0xff
        JREQ      ??lb_15
        JP        L:??SingalCheck_7
//   40             {
//   41                 //LedCtrl(SINGLE);
//   42                 //对02寄存器写操作。
//   43 
//   44                 if(DealRecData[4]==0x06&&DealRecData[5]==0x02&&DealRecData[6]==0x00)//命令06 寄存器02
??lb_15:
??SingalCheck_11:
        LD        A, (0x8,SP)
        CP        A, #0x6
        JRNE      L:??SingalCheck_12
        LD        A, (0x9,SP)
        CP        A, #0x2
        JRNE      L:??SingalCheck_12
        TNZ       (0xa,SP)
        JRNE      L:??SingalCheck_12
//   45                 {
//   46                     return PC_OPEN;
        CLR       A
        JP        L:??SingalCheck_1
//   47 
//   48                 }
//   49                 if(DealRecData[4]==0x06&&DealRecData[5]==0x02&&DealRecData[6]==0x01)
??SingalCheck_12:
        LD        A, (0x8,SP)
        CP        A, #0x6
        JRNE      L:??SingalCheck_13
        LD        A, (0x9,SP)
        CP        A, #0x2
        JRNE      L:??SingalCheck_13
        LD        A, (0xa,SP)
        CP        A, #0x1
        JRNE      L:??SingalCheck_13
//   50                 {
//   51                     return PC_CLOSE;
        LD        A, #0x1
        JP        L:??SingalCheck_1
//   52                 }
//   53                 if(DealRecData[4]==0x06&&DealRecData[5]==0x03&&DealRecData[6]==0x00)
??SingalCheck_13:
        LD        A, (0x8,SP)
        CP        A, #0x6
        JRNE      L:??SingalCheck_14
        LD        A, (0x9,SP)
        CP        A, #0x3
        JRNE      L:??SingalCheck_14
        TNZ       (0xa,SP)
        JRNE      L:??SingalCheck_14
//   54                 {
//   55                     return ALL_OPEN;
        LD        A, #0x19
        JP        L:??SingalCheck_1
//   56                 }
//   57                 if(DealRecData[4]==0x06&&DealRecData[5]==0x03&&DealRecData[6]==0x01)
??SingalCheck_14:
        LD        A, (0x8,SP)
        CP        A, #0x6
        JRNE      L:??SingalCheck_15
        LD        A, (0x9,SP)
        CP        A, #0x3
        JRNE      L:??SingalCheck_15
        LD        A, (0xa,SP)
        CP        A, #0x1
        JRNE      L:??SingalCheck_15
//   58                 {
//   59                     return ALL_CLOSE;
        LD        A, #0x1a
        JP        L:??SingalCheck_1
//   60                 }
//   61                 if(DealRecData[4]==0x06&&DealRecData[5]==0x09&&DealRecData[6]==0x00)
??SingalCheck_15:
        LD        A, (0x8,SP)
        CP        A, #0x6
        JRNE      L:??SingalCheck_16
        LD        A, (0x9,SP)
        CP        A, #0x9
        JRNE      L:??SingalCheck_16
        TNZ       (0xa,SP)
        JRNE      L:??SingalCheck_16
//   62                 {
//   63                     return SET_BEEP_0;
        LD        A, #0x27
        JP        L:??SingalCheck_1
//   64                 }
//   65                 if(DealRecData[4]==0x06&&DealRecData[5]==0x0E&&DealRecData[6]==0x00)
??SingalCheck_16:
        LD        A, (0x8,SP)
        CP        A, #0x6
        JRNE      L:??SingalCheck_17
        LD        A, (0x9,SP)
        CP        A, #0xe
        JRNE      L:??SingalCheck_17
        TNZ       (0xa,SP)
        JRNE      L:??SingalCheck_17
//   66                 {
//   67                     return SET_CAR_NO_STATE;
        LD        A, #0x2b
        JP        L:??SingalCheck_1
//   68                 }
//   69                 if(DealRecData[4]==0x06&&DealRecData[5]==0x0E&&DealRecData[6]==0x01)
??SingalCheck_17:
        LD        A, (0x8,SP)
        CP        A, #0x6
        JRNE      L:??SingalCheck_7
        LD        A, (0x9,SP)
        CP        A, #0xe
        JRNE      L:??SingalCheck_7
        LD        A, (0xa,SP)
        CP        A, #0x1
        JRNE      L:??SingalCheck_7
//   70                 {
//   71                     return SET_CAR_YES_STATE;
        LD        A, #0x2c
        JP        L:??SingalCheck_1
//   72                 }
//   73 
//   74             }
//   75         }
//   76     }
//   77 
//   78     //载荷长度为4的命令
//   79     if(DealRecData[0]==0x7B&&DealRecData[7]==0x7D&&DealRecData[1]==0x04)
??SingalCheck_7:
        LD        A, (0x4,SP)
        CP        A, #0x7b
        JREQ      ??lb_16
        JP        L:??SingalCheck_18
??lb_16:
        LD        A, (0xb,SP)
        CP        A, #0x7d
        JREQ      ??lb_17
        JP        L:??SingalCheck_18
??lb_17:
        LD        A, (0x5,SP)
        CP        A, #0x4
        JREQ      ??lb_18
        JP        L:??SingalCheck_18
//   80     {
//   81         reccs=0;
??lb_18:
        CLR       S:?b2
//   82 
//   83         for(i=2; i<6; i++)
        LDW       X, #0x2
        JRA       L:??SingalCheck_19
//   84         {
//   85             reccs=reccs+DealRecData[i];
??SingalCheck_20:
        LDW       Y, SP
        ADDW      Y, #0x4
        LDW       S:?w0, X
        ADDW      Y, S:?w0
        LD        A, (Y)
        ADD       A, S:?b2
        LD        S:?b2, A
//   86         }
        INCW      X
??SingalCheck_19:
        CPW       X, #0x6
        JRSLT     L:??SingalCheck_20
//   87 
//   88         if(reccs==DealRecData[6])
        LD        A, (0xa,SP)
        CP        A, S:?b2
        JRNE      L:??SingalCheck_18
//   89         {
//   90             if((DealRecData[2]==ID_LOCK[0]&&DealRecData[3]==ID_LOCK[1])||(DealRecData[2]==0xFF&&DealRecData[3]==0xFF))
        LD        A, (0x1,SP)
        CP        A, (0x6,SP)
        JRNE      L:??SingalCheck_21
        LD        A, (0x2,SP)
        CP        A, (0x7,SP)
        JREQ      L:??SingalCheck_22
??SingalCheck_21:
        LD        A, (0x6,SP)
        CP        A, #0xff
        JRNE      L:??SingalCheck_18
        LD        A, (0x7,SP)
        CP        A, #0xff
        JRNE      L:??SingalCheck_18
//   91             {
//   92 
//   93                 if(DealRecData[4]==0x03)
??SingalCheck_22:
        LD        A, (0x8,SP)
        CP        A, #0x3
        JRNE      L:??SingalCheck_18
//   94                 {
//   95                     switch(DealRecData[5])
        LD        A, (0x9,SP)
        SUB       A, #0x5
        JREQ      L:??SingalCheck_23
        SUB       A, #0x2
        JREQ      L:??SingalCheck_24
        DEC       A
        JREQ      L:??SingalCheck_25
        SUB       A, #0x3
        JREQ      L:??SingalCheck_26
        SUB       A, #0x2
        JREQ      L:??SingalCheck_27
        SUB       A, #0x2
        JREQ      L:??SingalCheck_28
        DEC       A
        JREQ      L:??SingalCheck_29
        SUB       A, #0xef
        JRNE      L:??SingalCheck_18
//   96                     {
//   97                       case 0xFF:
//   98                         return PC_REQ;
        LD        A, #0x4
        JP        L:??SingalCheck_1
//   99                       case 0x08:
//  100                         return GET_OPT_PA;
??SingalCheck_25:
        LD        A, #0x11
        JP        L:??SingalCheck_1
//  101                       case 0x07:
//  102                         return GET_ADDED_WL_PC;
??SingalCheck_24:
        LD        A, #0x12
        JP        L:??SingalCheck_1
//  103                       case 0x05:
//  104                         return GET_ADDED_WL_LOCK;
??SingalCheck_23:
        LD        A, #0x13
        JP        L:??SingalCheck_1
//  105                       case 0x0B:
//  106                         return GET_CURRENT_PARA;
??SingalCheck_26:
        LD        A, #0x1f
        JP        L:??SingalCheck_1
//  107                       case 0x0D:
//  108                         return GET_WL_PARA;
??SingalCheck_27:
        LD        A, #0x21
        JP        L:??SingalCheck_1
//  109                       case 0x0F:
//  110                         return GET_PHO_PARA;
??SingalCheck_28:
        LD        A, #0x2e
        JP        L:??SingalCheck_1
//  111                       case 0x10:
//  112                         return BatLowValueRead;
??SingalCheck_29:
        LD        A, #0x35
        JP        L:??SingalCheck_1
//  113                       default:
//  114                         break;
//  115                     }
//  116 
//  117                 }
//  118             }
//  119         }
//  120     }
//  121 
//  122     //载荷长度为6的数据包。
//  123 
//  124     if(DealRecData[0]==0x7B&&DealRecData[9]==0x7D&&DealRecData[1]==0x06)
??SingalCheck_18:
        LD        A, (0x4,SP)
        CP        A, #0x7b
        JRNE      L:??SingalCheck_30
        LD        A, (0xd,SP)
        CP        A, #0x7d
        JRNE      L:??SingalCheck_30
        LD        A, (0x5,SP)
        CP        A, #0x6
        JRNE      L:??SingalCheck_30
//  125     {
//  126         reccs=0;
        CLR       S:?b2
//  127 
//  128         for(i=2; i<8; i++)
        LDW       X, #0x2
        JRA       L:??SingalCheck_31
//  129         {
//  130             reccs=reccs+DealRecData[i];
??SingalCheck_32:
        LDW       Y, SP
        ADDW      Y, #0x4
        LDW       S:?w0, X
        ADDW      Y, S:?w0
        LD        A, (Y)
        ADD       A, S:?b2
        LD        S:?b2, A
//  131         }
        INCW      X
??SingalCheck_31:
        CPW       X, #0x8
        JRSLT     L:??SingalCheck_32
//  132         //
//  133         if(reccs==DealRecData[8])
        LD        A, (0xc,SP)
        CP        A, S:?b2
        JRNE      L:??SingalCheck_30
//  134         {
//  135             if((DealRecData[2]==ID_LOCK[0]&&DealRecData[3]==ID_LOCK[1])||(DealRecData[2]==0xFF&&DealRecData[3]==0xFF))
        LD        A, (0x1,SP)
        CP        A, (0x6,SP)
        JRNE      L:??SingalCheck_33
        LD        A, (0x2,SP)
        CP        A, (0x7,SP)
        JREQ      L:??SingalCheck_34
??SingalCheck_33:
        LD        A, (0x6,SP)
        CP        A, #0xff
        JRNE      L:??SingalCheck_30
        LD        A, (0x7,SP)
        CP        A, #0xff
        JRNE      L:??SingalCheck_30
//  136             {
//  137                 if(DealRecData[4]==0x06)//写指令
??SingalCheck_34:
        LD        A, (0x8,SP)
        CP        A, #0x6
        JRNE      L:??SingalCheck_30
//  138                 {
//  139                     if(DealRecData[5]==0x00)
        TNZ       (0x9,SP)
        JRNE      L:??SingalCheck_35
//  140                     {
//  141                         return ADDED_LOCKID;
        LD        A, #0xa
        JP        L:??SingalCheck_1
//  142                     }
//  143                     if(DealRecData[5]==0x10)
??SingalCheck_35:
        LD        A, (0x9,SP)
        CP        A, #0x10
        JRNE      L:??SingalCheck_30
//  144                     {
//  145                         return BatLowValueWrite;
        LD        A, #0x36
        JP        L:??SingalCheck_1
//  146                     }
//  147                 }
//  148             }
//  149         }
//  150     }
//  151 
//  152 
//  153     //载荷长度为7的命令
//  154     if(DealRecData[0]==0x7B&&DealRecData[10]==0x7D&&DealRecData[1]==0x07)
??SingalCheck_30:
        LD        A, (0x4,SP)
        CP        A, #0x7b
        JRNE      L:??SingalCheck_36
        LD        A, (0xe,SP)
        CP        A, #0x7d
        JRNE      L:??SingalCheck_36
        LD        A, (0x5,SP)
        CP        A, #0x7
        JRNE      L:??SingalCheck_36
//  155     {
//  156         reccs=0;
        CLR       S:?b2
//  157 
//  158         for(i=2; i<9; i++)
        LDW       X, #0x2
        JRA       L:??SingalCheck_37
//  159         {
//  160             reccs=reccs+DealRecData[i];
??SingalCheck_38:
        LDW       Y, SP
        ADDW      Y, #0x4
        LDW       S:?w0, X
        ADDW      Y, S:?w0
        LD        A, (Y)
        ADD       A, S:?b2
        LD        S:?b2, A
//  161         }
        INCW      X
??SingalCheck_37:
        CPW       X, #0x9
        JRSLT     L:??SingalCheck_38
//  162         if(reccs==DealRecData[9])
        LD        A, (0xd,SP)
        CP        A, S:?b2
        JRNE      L:??SingalCheck_36
//  163         {
//  164             if((DealRecData[2]==ID_LOCK[0]&&DealRecData[3]==ID_LOCK[1])||(DealRecData[2]==0xFF&&DealRecData[3]==0xFF))
        LD        A, (0x1,SP)
        CP        A, (0x6,SP)
        JRNE      L:??SingalCheck_39
        LD        A, (0x2,SP)
        CP        A, (0x7,SP)
        JREQ      L:??SingalCheck_40
??SingalCheck_39:
        LD        A, (0x6,SP)
        CP        A, #0xff
        JRNE      L:??SingalCheck_36
        LD        A, (0x7,SP)
        CP        A, #0xff
        JRNE      L:??SingalCheck_36
//  165             {
//  166                 if(DealRecData[4]==0x06)
??SingalCheck_40:
        LD        A, (0x8,SP)
        CP        A, #0x6
        JRNE      L:??SingalCheck_36
//  167                 {
//  168                     switch (DealRecData[5])
        LD        A, (0x9,SP)
        CP        A, #0x5
        JREQ      L:??SingalCheck_41
        CP        A, #0x7
        JREQ      L:??SingalCheck_42
        JRA       L:??SingalCheck_36
//  169                     {
//  170                       case 0x05:
//  171                         return ADDED_WL_LOCK;
??SingalCheck_41:
        LD        A, #0xb
        JP        L:??SingalCheck_1
//  172                       case 0x07:
//  173                         return ADDED_WL_PC;
??SingalCheck_42:
        LD        A, #0xd
        JP        L:??SingalCheck_1
//  174                       default:
//  175                         break;
//  176                     }
//  177                 }
//  178             }
//  179         }
//  180     }
//  181 
//  182     //载荷长度为8
//  183     if(DealRecData[0]==0x7B&&DealRecData[11]==0x7D&&DealRecData[1]==0x08)
??SingalCheck_36:
        LD        A, (0x4,SP)
        CP        A, #0x7b
        JRNE      L:??SingalCheck_43
        LD        A, (0xf,SP)
        CP        A, #0x7d
        JRNE      L:??SingalCheck_43
        LD        A, (0x5,SP)
        CP        A, #0x8
        JRNE      L:??SingalCheck_43
//  184     {
//  185         reccs=0;
        CLR       S:?b2
//  186 
//  187         for(i=2; i<10; i++)
        LDW       X, #0x2
        JRA       L:??SingalCheck_44
//  188         {
//  189             reccs=reccs+DealRecData[i];
??SingalCheck_45:
        LDW       Y, SP
        ADDW      Y, #0x4
        LDW       S:?w0, X
        ADDW      Y, S:?w0
        LD        A, (Y)
        ADD       A, S:?b2
        LD        S:?b2, A
//  190         }
        INCW      X
??SingalCheck_44:
        CPW       X, #0xa
        JRSLT     L:??SingalCheck_45
//  191 
//  192         if(reccs==DealRecData[10])
        LD        A, (0xe,SP)
        CP        A, S:?b2
        JRNE      L:??SingalCheck_43
//  193         {
//  194             if((DealRecData[2]==ID_LOCK[0]&&DealRecData[3]==ID_LOCK[1])||(DealRecData[2]==0xFF&&DealRecData[3]==0xFF))
        LD        A, (0x1,SP)
        CP        A, (0x6,SP)
        JRNE      L:??SingalCheck_46
        LD        A, (0x2,SP)
        CP        A, (0x7,SP)
        JREQ      L:??SingalCheck_47
??SingalCheck_46:
        LD        A, (0x6,SP)
        CP        A, #0xff
        JRNE      L:??SingalCheck_43
        LD        A, (0x7,SP)
        CP        A, #0xff
        JRNE      L:??SingalCheck_43
//  195             {
//  196                 if(DealRecData[4]==0x06)
??SingalCheck_47:
        LD        A, (0x8,SP)
        CP        A, #0x6
        JRNE      L:??SingalCheck_43
//  197                 {
//  198                     if(DealRecData[5]==0x08)
        LD        A, (0x9,SP)
        CP        A, #0x8
        JRNE      L:??SingalCheck_48
//  199                     {
//  200                         
//  201                         memcpy(CarRecDataStr.Opa,&DealRecData[6],4*sizeof(uint8_t));                       
        LDW       X, #0x4
        LDW       S:?w0, X
        LDW       Y, SP
        ADDW      Y, #0xa
        LDW       X, #CarRecDataStr + 23
        CALL      L:memcpy
//  202                         return OPT_CONF;
        LD        A, #0xe
        JP        L:??SingalCheck_1
//  203                     }
//  204                     if(DealRecData[5]==0x0B)
??SingalCheck_48:
        LD        A, (0x9,SP)
        CP        A, #0xb
        JRNE      L:??SingalCheck_43
//  205                     {
//  206                         return SET_CURRENT_PARA;
        LD        A, #0x1e
        JP        L:??SingalCheck_1
//  207                     }
//  208                 }
//  209 
//  210             }
//  211         }
//  212     }
//  213 
//  214     if(DealRecData[0]==0x7B&&DealRecData[17]==0x7D&&DealRecData[1]==0xF0)
??SingalCheck_43:
        LD        A, (0x4,SP)
        CP        A, #0x7b
        JRNE      L:??SingalCheck_49
        LD        A, (0x15,SP)
        CP        A, #0x7d
        JRNE      L:??SingalCheck_49
        LD        A, (0x5,SP)
        CP        A, #0xf0
        JRNE      L:??SingalCheck_49
//  215     {
//  216         reccs=0;
        CLR       S:?b2
//  217 
//  218         for(i=2; i<16; i++)
        LDW       X, #0x2
        JRA       L:??SingalCheck_50
//  219         {
//  220             reccs=reccs+DealRecData[i];
??SingalCheck_51:
        LDW       Y, SP
        ADDW      Y, #0x4
        LDW       S:?w0, X
        ADDW      Y, S:?w0
        LD        A, (Y)
        ADD       A, S:?b2
        LD        S:?b2, A
//  221         }
        INCW      X
??SingalCheck_50:
        CPW       X, #0x10
        JRSLT     L:??SingalCheck_51
//  222         if(reccs==DealRecData[16])
        LD        A, (0x14,SP)
        CP        A, S:?b2
        JRNE      L:??SingalCheck_49
//  223         {
//  224             if((DealRecData[2]==ID_LOCK[0]&&DealRecData[3]==ID_LOCK[1])||(DealRecData[2]==0xFF&&DealRecData[3]==0xFF))
        LD        A, (0x1,SP)
        CP        A, (0x6,SP)
        JRNE      L:??SingalCheck_52
        LD        A, (0x2,SP)
        CP        A, (0x7,SP)
        JREQ      L:??SingalCheck_53
??SingalCheck_52:
        LD        A, (0x6,SP)
        CP        A, #0xff
        JRNE      L:??SingalCheck_49
        LD        A, (0x7,SP)
        CP        A, #0xff
        JRNE      L:??SingalCheck_49
//  225             {
//  226                 return SET_PHO_PARA;//修改光敏阈值
??SingalCheck_53:
        LD        A, #0x2d
        JRA       L:??SingalCheck_1
//  227             }
//  228         }
//  229     }
//  230 
//  231     //载荷长度为10
//  232     if(DealRecData[0]==0x7b&&DealRecData[13]==0x7d&&DealRecData[1]==0x0a)
??SingalCheck_49:
        LD        A, (0x4,SP)
        CP        A, #0x7b
        JRNE      L:??SingalCheck_54
        LD        A, (0x11,SP)
        CP        A, #0x7d
        JRNE      L:??SingalCheck_54
        LD        A, (0x5,SP)
        CP        A, #0xa
        JRNE      L:??SingalCheck_54
//  233     {
//  234         reccs=0;
        CLR       S:?b2
//  235         for(i=2; i<12; i++)
        LDW       X, #0x2
        JRA       L:??SingalCheck_55
//  236         {
//  237             reccs=reccs+DealRecData[i];
??SingalCheck_56:
        LDW       Y, SP
        ADDW      Y, #0x4
        LDW       S:?w0, X
        ADDW      Y, S:?w0
        LD        A, (Y)
        ADD       A, S:?b2
        LD        S:?b2, A
//  238         }
        INCW      X
??SingalCheck_55:
        CPW       X, #0xc
        JRSLT     L:??SingalCheck_56
//  239         if((DealRecData[2]==ID_LOCK[0]&&DealRecData[3]==ID_LOCK[1])||(DealRecData[2]==0xFF&&DealRecData[3]==0xFF))
        LD        A, (0x1,SP)
        CP        A, (0x6,SP)
        JRNE      L:??SingalCheck_57
        LD        A, (0x2,SP)
        CP        A, (0x7,SP)
        JREQ      L:??SingalCheck_58
??SingalCheck_57:
        LD        A, (0x6,SP)
        CP        A, #0xff
        JRNE      L:??SingalCheck_54
        LD        A, (0x7,SP)
        CP        A, #0xff
        JRNE      L:??SingalCheck_54
//  240         {
//  241             if(DealRecData[4]==0x06&&DealRecData[5]==0x0D)
??SingalCheck_58:
        LD        A, (0x8,SP)
        CP        A, #0x6
        JRNE      L:??SingalCheck_54
        LD        A, (0x9,SP)
        CP        A, #0xd
        JRNE      L:??SingalCheck_54
//  242             {
//  243                 return SET_WL_PARA;
        LD        A, #0x20
        JRA       L:??SingalCheck_1
//  244             }
//  245         }
//  246     }
//  247     return ERR;
??SingalCheck_54:
        LD        A, #0x6
??SingalCheck_1:
        ADD       SP, #0x1c
        RET
//  248 
//  249 }
//  250 

        SECTION `.near_func.text`:CODE:REORDER:NOROOT(0)
        CODE
//  251 void CmdDeal(void)
//  252 {
CmdDeal:
        PUSH      S:?b8
//  253     uint8_t CMD;
//  254     CMD = SingalCheck();
        CALL      L:SingalCheck
        LD        S:?b8, A
//  255     switch(CMD)
        LD        A, S:?b8
        TNZ       A
        JREQ      L:??CmdDeal_0
        DEC       A
        JREQ      L:??CmdDeal_1
        SUB       A, #0x3
        JRNE      ??lb_2
        JP        L:??CmdDeal_2
??lb_2:
        SUB       A, #0x6
        JRNE      ??lb_3
        JP        L:??CmdDeal_3
??lb_3:
        DEC       A
        JRNE      ??lb_4
        JP        L:??CmdDeal_4
??lb_4:
        SUB       A, #0x2
        JRNE      ??lb_5
        JP        L:??CmdDeal_5
??lb_5:
        DEC       A
        JRNE      ??lb_6
        JP        L:??CmdDeal_6
??lb_6:
        SUB       A, #0x3
        JRNE      ??lb_7
        JP        L:??CmdDeal_7
??lb_7:
        SUB       A, #0x8
        JREQ      L:??CmdDeal_8
        DEC       A
        JREQ      L:??CmdDeal_9
        SUB       A, #0x6
        JRNE      ??lb_8
        JP        L:??CmdDeal_10
??lb_8:
        SUB       A, #0x7
        JRNE      ??lb_9
        JP        L:??CmdDeal_11
??lb_9:
        SUB       A, #0x4
        JREQ      L:??CmdDeal_12
        DEC       A
        JREQ      L:??CmdDeal_13
        JP        L:??CmdDeal_14
//  256     {
//  257       case PC_OPEN:
//  258         {
//  259             SendData(CMD);
??CmdDeal_0:
        LD        A, S:?b8
        CALL      L:SendData
//  260             CarAction(1,0,1,2);
        MOV       S:?b2, #0x2
        MOV       S:?b1, #0x1
        CLR       S:?b0
        LD        A, #0x1
        CALL      L:CarAction
//  261             break;
        JP        L:??CmdDeal_14
//  262         }
//  263       case PC_CLOSE:
//  264         {
//  265             SendData(CMD);
??CmdDeal_1:
        LD        A, S:?b8
        CALL      L:SendData
//  266             CarAction(1,0,1,1);
        MOV       S:?b2, #0x1
        MOV       S:?b1, #0x1
        CLR       S:?b0
        LD        A, #0x1
        CALL      L:CarAction
//  267             break;
        JP        L:??CmdDeal_14
//  268         }
//  269       case ALL_OPEN:
//  270         {
//  271             SendData(CMD);
??CmdDeal_8:
        LD        A, S:?b8
        CALL      L:SendData
//  272             CarAction(0,0,1,2);
        MOV       S:?b2, #0x2
        MOV       S:?b1, #0x1
        CLR       S:?b0
        CLR       A
        CALL      L:CarAction
//  273             bsp_beep_one();
        CALL      L:bsp_beep_one
//  274             break;
        JP        L:??CmdDeal_14
//  275         }
//  276       case ALL_CLOSE:
//  277         {
//  278             SendData(CMD);
??CmdDeal_9:
        LD        A, S:?b8
        CALL      L:SendData
//  279             CarAction(0,0,1,1);
        MOV       S:?b2, #0x1
        MOV       S:?b1, #0x1
        CLR       S:?b0
        CLR       A
        CALL      L:CarAction
//  280             bsp_beep_one();
        CALL      L:bsp_beep_one
//  281             break;
        JRA       L:??CmdDeal_14
//  282         }
//  283       case SET_CAR_YES_STATE:
//  284         {
//  285             SendData(CMD);
??CmdDeal_13:
        LD        A, S:?b8
        CALL      L:SendData
//  286             CarRecDataStr.CarState = 1;
        MOV       L:CarRecDataStr + 11, #0x1
//  287             bsp_beep_one();
        CALL      L:bsp_beep_one
//  288             break;
        JRA       L:??CmdDeal_14
//  289         }
//  290       case SET_CAR_NO_STATE:
//  291         {
//  292             SendData(CMD);
??CmdDeal_12:
        LD        A, S:?b8
        CALL      L:SendData
//  293             CarRecDataStr.CarState = 0;
        MOV       L:CarRecDataStr + 11, #0x0
//  294             bsp_beep_one();
        CALL      L:bsp_beep_one
//  295             break;
        JRA       L:??CmdDeal_14
//  296         }
//  297       case PC_REQ:
//  298         {
//  299             SendData(CMD);
??CmdDeal_2:
        LD        A, S:?b8
        CALL      L:SendData
//  300             bsp_beep_one();
        CALL      L:bsp_beep_one
//  301             break;
        JRA       L:??CmdDeal_14
//  302         }
//  303       case GET_OPT_PA:
//  304         {
//  305             SendData(CMD);
??CmdDeal_7:
        LD        A, S:?b8
        CALL      L:SendData
//  306             bsp_beep_one();
        CALL      L:bsp_beep_one
//  307             break;
        JRA       L:??CmdDeal_14
//  308         }
//  309       case ADDED_LOCKID:
//  310         {
//  311             SendData(CMD);
??CmdDeal_3:
        LD        A, S:?b8
        CALL      L:SendData
//  312             bsp_beep_one();
        CALL      L:bsp_beep_one
//  313             break;
        JRA       L:??CmdDeal_14
//  314         }
//  315 
//  316       case ADDED_WL_LOCK:
//  317         {
//  318             SendData(CMD);
??CmdDeal_4:
        LD        A, S:?b8
        CALL      L:SendData
//  319             bsp_beep_one();
        CALL      L:bsp_beep_one
//  320             break;
        JRA       L:??CmdDeal_14
//  321         }
//  322       case ADDED_WL_PC:
//  323         {
//  324             SendData(CMD);
??CmdDeal_5:
        LD        A, S:?b8
        CALL      L:SendData
//  325             bsp_beep_one();
        CALL      L:bsp_beep_one
//  326             break;
        JRA       L:??CmdDeal_14
//  327         }
//  328       case OPT_CONF:
//  329         {
//  330             FixedParaChange(TRUE);
??CmdDeal_6:
        LD        A, #0x1
        CALL      L:FixedParaChange
//  331             SendData(CMD);
        LD        A, S:?b8
        CALL      L:SendData
//  332             bsp_beep_one();
        CALL      L:bsp_beep_one
//  333             break;
        JRA       L:??CmdDeal_14
//  334         }
//  335       case SET_WL_PARA:
//  336         {
//  337             SendData(CMD);
??CmdDeal_10:
        LD        A, S:?b8
        CALL      L:SendData
//  338             bsp_beep_one();
        CALL      L:bsp_beep_one
//  339             break;
        JRA       L:??CmdDeal_14
//  340         }
//  341       case SET_BEEP_0:
//  342         {
//  343             BeepStart(3,0);
??CmdDeal_11:
        CLR       A
        LDW       X, #0x3
        LDW       S:?w1, X
        CLRW      X
        LDW       S:?w0, X
        CALL      L:BeepStart
//  344             SendData(CMD);
        LD        A, S:?b8
        CALL      L:SendData
//  345         }
//  346       default :break;
//  347     }
//  348 }
??CmdDeal_14:
        POP       S:?b8
        RET
//  349 

        SECTION `.near_func.text`:CODE:REORDER:NOROOT(0)
        CODE
//  350 void SendData(u8 SINGAL)
//  351 {
SendData:
        CALL      L:?push_w4
        PUSH      S:?b10
        SUB       SP, #0x1d
        LD        S:?b10, A
//  352 	struct WIRELESS_STR sendstr={0};
        LDW       Y, #?_2
        LDW       X, SP
        ADDW      X, #0x1
        PUSHW     X
        LD        A, #0x1d
        CALL      L:?move1616_v_x_y_a
        POPW      X
//  353 	uint8_t *temp = &sendstr.Data[0];
        LDW       X, SP
        ADDW      X, #0x8
        LDW       S:?w4, X
//  354 	if(CarRecDataStr.ForKingView++>254)
        LD        A, L:CarRecDataStr + 12
        LD        S:?b0, A
        LD        A, S:?b0
        ADD       A, #0x1
        LD        L:CarRecDataStr + 12, A
        LD        A, S:?b0
        CP        A, #0xff
        JRNE      L:??SendData_0
//  355 	{
//  356 		CarRecDataStr.ForKingView=0;
        MOV       L:CarRecDataStr + 12, #0x0
//  357 	}
//  358 	//回传数据包的公共部分
//  359 		memcpy(sendstr.WireId,SystemPara.PcID,3*sizeof(uint8_t));
??SendData_0:
        LDW       X, #0x3
        LDW       S:?w0, X
        LDW       Y, #SystemPara + 5
        LDW       X, SP
        ADDW      X, #0x1
        CALL      L:memcpy
//  360 		sendstr.FrameHead = 0X7B;
        LD        A, #0x7b
        LD        (0x4,SP), A
//  361 		sendstr.FrameTail = 0x7D;
        LD        A, #0x7d
        LD        (0x1d,SP), A
//  362 		memcpy(sendstr.LockId,SystemPara.LockID,2*sizeof(uint8_t));
        LDW       X, #0x2
        LDW       S:?w0, X
        LDW       Y, #SystemPara + 1
        LDW       X, SP
        ADDW      X, #0x6
        CALL      L:memcpy
//  363                 memcpy(CarRecDataStr.hmcX,QMC5883LStr.QMC_CUR_ROPORT,2*sizeof(uint8_t));
        LDW       X, #0x2
        LDW       S:?w0, X
        LDW       Y, #QMC5883LStr + 2
        LDW       X, #CarRecDataStr + 1
        CALL      L:memcpy
//  364                 memcpy(CarRecDataStr.hmcY,&QMC5883LStr.QMC_CUR_ROPORT[4],2*sizeof(uint8_t)); 
        LDW       X, #0x2
        LDW       S:?w0, X
        LDW       Y, #QMC5883LStr + 6
        LDW       X, #CarRecDataStr + 3
        CALL      L:memcpy
//  365                 get_photoresistor_ad();
        CALL      L:get_photoresistor_ad
//  366         /***********************************************/
//  367 	if(SINGAL==PC_CLOSE||SINGAL==PC_OPEN)   //网关发送开启和关闭的命令。返回当前位置和电池电量以及自增
        LD        A, S:?b10
        CP        A, #0x1
        JREQ      L:??SendData_1
        TNZ       S:?b10
        JRNE      L:??SendData_2
//  368 	{
//  369                 CarRecDataStr.CmdSource = 1;
??SendData_1:
        MOV       L:CarRecDataStr + 9, #0x1
//  370 		sendstr.CmdLength = 0X10;
        LD        A, #0x10
        LD        (0x5,SP), A
//  371 		*temp++ = 0x10;
        LD        A, #0x10
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  372 		*temp++ = 0XFF;
        LD        A, #0xff
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  373 		*temp++ = CarRecDataStr.LockState;
        LD        A, L:CarRecDataStr + 10
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  374 		*temp++ = CarRecDataStr.AlarmFlag;
        LD        A, L:CarRecDataStr + 7
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  375 		*temp++ = CarRecDataStr.Voltage;
        LD        A, L:CarRecDataStr + 8
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  376 		*temp++ = CarRecDataStr.CmdSource; //命令来源
        LD        A, L:CarRecDataStr + 9
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  377 		memcpy(temp,CarRecDataStr.hmcX,6*sizeof(uint8_t));
        LDW       X, #0x6
        LDW       S:?w0, X
        LDW       Y, #CarRecDataStr + 1
        LDW       X, S:?w4
        CALL      L:memcpy
//  378 		temp = temp + 6;
        LDW       X, S:?w4
        ADDW      X, #0x6
        LDW       S:?w4, X
//  379 		*temp++ = CarRecDataStr.CarState;
        LD        A, L:CarRecDataStr + 11
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  380 		*temp++ = CarRecDataStr.ForKingView;//自增码
        LD        A, L:CarRecDataStr + 12
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  381 
//  382 	}
//  383         if(SINGAL==PC_OPEN_REPORT||SINGAL==PC_CLOSE_REPROT)//车位锁动作后主动上报，待收到网关后停止上报
??SendData_2:
        LD        A, S:?b10
        CP        A, #0x2f
        JREQ      L:??SendData_3
        LD        A, S:?b10
        CP        A, #0x30
        JRNE      L:??SendData_4
//  384         {
//  385                         CarRecDataStr.CmdSource = 0;
??SendData_3:
        MOV       L:CarRecDataStr + 9, #0x0
//  386 			sendstr.CmdLength = 0X10;
        LD        A, #0x10
        LD        (0x5,SP), A
//  387 			*temp++ = 0x0A;
        LD        A, #0xa
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  388 			*temp++ = 0XFF;
        LD        A, #0xff
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  389 			*temp++ = CarRecDataStr.LockState;
        LD        A, L:CarRecDataStr + 10
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  390 			*temp++ = CarRecDataStr.AlarmFlag;
        LD        A, L:CarRecDataStr + 7
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  391 			*temp++ = CarRecDataStr.Voltage;
        LD        A, L:CarRecDataStr + 8
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  392 			*temp++ = CarRecDataStr.CmdSource; //命令来源
        LD        A, L:CarRecDataStr + 9
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  393 			memcpy(temp,CarRecDataStr.hmcX,6*sizeof(uint8_t));
        LDW       X, #0x6
        LDW       S:?w0, X
        LDW       Y, #CarRecDataStr + 1
        LDW       X, S:?w4
        CALL      L:memcpy
//  394 			temp = temp + 6;
        LDW       X, S:?w4
        ADDW      X, #0x6
        LDW       S:?w4, X
//  395 			*temp++ = CarRecDataStr.CarState;
        LD        A, L:CarRecDataStr + 11
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  396 			*temp++ = CarRecDataStr.ForKingView;//自增码
        LD        A, L:CarRecDataStr + 12
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  397         }
//  398 	if(SINGAL==PC_REQ) //参数查询
??SendData_4:
        LD        A, S:?b10
        CP        A, #0x4
        JRNE      L:??SendData_5
//  399 	{
//  400                         CarRecDataStr.CmdSource = 1;
        MOV       L:CarRecDataStr + 9, #0x1
//  401 			sendstr.CmdLength = 0X10;
        LD        A, #0x10
        LD        (0x5,SP), A
//  402 			*temp++ = 0x08;
        LD        A, #0x8
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  403 			*temp++ = 0XFF;
        LD        A, #0xff
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  404 			*temp++ = CarRecDataStr.LockState;
        LD        A, L:CarRecDataStr + 10
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  405 			*temp++ = CarRecDataStr.AlarmFlag;
        LD        A, L:CarRecDataStr + 7
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  406 			*temp++ = CarRecDataStr.Voltage;
        LD        A, L:CarRecDataStr + 8
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  407 			*temp++ = CarRecDataStr.CmdSource; //命令来源
        LD        A, L:CarRecDataStr + 9
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  408 			memcpy(temp,CarRecDataStr.hmcX,6*sizeof(uint8_t));
        LDW       X, #0x6
        LDW       S:?w0, X
        LDW       Y, #CarRecDataStr + 1
        LDW       X, S:?w4
        CALL      L:memcpy
//  409 			temp = temp + 6;
        LDW       X, S:?w4
        ADDW      X, #0x6
        LDW       S:?w4, X
//  410 			*temp++ = CarRecDataStr.CarState;
        LD        A, L:CarRecDataStr + 11
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  411 			*temp++ = CarRecDataStr.ForKingView;//自增码
        LD        A, L:CarRecDataStr + 12
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  412 	}
//  413 	if(SINGAL==ADDED_LOCKID)
??SendData_5:
        LD        A, S:?b10
        CP        A, #0xa
        JRNE      L:??SendData_6
//  414 	{
//  415 
//  416 		sendstr.CmdLength = 0X06;
        LD        A, #0x6
        LD        (0x5,SP), A
//  417 		*temp++ = 0X10;
        LD        A, #0x10
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  418 		*temp++ = 0X00;
        CLR       A
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  419 		memcpy(temp,SystemPara.LockID,2*sizeof(uint8_t));
        LDW       X, #0x2
        LDW       S:?w0, X
        LDW       Y, #SystemPara + 1
        LDW       X, S:?w4
        CALL      L:memcpy
//  420 		*(temp + 2) = CarRecDataStr.ForKingView;
        LD        A, L:CarRecDataStr + 12
        LDW       X, S:?w4
        ADDW      X, #0x2
        LD        (X), A
//  421 	}
//  422 	if(SINGAL==OPT_CONF)
??SendData_6:
        LD        A, S:?b10
        CP        A, #0xe
        JRNE      L:??SendData_7
//  423 	{
//  424 		sendstr.CmdLength = 0X08;
        LD        A, #0x8
        LD        (0x5,SP), A
//  425 		*temp++ = 0X10;
        LD        A, #0x10
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  426 		*temp++ = 0X08;
        LD        A, #0x8
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  427 		memcpy(temp,CarRecDataStr.Opa,4*sizeof(uint8_t));
        LDW       X, #0x4
        LDW       S:?w0, X
        LDW       Y, #CarRecDataStr + 23
        LDW       X, S:?w4
        CALL      L:memcpy
//  428 		*(temp + 4) = CarRecDataStr.ForKingView;
        LD        A, L:CarRecDataStr + 12
        LDW       X, S:?w4
        ADDW      X, #0x4
        LD        (X), A
//  429 	}
//  430 	if(SINGAL==GET_OPT_PA)
??SendData_7:
        LD        A, S:?b10
        CP        A, #0x11
        JRNE      L:??SendData_8
//  431 	{
//  432 		sendstr.CmdLength = 0X08;
        LD        A, #0x8
        LD        (0x5,SP), A
//  433 		*temp++ = 0X08;
        LD        A, #0x8
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  434 		*temp++ = 0X08;
        LD        A, #0x8
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  435 		memcpy(temp,CarRecDataStr.Opa,4*sizeof(uint8_t));
        LDW       X, #0x4
        LDW       S:?w0, X
        LDW       Y, #CarRecDataStr + 23
        LDW       X, S:?w4
        CALL      L:memcpy
//  436 		*(temp + 4) = CarRecDataStr.ForKingView;
        LD        A, L:CarRecDataStr + 12
        LDW       X, S:?w4
        ADDW      X, #0x4
        LD        (X), A
//  437 	}
//  438 	if(SINGAL==GET_ADDED_WL_PC)
??SendData_8:
        LD        A, S:?b10
        CP        A, #0x12
        JRNE      L:??SendData_9
//  439 	{
//  440 		sendstr.CmdLength = 0X07;
        LD        A, #0x7
        LD        (0x5,SP), A
//  441 		*temp++ = 0X08;
        LD        A, #0x8
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  442 		*temp++ = 0X07;
        LD        A, #0x7
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  443 		memcpy(temp,SystemPara.PcID,3*sizeof(uint8_t));
        LDW       X, #0x3
        LDW       S:?w0, X
        LDW       Y, #SystemPara + 5
        LDW       X, S:?w4
        CALL      L:memcpy
//  444 		*(temp + 3) = CarRecDataStr.ForKingView;
        LD        A, L:CarRecDataStr + 12
        LDW       X, S:?w4
        ADDW      X, #0x3
        LD        (X), A
//  445 	}
//  446 	if(SINGAL==PC_OPEN_FAULT)
??SendData_9:
        LD        A, S:?b10
        CP        A, #0x17
        JRNE      L:??SendData_10
//  447 	{
//  448 			sendstr.CmdLength = 0X10;
        LD        A, #0x10
        LD        (0x5,SP), A
//  449 			*temp++ = 0x04;
        LD        A, #0x4
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  450 			*temp++ = 0XFF;
        LD        A, #0xff
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  451 			*temp++ = 0x10;
        LD        A, #0x10
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  452 //			*temp++ = CarRecDataStr.LockState;
//  453 			*temp++ = CarRecDataStr.AlarmFlag;
        LD        A, L:CarRecDataStr + 7
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  454 			*temp++ = CarRecDataStr.Voltage;
        LD        A, L:CarRecDataStr + 8
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  455 			*temp++ = CarRecDataStr.CmdSource; //命令来源
        LD        A, L:CarRecDataStr + 9
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  456 			memcpy(temp,CarRecDataStr.hmcX,6*sizeof(uint8_t));
        LDW       X, #0x6
        LDW       S:?w0, X
        LDW       Y, #CarRecDataStr + 1
        LDW       X, S:?w4
        CALL      L:memcpy
//  457 			temp = temp + 6;
        LDW       X, S:?w4
        ADDW      X, #0x6
        LDW       S:?w4, X
//  458 			*temp++ = CarRecDataStr.CarState;
        LD        A, L:CarRecDataStr + 11
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  459 			*temp++ = CarRecDataStr.ForKingView;//自增码
        LD        A, L:CarRecDataStr + 12
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  460 	}
//  461 	if(SINGAL==PC_CLOSE_FAULT)
??SendData_10:
        LD        A, S:?b10
        CP        A, #0x18
        JRNE      L:??SendData_11
//  462 	{
//  463 			sendstr.CmdLength = 0X10;
        LD        A, #0x10
        LD        (0x5,SP), A
//  464 			*temp++ = 0x04;
        LD        A, #0x4
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  465 			*temp++ = 0XFF;
        LD        A, #0xff
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  466 			*temp++ = 0x11;
        LD        A, #0x11
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  467 //			*temp++ = CarRecDataStr.LockState;
//  468 			*temp++ = CarRecDataStr.AlarmFlag;
        LD        A, L:CarRecDataStr + 7
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  469 			*temp++ = CarRecDataStr.Voltage;
        LD        A, L:CarRecDataStr + 8
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  470 			*temp++ = CarRecDataStr.CmdSource; //命令来源
        LD        A, L:CarRecDataStr + 9
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  471 			memcpy(temp,CarRecDataStr.hmcX,6*sizeof(uint8_t));
        LDW       X, #0x6
        LDW       S:?w0, X
        LDW       Y, #CarRecDataStr + 1
        LDW       X, S:?w4
        CALL      L:memcpy
//  472 			temp = temp + 6;
        LDW       X, S:?w4
        ADDW      X, #0x6
        LDW       S:?w4, X
//  473 			*temp++ = CarRecDataStr.CarState;
        LD        A, L:CarRecDataStr + 11
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  474 			*temp++ = CarRecDataStr.ForKingView;//自增码
        LD        A, L:CarRecDataStr + 12
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  475 	}
//  476 	if(SINGAL==ALARM)
??SendData_11:
        LD        A, S:?b10
        CP        A, #0x22
        JRNE      L:??SendData_12
//  477 	{
//  478 			sendstr.CmdLength = 0X10;
        LD        A, #0x10
        LD        (0x5,SP), A
//  479 			*temp++ = 0x04;
        LD        A, #0x4
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  480 			*temp++ = 0XFF;
        LD        A, #0xff
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  481 			*temp++ = CarRecDataStr.LockState;
        LD        A, L:CarRecDataStr + 10
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  482 			*temp++ = CarRecDataStr.AlarmFlag;
        LD        A, L:CarRecDataStr + 7
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  483 			*temp++ = CarRecDataStr.Voltage;
        LD        A, L:CarRecDataStr + 8
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  484 			*temp++ = CarRecDataStr.CmdSource; //命令来源
        LD        A, L:CarRecDataStr + 9
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  485 			memcpy(temp,CarRecDataStr.hmcX,6*sizeof(uint8_t));
        LDW       X, #0x6
        LDW       S:?w0, X
        LDW       Y, #CarRecDataStr + 1
        LDW       X, S:?w4
        CALL      L:memcpy
//  486 			temp = temp + 6;
        LDW       X, S:?w4
        ADDW      X, #0x6
        LDW       S:?w4, X
//  487 			*temp++ = CarRecDataStr.CarState;
        LD        A, L:CarRecDataStr + 11
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  488 			*temp++ = CarRecDataStr.ForKingView;//自增码
        LD        A, L:CarRecDataStr + 12
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  489 	}
//  490 	if(SINGAL==HAVE_CAR)
??SendData_12:
        LD        A, S:?b10
        CP        A, #0x23
        JRNE      L:??SendData_13
//  491 	{
//  492                         CarRecDataStr.CmdSource = 2;
        MOV       L:CarRecDataStr + 9, #0x2
//  493 			sendstr.CmdLength = 0X10;
        LD        A, #0x10
        LD        (0x5,SP), A
//  494 			*temp++ = 0x04;
        LD        A, #0x4
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  495 			*temp++ = 0XFF;
        LD        A, #0xff
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  496 			*temp++ = CarRecDataStr.LockState;
        LD        A, L:CarRecDataStr + 10
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  497 			*temp++ = CarRecDataStr.AlarmFlag;
        LD        A, L:CarRecDataStr + 7
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  498 			*temp++ = CarRecDataStr.Voltage;
        LD        A, L:CarRecDataStr + 8
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  499 			*temp++ = CarRecDataStr.CmdSource; //命令来源
        LD        A, L:CarRecDataStr + 9
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  500 			memcpy(temp,CarRecDataStr.hmcX,6*sizeof(uint8_t));
        LDW       X, #0x6
        LDW       S:?w0, X
        LDW       Y, #CarRecDataStr + 1
        LDW       X, S:?w4
        CALL      L:memcpy
//  501 			temp = temp + 6;
        LDW       X, S:?w4
        ADDW      X, #0x6
        LDW       S:?w4, X
//  502 			*temp++ = CarRecDataStr.CarState;
        LD        A, L:CarRecDataStr + 11
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  503 			*temp++ = CarRecDataStr.ForKingView;//自增码
        LD        A, L:CarRecDataStr + 12
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  504 	}
//  505 	if(SINGAL==SET_BEEP_0)
??SendData_13:
        LD        A, S:?b10
        CP        A, #0x27
        JRNE      L:??SendData_14
//  506 	{                       
//  507 			sendstr.CmdLength = 0X05;
        LD        A, #0x5
        LD        (0x5,SP), A
//  508 			*temp++ = 0x10;
        LD        A, #0x10
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  509 			*temp++ = 0X09;
        LD        A, #0x9
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  510 			*temp++ = 0;
        CLR       A
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  511 			*temp++ = CarRecDataStr.ForKingView;
        LD        A, L:CarRecDataStr + 12
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  512 	}
//  513 	if(SINGAL==SET_CAR_NO_STATE)
??SendData_14:
        LD        A, S:?b10
        CP        A, #0x2b
        JRNE      L:??SendData_15
//  514 	{
//  515 			sendstr.CmdLength = 0X05;
        LD        A, #0x5
        LD        (0x5,SP), A
//  516 			*temp++ = 0x10;
        LD        A, #0x10
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  517 			*temp++ = 0X0E;
        LD        A, #0xe
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  518 			*temp++ = 0;
        CLR       A
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  519 			*temp++ = CarRecDataStr.ForKingView;
        LD        A, L:CarRecDataStr + 12
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  520 	}
//  521 	if(SINGAL==SET_CAR_YES_STATE)
??SendData_15:
        LD        A, S:?b10
        CP        A, #0x2c
        JRNE      L:??SendData_16
//  522 	{
//  523 			sendstr.CmdLength = 0X05;
        LD        A, #0x5
        LD        (0x5,SP), A
//  524 			*temp++ = 0x10;
        LD        A, #0x10
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  525 			*temp++ = 0X0E;
        LD        A, #0xe
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  526 			*temp++ = 1;
        LD        A, #0x1
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  527 			*temp++ = CarRecDataStr.ForKingView;
        LD        A, L:CarRecDataStr + 12
        LD        [S:?w4.w], A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  528 	}
//  529 	//公共部分
//  530         int i = 0;
??SendData_16:
        CLRW      Y
//  531 	temp = &sendstr.LockId[0];
        LDW       X, SP
        ADDW      X, #0x6
        LDW       S:?w4, X
//  532 	for(i=0;i<sendstr.CmdLength;i++)
        CLRW      X
        LDW       Y, X
        JRA       L:??SendData_17
//  533 	{
//  534 		sendstr.CheckSum += *temp++;
??SendData_18:
        LD        A, [S:?w4.w]
        ADD       A, (0x1c,SP)
        LD        (0x1c,SP), A
        LDW       X, S:?w4
        INCW      X
        LDW       S:?w4, X
//  535 	}
        LDW       X, Y
        INCW      X
        LDW       Y, X
??SendData_17:
        LD        A, (0x5,SP)
        CLRW      X
        LD        XL, A
        LDW       S:?w0, X
        CPW       Y, S:?w0
        JRSLT     L:??SendData_18
//  536 	SX78Str.SX7xTxFlag = TRUE;
        MOV       L:SX78Str + 3, #0x1
//  537 	SX78Str.SX7xCmd = CmdTX;
        MOV       L:SX78Str + 8, #0x2
//  538         SX78Str.SX7xTxlen = (sendstr.CmdLength + 3 + 1 + 1 + 1 +1);
        LD        A, (0x5,SP)
        CLRW      X
        LD        XL, A
        ADDW      X, #0x7
        LDW       L:SX78Str + 275, X
//  539 	memcpy(SX78Str.SX7xTxStr,sendstr.WireId,SX78Str.SX7xTxlen-2);
        LDW       X, L:SX78Str + 275
        DECW      X
        DECW      X
        LDW       S:?w0, X
        LDW       Y, SP
        ADDW      Y, #0x1
        LDW       X, #SX78Str + 277
        CALL      L:memcpy
//  540         SX78Str.SX7xTxStr[SX78Str.SX7xTxlen -2] = sendstr.CheckSum;
        LDW       X, L:SX78Str + 275
        ADDW      X, #SX78Str + 275
        LD        A, (0x1c,SP)
        LD        (X), A
//  541 	SX78Str.SX7xTxStr[SX78Str.SX7xTxlen -1] = 0x7D;
        LDW       X, L:SX78Str + 275
        ADDW      X, #SX78Str + 276
        LD        A, #0x7d
        LD        (X), A
//  542         asm("NOP;");
        NOP;
//  543 }
        ADD       SP, #0x1d
        POP       S:?b10
        JP        L:?epilogue_w4
//  544 

        SECTION `.near_func.text`:CODE:REORDER:NOROOT(0)
        CODE
//  545 void CycleDetection(void)
//  546 {
//  547       if(CycleDetectionTime)return;
CycleDetection:
        LD        A, L:CycleDetectionTime
        CP        A, #0x0
        JREQ      ??lb_0
        JP        L:??CycleDetection_0
//  548       CycleDetectionTime = 10;
??lb_0:
        MOV       L:CycleDetectionTime, #0xa
//  549       if(LIMIT_READ)CarRecDataStr.LockState = 1;
        LD        A, #0x1
        LDW       X, #0x5005
        CALL      L:GPIO_ReadInputDataBit
        CP        A, #0x0
        JREQ      L:??CycleDetection_1
        MOV       L:CarRecDataStr + 10, #0x1
        JRA       L:??CycleDetection_2
//  550       else
//  551         CarRecDataStr.LockState = 0;
??CycleDetection_1:
        MOV       L:CarRecDataStr + 10, #0x0
//  552       if(QMC5883LStr.DataOkFlag == 0)return;
??CycleDetection_2:
        LD        A, L:QMC5883LStr
        CP        A, #0x0
        JRNE      ??lb_1
        JP        L:??CycleDetection_0
//  553       if((LockCarState.HostReportFlag==1)&&(LockCarState.MotorCmd==CmdIdle))
??lb_1:
        LD        A, L:LockCarState
        CP        A, #0x1
        JRNE      L:??CycleDetection_3
        LD        A, L:LockCarState + 4
        CP        A, #0x0
        JRNE      L:??CycleDetection_3
//  554       {
//  555           LockCarState.HostReportFlag = 0;
        MOV       L:LockCarState, #0x0
//  556           if((LockCarState.MotorActResults == RISE_OK)||(LockCarState.MotorActResults == FALL_OK))
        LD        A, L:LockCarState + 5
        CP        A, #0x1
        JREQ      L:??CycleDetection_4
        LD        A, L:LockCarState + 5
        CP        A, #0x2
        JRNE      L:??CycleDetection_5
//  557           {
//  558               CarRecDataStr.CarState = 0;
??CycleDetection_4:
        MOV       L:CarRecDataStr + 11, #0x0
//  559               SendData(PC_OPEN_REPORT);
        LD        A, #0x2f
        CALL      L:SendData
//  560               if(LockCarState.MotorActResults == FALL_OK)
        LD        A, L:LockCarState + 5
        CP        A, #0x2
        JRNE      L:??CycleDetection_5
//  561               {
//  562                   QMC5883LStr.DataOkFlag = 0;
        MOV       L:QMC5883LStr, #0x0
//  563                   //memcpy(QMC5883LStr.QMC_BASE,QMC5883LStr.QMC_CUR,3*sizeof(int16_t));
//  564                   //BeepStart(1,0);
//  565               }
//  566           }
//  567           if(LockCarState.MotorActResults == RISE_ERROR)
??CycleDetection_5:
        LD        A, L:LockCarState + 5
        CP        A, #0x3
        JRNE      L:??CycleDetection_6
//  568           {
//  569               CarRecDataStr.CarState = 1;
        MOV       L:CarRecDataStr + 11, #0x1
//  570               SendData(PC_CLOSE_FAULT);
        LD        A, #0x18
        CALL      L:SendData
//  571           }
//  572           if(LockCarState.MotorActResults == FALL_ERROR)
??CycleDetection_6:
        LD        A, L:LockCarState + 5
        CP        A, #0x4
        JRNE      L:??CycleDetection_3
//  573           {
//  574               SendData(PC_OPEN_FAULT);
        LD        A, #0x17
        CALL      L:SendData
//  575           }
//  576       }
//  577       if((LockCarState.MotorActResults == RISE_OK)||(LockCarState.MotorActResults == FALL_ERROR))
??CycleDetection_3:
        LD        A, L:LockCarState + 5
        CP        A, #0x1
        JREQ      L:??CycleDetection_7
        LD        A, L:LockCarState + 5
        CP        A, #0x4
        JRNE      L:??CycleDetection_0
//  578       {
//  579           static uint8_t temp = 0;
//  580           if((CarRecDataStr.LockState == 0)&&(temp==0)&&(LockCarState.MotorCmd==CmdIdle))
??CycleDetection_7:
        LD        A, L:CarRecDataStr + 10
        CP        A, #0x0
        JRNE      L:??CycleDetection_8
        LD        A, L:??temp
        CP        A, #0x0
        JRNE      L:??CycleDetection_8
        LD        A, L:LockCarState + 4
        CP        A, #0x0
        JRNE      L:??CycleDetection_8
//  581           {
//  582             temp = 1;
        MOV       L:??temp, #0x1
//  583             SendData(ALARM);
        LD        A, #0x22
        CALL      L:SendData
//  584             BeepStart(5,1);
        LD        A, #0x1
        LDW       X, #0x5
        LDW       S:?w1, X
        CLRW      X
        LDW       S:?w0, X
        JP        L:BeepStart
//  585           }
//  586           else if(CarRecDataStr.LockState == 1)
??CycleDetection_8:
        LD        A, L:CarRecDataStr + 10
        CP        A, #0x1
        JRNE      L:??CycleDetection_0
//  587           {
//  588             if(UserBeep.Model==1)BeepStop();
        LD        A, L:UserBeep + 1
        CP        A, #0x1
        JRNE      L:??CycleDetection_9
        CALL      L:BeepStop
//  589             temp = 0;
??CycleDetection_9:
        MOV       L:??temp, #0x0
//  590           }
//  591       }
//  592 
//  593 }
??CycleDetection_0:
        RET

        SECTION `.near.bss`:DATA:REORDER:NOROOT(0)
??temp:
        DS8 1

        SECTION VREGS:DATA:REORDER:NOROOT(0)

        SECTION `.near.rodata`:CONST:REORDER:NOROOT(0)
?_0:
        DC8 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
        DC8 0, 0

        SECTION `.near.rodata`:CONST:REORDER:NOROOT(0)
?_1:
        DC8 53, 25, 19

        SECTION `.near.rodata`:CONST:REORDER:NOROOT(0)
?_2:
        DC8 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
        DC8 0, 0, 0, 0, 0, 0

        END
//  594 
//  595 
// 
//    66 bytes in section .near.bss
//    57 bytes in section .near.rodata
// 3 069 bytes in section .near_func.text
// 
// 3 069 bytes of CODE  memory
//    57 bytes of CONST memory
//    66 bytes of DATA  memory
//
//Errors: none
//Warnings: 18
