📄 main.s
字号:
; }
; }
.dbline 224
; }
; }
; }
; }
ldi R24,85
sts _bBusy,R24
.dbline 226
; }
; }
ldi R22,<_ComTxBuf
ldi R23,>_ComTxBuf
.dbline 228
; }
; }
clr R10
.dbline 229
; }
clr R20
xjmp L86
L83:
.dbline 230
.dbline 231
sts _nrfTxBuf,R20
.dbline 232
clr R2
sts _nrfTxBuf+1,R2
.dbline 233
ldi R24,2
std y+0,R24
ldi R18,<_nrfRxBuf
ldi R19,>_nrfRxBuf
ldi R16,<_nrfTxBuf
ldi R17,>_nrfTxBuf
xcall _SPI_SendData
.dbline 235
movw R30,R22
st Z+,R20
.dbline 236
inc R10
.dbline 243
lds R2,_nrfRxBuf+1
st Z+,R2
movw R22,R30
.dbline 244
inc R10
.dbline 245
L84:
.dbline 229
inc R20
L86:
.dbline 229
cpi R20,10
brlo L83
.dbline 247
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
ldi R20,10
xjmp L92
L89:
.dbline 248
; }
.dbline 249
; }
sts _nrfTxBuf,R20
.dbline 250
; }
clr R2
sts _nrfTxBuf+1,R2
.dbline 251
; }
sts _nrfTxBuf+2,R2
.dbline 252
; }
sts _nrfTxBuf+3,R2
.dbline 253
; }
sts _nrfTxBuf+4,R2
.dbline 254
; }
sts _nrfTxBuf+5,R2
.dbline 255
; }
ldi R24,6
std y+0,R24
ldi R18,<_nrfRxBuf
ldi R19,>_nrfRxBuf
ldi R16,<_nrfTxBuf
ldi R17,>_nrfTxBuf
xcall _SPI_SendData
.dbline 257
; }
; }
movw R30,R22
st Z+,R20
movw R22,R30
.dbline 258
; }
inc R10
.dbline 260
; }
; }
clr R12
inc R12
xjmp L101
L98:
.dbline 261
.dbline 262
ldi R24,<_nrfRxBuf
ldi R25,>_nrfRxBuf
mov R30,R12
clr R31
add R30,R24
adc R31,R25
ldd R2,z+0
movw R30,R22
st Z+,R2
movw R22,R30
.dbline 263
inc R10
.dbline 264
L99:
.dbline 260
inc R12
L101:
.dbline 260
mov R24,R12
cpi R24,6
brlo L98
.dbline 265
L90:
.dbline 247
inc R20
L92:
.dbline 247
cpi R20,12
brlo L89
.dbline 267
; }
; }
; }
; }
; }
; }
; }
ldi R20,12
xjmp L105
L102:
.dbline 268
.dbline 269
sts _nrfTxBuf,R20
.dbline 270
clr R2
sts _nrfTxBuf+1,R2
.dbline 271
ldi R24,2
std y+0,R24
ldi R18,<_nrfRxBuf
ldi R19,>_nrfRxBuf
ldi R16,<_nrfTxBuf
ldi R17,>_nrfTxBuf
xcall _SPI_SendData
.dbline 273
movw R30,R22
st Z+,R20
.dbline 274
inc R10
.dbline 282
lds R2,_nrfRxBuf+1
st Z+,R2
movw R22,R30
.dbline 283
inc R10
.dbline 284
L103:
.dbline 267
inc R20
L105:
.dbline 267
cpi R20,16
brlo L102
.dbline 286
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
ldi R24,16
sts _nrfTxBuf,R24
.dbline 287
; }
clr R2
sts _nrfTxBuf+1,R2
.dbline 288
; }
sts _nrfTxBuf+2,R2
.dbline 289
; }
sts _nrfTxBuf+3,R2
.dbline 290
; }
sts _nrfTxBuf+4,R2
.dbline 291
; }
sts _nrfTxBuf+5,R2
.dbline 292
; }
ldi R24,6
std y+0,R24
ldi R18,<_nrfRxBuf
ldi R19,>_nrfRxBuf
ldi R16,<_nrfTxBuf
ldi R17,>_nrfTxBuf
xcall _SPI_SendData
.dbline 294
; }
; }
ldi R24,16
movw R30,R22
st Z+,R24
movw R22,R30
.dbline 295
; }
inc R10
.dbline 297
; }
; }
clr R12
inc R12
xjmp L116
L113:
.dbline 298
.dbline 299
ldi R24,<_nrfRxBuf
ldi R25,>_nrfRxBuf
mov R30,R12
clr R31
add R30,R24
adc R31,R25
ldd R2,z+0
movw R30,R22
st Z+,R2
movw R22,R30
.dbline 300
inc R10
.dbline 301
L114:
.dbline 297
inc R12
L116:
.dbline 297
mov R24,R12
cpi R24,6
brlo L113
.dbline 303
; }
; }
; }
; }
; }
; }
ldi R20,17
xjmp L120
L117:
.dbline 304
.dbline 305
sts _nrfTxBuf,R20
.dbline 306
clr R2
sts _nrfTxBuf+1,R2
.dbline 307
ldi R24,2
std y+0,R24
ldi R18,<_nrfRxBuf
ldi R19,>_nrfRxBuf
ldi R16,<_nrfTxBuf
ldi R17,>_nrfTxBuf
xcall _SPI_SendData
.dbline 309
movw R30,R22
st Z+,R20
.dbline 310
inc R10
.dbline 318
lds R2,_nrfRxBuf+1
st Z+,R2
movw R22,R30
.dbline 319
inc R10
.dbline 320
L118:
.dbline 303
inc R20
L120:
.dbline 303
cpi R20,24
brlo L117
.dbline 322
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
sts _ComTxCount,R10
.dbline 323
; }
ldi R24,<_ComTxBuf
ldi R25,>_ComTxBuf
sts _PtComTx+1,R25
sts _PtComTx,R24
.dbline 324
; }
out 0xc,R10
xjmp L124
L123:
.dbline 325
wdr
L124:
.dbline 325
; }
clr R2
lds R3,_ComTxCount
cp R2,R3
brlo L123
.dbline 326
; }
sts _bBusy,R2
.dbline -2
.dbline 327
; }
L82:
adiw R28,1
xcall pop_gset4
.dbline 0 ; func end
ret
.dbsym r i 20 c
.dbsym r pt 22 pc
.dbsym r k 10 c
.dbsym r j 12 c
.dbend
.dbfunc e ReadNextRegister _ReadNextRegister fV
; j -> R20
.even
_ReadNextRegister::
xcall push_gset1
sbiw R28,1
.dbline -1
.dbline 332
; }
; }
; }
; }
; }
.dbline 335
; }
; }
; }
ldi R24,85
sts _bBusy,R24
.dbline 337
; }
; }
clr R2
sts _nrfTxBuf+1,R2
.dbline 338
; }
sts _nrfTxBuf+2,R2
.dbline 339
; }
sts _nrfTxBuf+3,R2
.dbline 340
; }
sts _nrfTxBuf+4,R2
.dbline 341
; }
sts _nrfTxBuf+5,R2
.dbline 342
; }
lds R2,_RegisterNum
sts _nrfTxBuf,R2
.dbline 343
; }
ldi R20,2
.dbline 344
; }
mov R24,R2
cpi R24,10
breq L135
cpi R24,11
breq L135
cpi R24,16
brne L132
L135:
.dbline 345
; }
.dbline 346
; }
ldi R20,6
.dbline 347
; }
L132:
.dbline 349
; }
; }
std y+0,R20
ldi R18,<_ComTxBuf
ldi R19,>_ComTxBuf
ldi R16,<_nrfTxBuf
ldi R17,>_nrfTxBuf
xcall _SPI_SendData
.dbline 352
; }
; }
; }
mov R24,R20
subi R24,1
sts _ComTxCount,R24
.dbline 353
; }
ldi R24,<_ComTxBuf
ldi R25,>_ComTxBuf
sts _PtComTx+1,R25
sts _PtComTx,R24
.dbline 354
; }
lds R2,_RegisterNum
sts _ComTxBuf,R2
.dbline 355
; }
movw R30,R24
ld R2,Z+
sts _PtComTx+1,R31
sts _PtComTx,R30
out 0xc,R2
xjmp L137
L136:
.dbline 356
wdr
L137:
.dbline 356
; }
clr R2
lds R3,_ComTxCount
cp R2,R3
brlo L136
.dbline 357
; }
lds R24,_RegisterNum
subi R24,255 ; addi 1
sts _RegisterNum,R24
.dbline 358
; }
ldi R24,23
lds R2,_RegisterNum
cp R24,R2
brsh L139
.dbline 359
; }
clr R2
sts _RegisterNum,R2
L139:
.dbline 360
; }
clr R2
sts _bBusy,R2
.dbline -2
.dbline 361
; }
L126:
adiw R28,1
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r j 20 c
.dbend
.dbfunc e ReadLastRegister _ReadLastRegister fV
; j -> R20
.even
_ReadLastRegister::
xcall push_gset1
sbiw R28,1
.dbline -1
.dbline 370
; }
; }
; }
; }
; }
; }
; }
; }
; }
.dbline 374
; }
; }
; }
; }
ldi R24,85
sts _bBusy,R24
.dbline 377
; }
; }
; }
clr R2
sts _nrfTxBuf+1,R2
.dbline 378
; }
sts _nrfTxBuf+2,R2
.dbline 379
; }
sts _nrfTxBuf+3,R2
.dbline 380
; }
sts _nrfTxBuf+4,R2
.dbline 381
; }
sts _nrfTxBuf+5,R2
.dbline 382
; }
lds R2,_RegisterNum
sts _nrfTxBuf,R2
.dbline 383
; }
ldi R20,2
.dbline 384
; }
mov R24,R2
cpi R24,10
breq L150
cpi R24,11
breq L150
cpi R24,16
brne L147
L150:
.dbline 385
; }
.dbline 386
; }
ldi R20,6
.dbline 387
; }
L147:
.dbline 389
; }
; }
std y+0,R20
ldi R18,<_ComTxBuf
ldi R19,>_ComTxBuf
ldi R16,<_nrfTxBuf
ldi R17,>_nrfTxBuf
xcall _SPI_SendData
.dbline 392
; }
; }
; }
mov R24,R20
subi R24,1
sts _ComTxCount,R24
.dbline 393
; }
ldi R24,<_ComTxBuf
ldi R25,>_ComTxBuf
sts _PtComTx+1,R25
sts _PtComTx,R24
.dbline 394
; }
lds R2,_RegisterNum
sts _ComTxBuf,R2
.dbline 395
; }
movw R30,R24
ld R2,Z+
sts _PtComTx+1,R31
sts _PtComTx,R30
out 0xc,R2
xjmp L152
L151:
.dbline 396
wdr
L152:
.dbline 396
; }
clr R2
lds R3,_ComTxCount
cp R2,R3
brlo L151
.dbline 397
; }
lds R2,_RegisterNum
tst R2
brne L154
.dbline 398
; }
ldi R24,23
sts _RegisterNum,R24
xjmp L155
L154:
.dbline 400
; }
; }
lds R24,_RegisterNum
subi R24,1
sts _RegisterNum,R24
L155:
.dbline 401
; }
clr R2
sts _bBusy,R2
.dbline -2
.dbline 402
; }
L141:
adiw R28,1
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r j 20 c
.dbend
.dbfile D:\mywork\无绳电话\NRF2401\nRF24L01_atmega16\nrf24l01/deal.c
.dbfunc e FlashLed _FlashLed fV
.even
_FlashLed::
.dbline -1
.dbline 4
.dbline 5
lds R24,_Timer300msCount
lds R25,_Timer300msCount+1
adiw R24,1
sts _Timer300msCount+1,R25
sts _Timer300msCount,R24
.dbline 7
cpi R24,80
ldi R30,0
cpc R25,R30
brlo L157
.dbline 8
.dbline 9
clr R2
clr R3
sts _Timer300msCount+1,R3
sts _Timer300msCount,R2
.dbline 10
lds R2,_bSignal2Hz
com R2
sts _bSignal2Hz,R2
.dbline 12
tst R2
brne L159
.dbline 13
.dbline 15
clr R2
lds R3,_Led2FlashTimes
cp R2,R3
brsh L160
.dbline 16
.dbline 17
cbi 0x15,1
.dbline 18
mov R24,R3
subi R24,1
sts _Led2FlashTimes,R24
.dbline 19
.dbline 20
xjmp L160
L159:
.dbline 22
.dbline 23
sbi 0x15,1
.dbline 24
L160:
.dbline 25
L157:
.dbline -2
.dbline 26
L156:
.dbline 0 ; func end
ret
.dbend
.dbfunc e Ex0Deal _Ex0Deal fV
; i -> R20
.even
_Ex0Deal::
xcall push_gset1
sbiw R28,1
.dbline -1
.dbline 30
.dbline 32
ldi R24,85
sts _bBusy,R24
.dbline 33
ldi R24,7
sts _nrfTxBuf,R24
.dbline 34
clr R2
sts _nrfTxBuf+1,R2
.dbline 35
ldi R24,2
std y+0,R24
ldi R18,<_nrfTxBuf
ldi R19,>_nrfTxBuf
ldi R16,<_nrfTxBuf
ldi R17,>_nrfTxBuf
xcall _SPI_SendData
.dbline 38
ldi R24,1
sts _ComTxCount,R24
.dbline 39
ldi R24,<_nrfTxBuf
ldi R25,>_nrfTxBuf
sts _PtComTx+1,R25
sts _PtComTx,R24
.dbline 40
ldi R24,7
out 0xc,R24
xjmp L166
L165:
.dbline 41
wdr
L166:
.dbline 41
clr R2
lds R3,_ComTxCount
cp R2,R3
brlo L165
.dbline 44
lds R24,_nrfTxBuf+1
andi R24,64
cpi R24,64
brne L168
.dbline 45
.dbline 47
ldi R24,6
sts _Led2FlashTimes,R24
.dbline 49
ldi R16,<_II2C_UserConfig
ldi R17,>_II2C_UserConfig
subi R16,239 ; offset = 17
sbci R17,255
xcall _EEPROMread
mov R20,R16
.dbline 50
ldi R24,97
sts _nrfTxBuf,R24
.dbline 51
ldi R24,33
std y+0,R24
ldi R18,<_nrfRxBuf
ldi R19,>_nrfRxBuf
ldi R16,<_nrfTxBuf
ldi R17,>_nrfTxBuf
xcall _SPI_SendData
.dbline 53
ldi R24,31
sts _ComTxCount,R24
.dbline 54
ldi R24,<_nrfRxBuf+1
ldi R25,>_nrfRxBuf+1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -