1 Star 0 Fork 1

tangwei_509/白马中餐柜

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
cmd_queue.lis 26.26 KB
一键复制 编辑 原始数据 按行查看 历史
tangwei_509 提交于 2018-11-29 14:26 . 项目的建立。
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
.module cmd_queue.c
.area text(rom, con, rel)
0000 .dbfile cmd_queue.c
.area data(ram, con, rel)
0000 .dbfile cmd_queue.c
0000 _que::
0000 .blkb 1
.area idata
0000 00 .byte 0
.area data(ram, con, rel)
0001 .dbfile cmd_queue.c
0001 .blkb 1
.area idata
0001 00 .byte 0
.area data(ram, con, rel)
0002 .dbfile cmd_queue.c
0002 .blkb 2
.area idata
0002 0000 .byte 0,0
.area data(ram, con, rel)
0004 .dbfile cmd_queue.c
0004 .blkb 2
.area idata
0004 0000 .byte 0,0
.area data(ram, con, rel)
0006 .dbfile cmd_queue.c
0006 .blkb 251
.area idata
0006 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 .word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0042 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 .word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
007E 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 .word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
00BA 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 .word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
00F6 00000000000000000000 .word 0,0,0,0,0
0100 00 .byte 0
.area data(ram, con, rel)
0101 .dbfile cmd_queue.c
0101 .blkb 4
.area idata
0101 00000000 .byte 0,0,0,0
.area data(ram, con, rel)
0105 .dbfile cmd_queue.c
0105 .dbfile E:\彩耘项目\白马_中餐柜\白马_电控锁软件\cmd_queue.c
0105 .dbstruct 0 261 _QUEUE
0105 .dbfield 0 _head c
0105 .dbfield 1 _tail c
0105 .dbfield 2 _data A[255:255]c
0105 .dbfield 257 head_state A[2:2]c
0105 .dbfield 259 tail_state A[2:2]c
0105 .dbend
0105 .dbsym e que _que S[_QUEUE]
0105 _cmd_pos:
0105 .blkb 2
.area idata
0105 0000 .word 0
.area data(ram, con, rel)
0107 .dbfile E:\彩耘项目\白马_中餐柜\白马_电控锁软件\cmd_queue.c
0107 .dbsym s cmd_pos _cmd_pos s
.area text(rom, con, rel)
0000 .dbfile E:\彩耘项目\白马_中餐柜\白马_电控锁软件\cmd_queue.c
0000 .dbfunc e Number_XOR8 _Number_XOR8 fc
0000 ; result -> R10
0000 ; xor_cnt -> R22
0000 ; i -> R20
0000 ; size -> R18
0000 ; buffer -> R16,R17
.even
0000 _Number_XOR8::
0000 00D0 rcall push_xgsetF00C
0002 .dbline -1
0002 .dbline 22
0002 ; /************************************版权申明********************************************
0002 ; **-----------------------------------文件信息--------------------------------------------
0002 ; ** 文件名称: cmd_queue.c
0002 ; ** 修改时间: 2018-05-18
0002 ; ** 文件说明: 用户MCU串口驱动函数库
0002 ; --------------------------------------------------------------------------------------
0002 ; ----------------------------------------------------------------------------------------*/
0002 ; #include "cmd_queue.h"
0002 ;
0002 ; QUEUE que = {0,0,0,0,0,0}; //指令队列
0002 ;
0002 ; static qsize cmd_pos = 0; //当前指令指针位置
0002 ; //计算数组中的 XOR8 校验
0002 ; /*
0002 ; * \brief 计算数组中的 XOR8 校验
0002 ; * \detial 串口接收的数据,通过此函数计算校验码
0002 ; * \param buffer 指令数据
0002 ; * \param buffer 指令数据长度
0002 ; * \return 计算得到的校验码
0002 ; */
0002 ; uint8_t Number_XOR8(uint8_t *buffer,uint8_t size)
0002 ; {
0002 .dbline 23
0002 ; uint8_t result = 0;
0002 AA24 clr R10
0004 .dbline 24
0004 ; uint8_t xor_cnt= 0x00;
0004 .dbline 26
0004 ; uint8_t i;
0004 ; xor_cnt = buffer[2] + 3 ;
0004 F801 movw R30,R16
0006 6281 ldd R22,z+2
0008 6D5F subi R22,253 ; addi 3
000A .dbline 27
000A ; if(size > 7){
000A 87E0 ldi R24,7
000C 8217 cp R24,R18
000E 68F4 brsh L2
0010 X0:
0010 .dbline 27
0010 .dbline 28
0010 ; for(i = 2; i < xor_cnt; i++){ //从第2位开始 到最后第三位
0010 42E0 ldi R20,2
0012 07C0 rjmp L7
0014 L4:
0014 .dbline 28
0014 .dbline 29
0014 ; result ^= *(buffer+i);
0014 E42F mov R30,R20
0016 FF27 clr R31
0018 E00F add R30,R16
001A F11F adc R31,R17
001C 2080 ldd R2,z+0
001E A224 eor R10,R2
0020 .dbline 30
0020 ; }
0020 L5:
0020 .dbline 28
0020 4395 inc R20
0022 L7:
0022 .dbline 28
0022 4617 cp R20,R22
0024 B8F3 brlo L4
0026 X1:
0026 .dbline 31
0026 ; return result;
0026 0A2D mov R16,R10
0028 01C0 rjmp L1
002A L2:
002A .dbline 33
002A ; }
002A ; return 0;
002A 0027 clr R16
002C .dbline -2
002C L1:
002C .dbline 0 ; func end
002C 00C0 rjmp pop_xgsetF00C
002E .dbsym r result 10 c
002E .dbsym r xor_cnt 22 c
002E .dbsym r i 20 c
002E .dbsym r size 18 c
002E .dbsym r buffer 16 pc
002E .dbend
002E .dbfunc e Check_XOR8 _Check_XOR8 fc
002E ; i -> <dead>
002E ; xor_cnt -> R14
002E ; result -> R10
002E ; XOR8_tmep -> R20
002E ; size -> R12
002E ; buffer -> R22,R23
.even
002E _Check_XOR8::
002E 00D0 rcall push_xgsetF0FC
0030 C22E mov R12,R18
0032 B801 movw R22,R16
0034 .dbline -1
0034 .dbline 45
0034 ; }
0034 ;
0034 ; //校验 数组中的 XOR8
0034 ; /*!
0034 ; * \brief 校验 数组中的 XOR8
0034 ; * \detial 串口接收的数据,通过此函数计算校验码
0034 ; * \param buffer 指令数据
0034 ; * \param buffer 指令数据长度
0034 ; * \return 匹配是否成功 0:失败 1:成功
0034 ; */
0034 ; uint8_t Check_XOR8(uint8_t *buffer,uint8_t size)
0034 ; {
0034 .dbline 46
0034 ; uint8_t XOR8_tmep = 0xFF;
0034 4FEF ldi R20,255
0036 .dbline 47
0036 ; uint8_t result = 0x00;
0036 AA24 clr R10
0038 .dbline 48
0038 ; uint8_t xor_cnt= 0x00;
0038 EE24 clr R14
003A .dbline 50
003A ; uint8_t i;
003A ; if(size > 7)
003A 87E0 ldi R24,7
003C 8C15 cp R24,R12
003E 50F4 brsh L9
0040 X2:
0040 .dbline 51
0040 ; {
0040 .dbline 52
0040 ; XOR8_tmep = buffer[buffer[2]+3]; //缓存校验码
0040 FB01 movw R30,R22
0042 E281 ldd R30,z+2
0044 FF27 clr R31
0046 E60F add R30,R22
0048 F71F adc R31,R23
004A 4381 ldd R20,z+3
004C .dbline 53
004C ; result = Number_XOR8(buffer,size); //计算xor校验
004C 2C2D mov R18,R12
004E 8B01 movw R16,R22
0050 D7DF rcall _Number_XOR8
0052 A02E mov R10,R16
0054 .dbline 54
0054 ; }
0054 L9:
0054 .dbline 55
0054 ; return (result == XOR8_tmep);
0054 A416 cp R10,R20
0056 19F4 brne L11
0058 X3:
0058 41E0 ldi R20,1
005A 50E0 ldi R21,0
005C 02C0 rjmp L12
005E L11:
005E 4427 clr R20
0060 5527 clr R21
0062 L12:
0062 042F mov R16,R20
0064 .dbline -2
0064 L8:
0064 .dbline 0 ; func end
0064 00C0 rjmp pop_xgsetF0FC
0066 .dbsym l i 1 c
0066 .dbsym r xor_cnt 14 c
0066 .dbsym r result 10 c
0066 .dbsym r XOR8_tmep 20 c
0066 .dbsym r size 12 c
0066 .dbsym r buffer 22 pc
0066 .dbend
0066 .dbfunc e queue_reset _queue_reset fV
0066 ; queue -> R16,R17
.even
0066 _queue_reset::
0066 .dbline -1
0066 .dbline 62
0066 ; }
0066 ;
0066 ; /*!
0066 ; * \brief 清空指令数据
0066 ; */
0066 ; void queue_reset(QUEUE * queue)
0066 ; {
0066 .dbline 63
0066 ; queue->_head = queue->_tail = 0;
0066 2224 clr R2
0068 F801 movw R30,R16
006A 2182 std z+1,R2
006C 2082 std z+0,R2
006E .dbline 64
006E ; cmd_pos = queue->tail_state[0] = queue->head_state[0]= 0;
006E EF5F subi R30,255 ; addi 257
0070 FE4F sbci R31,254
0072 2082 std z+0,R2
0074 E150 subi R30,1
0076 F140 sbci R31,1
0078 ED5F subi R30,253 ; addi 259
007A FE4F sbci R31,254
007C 2082 std z+0,R2
007E 3324 clr R3
0080 30920601 sts _cmd_pos+1,R3
0084 20920501 sts _cmd_pos,R2
0088 .dbline -2
0088 L13:
0088 .dbline 0 ; func end
0088 0895 ret
008A .dbsym r queue 16 pS[_QUEUE]
008A .dbend
008A .dbfunc e queue_push _queue_push fV
008A ; pos -> R10,R11
008A ; _data -> R12
008A ; queue -> R20,R21
.even
008A _queue_push::
008A 00D0 rcall push_xgset303C
008C C22E mov R12,R18
008E A801 movw R20,R16
0090 .dbline -1
0090 .dbline 74
0090 ; }
0090 ;
0090 ; /*!
0090 ; * \brief 添加指令数据
0090 ; * \detial 串口接收的数据,通过此函数放入指令队列
0090 ; * \param _data 指令数据
0090 ; */
0090 ;
0090 ; void queue_push(QUEUE * queue,qdata _data)
0090 ; {
0090 .dbline 75
0090 ; qsize pos = (queue->_head+1)%QUEUE_MAX_SIZE;
0090 2FEF ldi R18,255
0092 30E0 ldi R19,0
0094 FA01 movw R30,R20
0096 0081 ldd R16,z+0
0098 1127 clr R17
009A 0F5F subi R16,255 ; offset = 1
009C 1F4F sbci R17,255
009E 00D0 rcall mod16s
00A0 5801 movw R10,R16
00A2 .dbline 76
00A2 ; if(pos!=queue->_tail) //非满状态
00A2 FA01 movw R30,R20
00A4 2180 ldd R2,z+1
00A6 3324 clr R3
00A8 0215 cp R16,R2
00AA 1305 cpc R17,R3
00AC 49F0 breq L15
00AE X4:
00AE .dbline 77
00AE ; {
00AE .dbline 78
00AE ; queue->_data[queue->_head] = _data;
00AE CF01 movw R24,R30
00B0 0296 adiw R24,2
00B2 E081 ldd R30,z+0
00B4 FF27 clr R31
00B6 E80F add R30,R24
00B8 F91F adc R31,R25
00BA C082 std z+0,R12
00BC .dbline 79
00BC ; queue->_head = pos;
00BC FA01 movw R30,R20
00BE A082 std z+0,R10
00C0 .dbline 80
00C0 ; }
00C0 L15:
00C0 .dbline -2
00C0 L14:
00C0 .dbline 0 ; func end
00C0 00C0 rjmp pop_xgset303C
00C2 .dbsym r pos 10 s
00C2 .dbsym r _data 12 c
00C2 .dbsym r queue 20 pS[_QUEUE]
00C2 .dbend
00C2 .dbfunc s queue_pop _queue_pop fV
00C2 ; _data -> R10,R11
00C2 ; queue -> R20,R21
.even
00C2 _queue_pop:
00C2 00D0 rcall push_xgset300C
00C4 5901 movw R10,R18
00C6 A801 movw R20,R16
00C8 .dbline -1
00C8 .dbline 85
00C8 ; }
00C8 ;
00C8 ; //从队列中取一个数据
00C8 ; static void queue_pop(QUEUE * queue,qdata* _data)
00C8 ; {
00C8 .dbline 86
00C8 ; if(queue->_tail != queue->_head) //非空状态
00C8 FA01 movw R30,R20
00CA 2080 ldd R2,z+0
00CC 3180 ldd R3,z+1
00CE 3214 cp R3,R2
00D0 91F0 breq L18
00D2 X5:
00D2 .dbline 87
00D2 ; {
00D2 .dbline 88
00D2 ; *_data = queue->_data[queue->_tail];
00D2 CF01 movw R24,R30
00D4 0296 adiw R24,2
00D6 E181 ldd R30,z+1
00D8 FF27 clr R31
00DA E80F add R30,R24
00DC F91F adc R31,R25
00DE 2080 ldd R2,z+0
00E0 F501 movw R30,R10
00E2 2082 std z+0,R2
00E4 .dbline 89
00E4 ; queue->_tail = (queue->_tail+1)%QUEUE_MAX_SIZE;
00E4 CA01 movw R24,R20
00E6 0196 adiw R24,1
00E8 1FEF ldi R17,255
00EA FC01 movw R30,R24
00EC 0081 ldd R16,z+0
00EE 0F5F subi R16,255 ; addi 1
00F0 00D0 rcall mod8u
00F2 FC01 movw R30,R24
00F4 0083 std z+0,R16
00F6 .dbline 90
00F6 ; }
00F6 L18:
00F6 .dbline -2
00F6 L17:
00F6 .dbline 0 ; func end
00F6 00C0 rjmp pop_xgset300C
00F8 .dbsym r _data 10 pc
00F8 .dbsym r queue 20 pS[_QUEUE]
00F8 .dbend
00F8 .dbfunc s queue_size _queue_size fc
00F8 ; queue -> R20,R21
.even
00F8 _queue_size:
00F8 4A93 st -y,R20
00FA 5A93 st -y,R21
00FC A801 movw R20,R16
00FE .dbline -1
00FE .dbline 95
00FE ; }
00FE ;
00FE ; //获取队列中有效数据个数
00FE ; static qdata queue_size(QUEUE * queue)
00FE ; {
00FE .dbline 96
00FE ; return ((queue->_head+QUEUE_MAX_SIZE-queue->_tail)%QUEUE_MAX_SIZE);
00FE FA01 movw R30,R20
0100 2180 ldd R2,z+1
0102 0081 ldd R16,z+0
0104 0150 subi R16,1 ; addi 255
0106 0219 sub R16,R2
0108 1FEF ldi R17,255
010A 00D0 rcall mod8u
010C .dbline -2
010C L20:
010C .dbline 0 ; func end
010C 5991 ld R21,y+
010E 4991 ld R20,y+
0110 0895 ret
0112 .dbsym r queue 20 pS[_QUEUE]
0112 .dbend
0112 .dbfunc e lock_queue_find_cmd _lock_queue_find_cmd fc
0112 ; cmd_size -> R10
0112 ; _data -> y+0
0112 ; buf_len -> R12
0112 ; buffer -> R20,R21
.even
0112 _lock_queue_find_cmd::
0112 00D0 rcall push_xgsetF0FC
0114 C22E mov R12,R18
0116 A801 movw R20,R16
0118 2197 sbiw R28,1
011A .dbline -1
011A .dbline 105
011A ; }
011A ; /*!
011A ; * \brief 从指令队列中取出一条完整的指令
011A ; * \param cmd 指令接收缓存区
011A ; * \param buf_len 指令接收缓存区大小
011A ; * \return 指令长度,0表示队列中无完整指令
011A ; */
011A ; qdata lock_queue_find_cmd(qdata *buffer,qdata buf_len)
011A ; {
011A .dbline 106
011A ; qdata _data = 0;
011A 2224 clr R2
011C 2882 std y+0,R2
011E .dbline 107
011E ; qdata cmd_size = 0;
011E AA24 clr R10
0120 79C0 rjmp L23
0122 L22:
0122 .dbline 109
0122 ; while(queue_size(&que)>0)
0122 ; {
0122 .dbline 111
0122 ; //取一个数据
0122 ; queue_pop(&que,&_data);
0122 9E01 movw R18,R28
0124 00E0 ldi R16,<_que
0126 10E0 ldi R17,>_que
0128 CCDF rcall _queue_pop
012A .dbline 112
012A ; if(cmd_pos==0) //指令第一个字节必须是帧头,否则跳过
012A 20900501 lds R2,_cmd_pos
012E 30900601 lds R3,_cmd_pos+1
0132 2220 tst R2
0134 09F5 brne L25
0136 3320 tst R3
0138 F9F4 brne L25
013A X6:
013A .dbline 113
013A ; {
013A .dbline 114
013A ; que.head_state[1] = que.head_state[0];
013A 20900101 lds R2,_que+257
013E 20920201 sts _que+257+1,R2
0142 .dbline 115
0142 ; que.head_state[0] = ( _data );
0142 2880 ldd R2,y+0
0144 20920101 sts _que+257,R2
0148 .dbline 116
0148 ; if( que.head_state[1] != 0x5C && que.head_state[0] != 0xC5){
0148 80910201 lds R24,_que+257+1
014C 8C35 cpi R24,92
014E 21F0 breq L31
0150 X7:
0150 822D mov R24,R2
0152 853C cpi R24,197
0154 09F0 breq L31
0156 X8:
0156 .dbline 116
0156 .dbline 117
0156 ; continue;
0156 5EC0 rjmp L23
0158 L31:
0158 .dbline 119
0158 ; }
0158 ; buffer[cmd_pos++] = que.head_state[1];
0158 20900501 lds R2,_cmd_pos
015C 30900601 lds R3,_cmd_pos+1
0160 C101 movw R24,R2
0162 0196 adiw R24,1
0164 90930601 sts _cmd_pos+1,R25
0168 80930501 sts _cmd_pos,R24
016C F101 movw R30,R2
016E E40F add R30,R20
0170 F51F adc R31,R21
0172 20900201 lds R2,_que+257+1
0176 2082 std z+0,R2
0178 .dbline 120
0178 ; }
0178 L25:
0178 .dbline 121
0178 ; if(cmd_pos < buf_len){ //防止缓冲区溢出
0178 2C2C mov R2,R12
017A 3324 clr R3
017C 40900501 lds R4,_cmd_pos
0180 50900601 lds R5,_cmd_pos+1
0184 4214 cp R4,R2
0186 5304 cpc R5,R3
0188 58F4 brsh L38
018A X9:
018A .dbline 121
018A .dbline 122
018A ; buffer[cmd_pos++] = _data;
018A C201 movw R24,R4
018C 0196 adiw R24,1
018E 90930601 sts _cmd_pos+1,R25
0192 80930501 sts _cmd_pos,R24
0196 F201 movw R30,R4
0198 E40F add R30,R20
019A F51F adc R31,R21
019C 2880 ldd R2,y+0
019E 2082 std z+0,R2
01A0 .dbline 123
01A0 ; }
01A0 L38:
01A0 .dbline 124
01A0 ; que.tail_state[1] = que.tail_state[0];
01A0 20900301 lds R2,_que+259
01A4 20920401 sts _que+259+1,R2
01A8 .dbline 125
01A8 ; que.tail_state[0] = ( _data );
01A8 2880 ldd R2,y+0
01AA 20920301 sts _que+259,R2
01AE .dbline 126
01AE ; if( (que.tail_state[1] == 0x0D && que.tail_state[0] == 0x0A ) //最后2个字节与帧尾匹配,得到完整帧
01AE 80910401 lds R24,_que+259+1
01B2 8D30 cpi R24,13
01B4 19F4 brne L50
01B6 X10:
01B6 822D mov R24,R2
01B8 8A30 cpi R24,10
01BA 81F0 breq L49
01BC X11:
01BC L50:
01BC FA01 movw R30,R20
01BE 6281 ldd R22,z+2
01C0 7727 clr R23
01C2 80910501 lds R24,_cmd_pos
01C6 90910601 lds R25,_cmd_pos+1
01CA 0197 sbiw R24,1
01CC E62F mov R30,R22
01CE FF27 clr R31
01D0 3396 adiw R30,3
01D2 E817 cp R30,R24
01D4 F907 cpc R31,R25
01D6 F1F4 brne L44
01D8 X12:
01D8 6530 cpi R22,5
01DA E0F0 brlo L44
01DC X13:
01DC L49:
01DC .dbline 128
01DC ; ||( buffer[2] + 3 == cmd_pos-1 && buffer[2] >= 5 )) //数据长度达到指令需求
01DC ; {
01DC .dbline 129
01DC ; cmd_size = cmd_pos ;
01DC A0900501 lds R10,_cmd_pos
01E0 B0900601 lds R11,_cmd_pos+1
01E4 .dbline 130
01E4 ; que.head_state[0] = 0; //重新检测帧头
01E4 2224 clr R2
01E6 20920101 sts _que+257,R2
01EA .dbline 131
01EA ; que.head_state[1] = 0; //重新检测帧头
01EA 20920201 sts _que+257+1,R2
01EE .dbline 132
01EE ; que.tail_state[0] = 0; //重新检测帧尾
01EE 20920301 sts _que+259,R2
01F2 .dbline 133
01F2 ; que.tail_state[1] = 0; //重新检测帧尾
01F2 20920401 sts _que+259+1,R2
01F6 .dbline 134
01F6 ; cmd_pos = 0; //复位指令指针
01F6 3324 clr R3
01F8 30920601 sts _cmd_pos+1,R3
01FC 20920501 sts _cmd_pos,R2
0200 .dbline 135
0200 ; if(!Check_XOR8(buffer,cmd_size)){ return 0; } //XOR8校验
0200 2A2D mov R18,R10
0202 8A01 movw R16,R20
0204 14DF rcall _Check_XOR8
0206 E02E mov R14,R16
0208 0023 tst R16
020A 11F4 brne L57
020C X14:
020C .dbline 135
020C .dbline 135
020C 0027 clr R16
020E 0BC0 rjmp L21
0210 L57:
0210 .dbline 136
0210 ; return cmd_size;
0210 0A2D mov R16,R10
0212 09C0 rjmp L21
0214 L44:
0214 .dbline 138
0214 ; }
0214 ; }
0214 L23:
0214 .dbline 108
0214 00E0 ldi R16,<_que
0216 10E0 ldi R17,>_que
0218 6FDF rcall _queue_size
021A A02E mov R10,R16
021C 80E0 ldi R24,0
021E 8017 cp R24,R16
0220 08F4 brsh X16
0222 7FCF rjmp L22
0224 X16:
0224 X15:
0224 .dbline 139
0224 ; return 0; //没有形成完整的一帧
0224 0027 clr R16
0226 .dbline -2
0226 L21:
0226 .dbline 0 ; func end
0226 2196 adiw R28,1
0228 00C0 rjmp pop_xgsetF0FC
022A .dbsym r cmd_size 10 c
022A .dbsym l _data 0 c
022A .dbsym r buf_len 12 c
022A .dbsym r buffer 20 pc
022A .dbend
022A ; }
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/tangwei_509/white_horse_lunch_box.git
git@gitee.com:tangwei_509/white_horse_lunch_box.git
tangwei_509
white_horse_lunch_box
白马中餐柜
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385