📄 main.lis
字号:
016C 30910900 lds R19,_ControlData+8+1
0170 01E0 ldi R16,1
0172 10E0 ldi R17,0
0174 0E940000 xcall _D12_CWriteEndpoint
0178 .dbline 135
0178 20900800 lds R2,_ControlData+8
017C 30900900 lds R3,_ControlData+8+1
0180 40900A00 lds R4,_ControlData+10
0184 50900B00 lds R5,_ControlData+10+1
0188 420C add R4,R2
018A 531C adc R5,R3
018C 50920B00 sts _ControlData+10+1,R5
0190 40920A00 sts _ControlData+10,R4
0194 .dbline 136
0194 F894 cli
0196 .dbline 137
0196 80910000 lds R24,_bEPPflags
019A 8F79 andi R24,159
019C 80930000 sts _bEPPflags,R24
01A0 .dbline 138
01A0 7894 sei
01A2 .dbline 139
01A2 L24:
01A2 .dbline -2
01A2 L16:
01A2 2296 adiw R28,2
01A4 0E940000 xcall pop_gset2
01A8 .dbline 0 ; func end
01A8 0895 ret
01AA .dbsym r len 22 s
01AA .dbsym r pRomData 20 pkc
01AA .dbend
01AA .dbfunc e control_handler _control_handler fV
01AA ; req -> R20
01AA ; type -> R22
.even
01AA _control_handler::
01AA 0E940000 xcall push_gset2
01AE .dbline -1
01AE .dbline 142
01AE ; else
01AE ; {
01AE ; D12_CWriteEndpoint(1,ControlData.wLength,pRomData);
01AE ; ControlData.wCount+=ControlData.wLength;
01AE ; DISABLE;
01AE ; bEPPflags.bits.control_state=USB_IDLE;
01AE ; ENABLE;
01AE ; }
01AE ; }
01AE ; void control_handler()
01AE ; {
01AE .dbline 144
01AE ; unsigned char type,req;
01AE ; type=ControlData.DeviceRequest.bmRequestType&USB_REQUEST_TYPE_MASK;
01AE 60910000 lds R22,_ControlData
01B2 6076 andi R22,96
01B4 .dbline 145
01B4 ; req=ControlData.DeviceRequest.bRequest&USB_REQUEST_MASK;
01B4 40910100 lds R20,_ControlData+1
01B8 4F70 andi R20,15
01BA .dbline 146
01BA ; if(type==USB_STANDARD_REQUEST)
01BA 6623 tst R22
01BC 69F4 brne L33
01BE .dbline 147
01BE ; (*StandardDeviceRequest[req])();
01BE 82E0 ldi R24,2
01C0 849F mul R24,R20
01C2 F001 movw R30,R0
01C4 80E0 ldi R24,<_StandardDeviceRequest
01C6 90E0 ldi R25,>_StandardDeviceRequest
01C8 E80F add R30,R24
01CA F91F adc R31,R25
01CC A081 ldd R26,z+0
01CE B181 ldd R27,z+1
01D0 FD01 movw R30,R26
01D2 0E940000 xcall xicall
01D6 10C0 xjmp L34
01D8 L33:
01D8 .dbline 148
01D8 ; else if(type==USB_VENDOR_REQUEST)
01D8 6034 cpi R22,64
01DA 69F4 brne L35
01DC .dbline 149
01DC ; (*VendorDeviceRequest[req])();
01DC 82E0 ldi R24,2
01DE 849F mul R24,R20
01E0 F001 movw R30,R0
01E2 80E0 ldi R24,<_VendorDeviceRequest
01E4 90E0 ldi R25,>_VendorDeviceRequest
01E6 E80F add R30,R24
01E8 F91F adc R31,R25
01EA A081 ldd R26,z+0
01EC B181 ldd R27,z+1
01EE FD01 movw R30,R26
01F0 0E940000 xcall xicall
01F4 01C0 xjmp L36
01F6 L35:
01F6 .dbline 150
01F6 ; else stall_ep0();
01F6 4DDF xcall _stall_ep0
01F8 L36:
01F8 L34:
01F8 .dbline -2
01F8 L31:
01F8 0E940000 xcall pop_gset2
01FC .dbline 0 ; func end
01FC 0895 ret
01FE .dbsym r req 20 c
01FE .dbsym r type 22 c
01FE .dbend
01FE .dbfunc e main _main fV
.even
01FE _main::
01FE .dbline -1
01FE .dbline 153
01FE ; }
01FE ; void main(void)
01FE ; {
01FE .dbline 154
01FE ; NOP();NOP();
01FE 0000 nop
0200 .dbline 154
0200 0000 nop
0202 .dbline 155
0202 ; NOP();NOP();
0202 0000 nop
0204 .dbline 155
0204 0000 nop
0206 .dbline 156
0206 ; DISABLE;
0206 F894 cli
0208 .dbline 157
0208 ; init_port();
0208 FBDE xcall _init_port
020A .dbline 158
020A ; init_serial();
020A 0BDF xcall _init_serial
020C .dbline 160
020C ; // Format_Fat16Media();
020C ; D12_ReadInterruptRegister();
020C 0E940000 xcall _D12_ReadInterruptRegister
0210 .dbline 161
0210 ; D12_ReadLastTransactionStatus(0);
0210 0027 clr R16
0212 0E940000 xcall _D12_ReadLastTransactionStatus
0216 .dbline 162
0216 ; D12_ReadLastTransactionStatus(1);
0216 01E0 ldi R16,1
0218 0E940000 xcall _D12_ReadLastTransactionStatus
021C .dbline 163
021C ; D12_ReadLastTransactionStatus(2);
021C 02E0 ldi R16,2
021E 0E940000 xcall _D12_ReadLastTransactionStatus
0222 .dbline 164
0222 ; D12_ReadLastTransactionStatus(3);
0222 03E0 ldi R16,3
0224 0E940000 xcall _D12_ReadLastTransactionStatus
0228 .dbline 165
0228 ; D12_ReadLastTransactionStatus(4);
0228 04E0 ldi R16,4
022A 0E940000 xcall _D12_ReadLastTransactionStatus
022E .dbline 166
022E ; D12_ReadLastTransactionStatus(5);
022E 05E0 ldi R16,5
0230 0E940000 xcall _D12_ReadLastTransactionStatus
0234 .dbline 167
0234 ; reconnect_USB();
0234 1CDF xcall _reconnect_USB
0236 .dbline 168
0236 ; ENABLE;
0236 7894 sei
0238 25C0 xjmp L39
023A L38:
023A .dbline 170
023A ; while(TRUE)
023A ; {
023A .dbline 171
023A ; if(bEPPflags.bits.bus_reset)
023A 80910000 lds R24,_bEPPflags
023E 8170 andi R24,1
0240 39F0 breq L41
0242 .dbline 172
0242 ; {
0242 .dbline 173
0242 ; DISABLE;
0242 F894 cli
0244 .dbline 174
0244 ; bEPPflags.bits.bus_reset=0;
0244 80910000 lds R24,_bEPPflags
0248 8E7F andi R24,254
024A 80930000 sts _bEPPflags,R24
024E .dbline 175
024E ; ENABLE;
024E 7894 sei
0250 .dbline 176
0250 ; }
0250 L41:
0250 .dbline 177
0250 ; if(bEPPflags.bits.suspend)
0250 80910000 lds R24,_bEPPflags
0254 8695 lsr R24
0256 8170 andi R24,1
0258 39F0 breq L43
025A .dbline 178
025A ; {
025A .dbline 179
025A ; DISABLE;
025A F894 cli
025C .dbline 180
025C ; bEPPflags.bits.suspend=0;
025C 80910000 lds R24,_bEPPflags
0260 8D7F andi R24,253
0262 80930000 sts _bEPPflags,R24
0266 .dbline 181
0266 ; ENABLE;
0266 7894 sei
0268 .dbline 182
0268 ; }
0268 L43:
0268 .dbline 183
0268 ; if(bEPPflags.bits.setup_packet)
0268 80910000 lds R24,_bEPPflags
026C 8695 lsr R24
026E 8695 lsr R24
0270 8170 andi R24,1
0272 41F0 breq L45
0274 .dbline 184
0274 ; {
0274 .dbline 185
0274 ; DISABLE;
0274 F894 cli
0276 .dbline 186
0276 ; bEPPflags.bits.setup_packet=0;
0276 80910000 lds R24,_bEPPflags
027A 8B7F andi R24,251
027C 80930000 sts _bEPPflags,R24
0280 .dbline 187
0280 ; ENABLE;
0280 7894 sei
0282 .dbline 188
0282 ; control_handler();
0282 93DF xcall _control_handler
0284 .dbline 189
0284 ; }
0284 L45:
0284 .dbline 190
0284 L39:
0284 .dbline 169
0284 DACF xjmp L38
0286 X0:
0286 .dbline -2
0286 L37:
0286 .dbline 0 ; func end
0286 0895 ret
0288 .dbend
.area bss(ram, con, rel)
0000 .dbfile J:\PDIUSBD12-Materials\富昌\优盘5.0\MAIN.C
0000 _ControlData::
0000 .blkb 24
0018 .dbstruct 0 8 _device_request
0018 .dbfield 0 bmRequestType c
0018 .dbfield 1 bRequest c
0018 .dbfield 2 wValue s
0018 .dbfield 4 wIndex s
0018 .dbfield 6 wLength s
0018 .dbend
0018 .dbstruct 0 24 _control_xfer
0018 .dbfield 0 DeviceRequest S[_device_request]
0018 .dbfield 8 wLength s
0018 .dbfield 10 wCount s
0018 .dbfield 12 pData pc
0018 .dbfield 14 pCData pkc
0018 .dbfield 16 dataBuffer A[8:8]c
0018 .dbend
0018 .dbsym e ControlData _ControlData S[_control_xfer]
.area func_lit
0000 0000 PL_set_interface: .word `_set_interface
0002 0000 PL_get_interface: .word `_get_interface
0004 0000 PL_set_configuration: .word `_set_configuration
0006 0000 PL_get_configuration: .word `_get_configuration
0008 0000 PL_get_descriptor: .word `_get_descriptor
000A 0000 PL_set_address: .word `_set_address
000C 0000 PL_set_feature: .word `_set_feature
000E 0000 PL_reserved: .word `_reserved
0010 0000 PL_clear_feature: .word `_clear_feature
0012 0000 PL_get_status: .word `_get_status
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -