📄 main.lss
字号:
a10: 8f ef ldi r24, 0xFF ; 255
a12: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
a16: 8b bb out 0x1b, r24 ; 27
a18: 00 93 65 00 sts 0x0065, r16
a1c: 10 93 65 00 sts 0x0065, r17
a20: 8f ef ldi r24, 0xFF ; 255
a22: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
a26: 8b bb out 0x1b, r24 ; 27
a28: 00 93 65 00 sts 0x0065, r16
a2c: 10 93 65 00 sts 0x0065, r17
a30: 8f ef ldi r24, 0xFF ; 255
a32: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
a36: 8b bb out 0x1b, r24 ; 27
a38: 00 93 65 00 sts 0x0065, r16
a3c: 10 93 65 00 sts 0x0065, r17
a40: 8f ef ldi r24, 0xFF ; 255
a42: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
a46: 8b bb out 0x1b, r24 ; 27
a48: 00 93 65 00 sts 0x0065, r16
a4c: 10 93 65 00 sts 0x0065, r17
a50: 8f ef ldi r24, 0xFF ; 255
a52: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
a56: 8b bb out 0x1b, r24 ; 27
a58: 00 93 65 00 sts 0x0065, r16
a5c: 10 93 65 00 sts 0x0065, r17
a60: 8f ef ldi r24, 0xFF ; 255
a62: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
a66: 8b bb out 0x1b, r24 ; 27
a68: 00 93 65 00 sts 0x0065, r16
a6c: 10 93 65 00 sts 0x0065, r17
a70: 8f ef ldi r24, 0xFF ; 255
a72: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
a76: 8b bb out 0x1b, r24 ; 27
a78: 00 93 65 00 sts 0x0065, r16
a7c: 10 93 65 00 sts 0x0065, r17
a80: 8f ef ldi r24, 0xFF ; 255
a82: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
a86: 8b bb out 0x1b, r24 ; 27
a88: 00 93 65 00 sts 0x0065, r16
a8c: 10 93 65 00 sts 0x0065, r17
a90: 8f ef ldi r24, 0xFF ; 255
a92: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
a96: 8b bb out 0x1b, r24 ; 27
a98: 00 93 65 00 sts 0x0065, r16
a9c: 10 93 65 00 sts 0x0065, r17
aa0: 8f ef ldi r24, 0xFF ; 255
aa2: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
aa6: 8b bb out 0x1b, r24 ; 27
aa8: 00 93 65 00 sts 0x0065, r16
aac: 10 93 65 00 sts 0x0065, r17
ab0: 8f ef ldi r24, 0xFF ; 255
ab2: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
ab6: 8b bb out 0x1b, r24 ; 27
ab8: 00 93 65 00 sts 0x0065, r16
abc: 10 93 65 00 sts 0x0065, r17
ac0: 8f ef ldi r24, 0xFF ; 255
ac2: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
ac6: 8b bb out 0x1b, r24 ; 27
ac8: 00 93 65 00 sts 0x0065, r16
acc: 10 93 65 00 sts 0x0065, r17
ad0: 8f ef ldi r24, 0xFF ; 255
ad2: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
ad6: 8b bb out 0x1b, r24 ; 27
ad8: 00 93 65 00 sts 0x0065, r16
adc: 10 93 65 00 sts 0x0065, r17
ae0: 8f ef ldi r24, 0xFF ; 255
ae2: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
ae6: 8b bb out 0x1b, r24 ; 27
ae8: 00 93 65 00 sts 0x0065, r16
aec: 10 93 65 00 sts 0x0065, r17
af0: 8f ef ldi r24, 0xFF ; 255
af2: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
af6: 8b bb out 0x1b, r24 ; 27
af8: 00 93 65 00 sts 0x0065, r16
afc: 10 93 65 00 sts 0x0065, r17
b00: 8f ef ldi r24, 0xFF ; 255
b02: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
b06: 8b bb out 0x1b, r24 ; 27
b08: 00 93 65 00 sts 0x0065, r16
b0c: 10 93 65 00 sts 0x0065, r17
b10: 8f ef ldi r24, 0xFF ; 255
b12: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
b16: 8b bb out 0x1b, r24 ; 27
b18: 00 93 65 00 sts 0x0065, r16
b1c: 10 93 65 00 sts 0x0065, r17
b20: 8f ef ldi r24, 0xFF ; 255
b22: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
b26: 8b bb out 0x1b, r24 ; 27
b28: 00 93 65 00 sts 0x0065, r16
b2c: 10 93 65 00 sts 0x0065, r17
b30: 8f ef ldi r24, 0xFF ; 255
b32: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
b36: 8b bb out 0x1b, r24 ; 27
b38: 00 93 65 00 sts 0x0065, r16
b3c: 10 93 65 00 sts 0x0065, r17
b40: 8f ef ldi r24, 0xFF ; 255
b42: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
b46: 8b bb out 0x1b, r24 ; 27
b48: 00 93 65 00 sts 0x0065, r16
b4c: 10 93 65 00 sts 0x0065, r17
b50: 8f ef ldi r24, 0xFF ; 255
b52: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
b56: 8b bb out 0x1b, r24 ; 27
b58: 00 93 65 00 sts 0x0065, r16
b5c: 10 93 65 00 sts 0x0065, r17
b60: 8f ef ldi r24, 0xFF ; 255
b62: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
b66: 8b bb out 0x1b, r24 ; 27
b68: 00 93 65 00 sts 0x0065, r16
b6c: 10 93 65 00 sts 0x0065, r17
b70: 8f ef ldi r24, 0xFF ; 255
b72: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
b76: 8b bb out 0x1b, r24 ; 27
b78: 00 93 65 00 sts 0x0065, r16
b7c: 10 93 65 00 sts 0x0065, r17
b80: 8f ef ldi r24, 0xFF ; 255
b82: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
b86: 8b bb out 0x1b, r24 ; 27
b88: 00 93 65 00 sts 0x0065, r16
b8c: 10 93 65 00 sts 0x0065, r17
b90: 8f ef ldi r24, 0xFF ; 255
b92: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
b96: 8b bb out 0x1b, r24 ; 27
b98: 00 93 65 00 sts 0x0065, r16
b9c: 10 93 65 00 sts 0x0065, r17
ba0: 8f ef ldi r24, 0xFF ; 255
ba2: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
ba6: 8b bb out 0x1b, r24 ; 27
ba8: 00 93 65 00 sts 0x0065, r16
bac: 10 93 65 00 sts 0x0065, r17
bb0: 8f ef ldi r24, 0xFF ; 255
bb2: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
bb6: 8b bb out 0x1b, r24 ; 27
bb8: 00 93 65 00 sts 0x0065, r16
bbc: 10 93 65 00 sts 0x0065, r17
bc0: 8f ef ldi r24, 0xFF ; 255
bc2: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
bc6: 8b bb out 0x1b, r24 ; 27
bc8: 00 93 65 00 sts 0x0065, r16
bcc: 10 93 65 00 sts 0x0065, r17
bd0: 8f ef ldi r24, 0xFF ; 255
bd2: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
bd6: 8b bb out 0x1b, r24 ; 27
bd8: 00 93 65 00 sts 0x0065, r16
bdc: 10 93 65 00 sts 0x0065, r17
be0: 8f ef ldi r24, 0xFF ; 255
be2: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
be6: 8b bb out 0x1b, r24 ; 27
be8: 00 93 65 00 sts 0x0065, r16
bec: 10 93 65 00 sts 0x0065, r17
bf0: 8f ef ldi r24, 0xFF ; 255
bf2: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
bf6: 8b bb out 0x1b, r24 ; 27
bf8: 00 93 65 00 sts 0x0065, r16
bfc: 10 93 65 00 sts 0x0065, r17
c00: 8f ef ldi r24, 0xFF ; 255
c02: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
c06: 8b bb out 0x1b, r24 ; 27
c08: 00 93 65 00 sts 0x0065, r16
c0c: 10 93 65 00 sts 0x0065, r17
c10: 8f ef ldi r24, 0xFF ; 255
c12: 0e 94 6d 0a call 0x14da ; 0x14da <SPI_WriteByte>
c16: 8b bb out 0x1b, r24 ; 27
c18: 00 93 65 00 sts 0x0065, r16
c1c: 10 93 65 00 sts 0x0065, r17
...
c28: 0e 94 bc 02 call 0x578 ; 0x578 <D12_Enable_Buffer>
c2c: 1f 91 pop r17
c2e: 0f 91 pop r16
c30: 08 95 ret
00000c32 <USB_Delay>:
/**************************************/
void USB_Delay(U16 Time)
{
c32: 01 c0 rjmp .+2 ; 0xc36 <USB_Delay+0x4>
while(Time--)asm("nop");
c34: 00 00 nop
c36: 01 97 sbiw r24, 0x01 ; 1
c38: 2f ef ldi r18, 0xFF ; 255
c3a: 8f 3f cpi r24, 0xFF ; 255
c3c: 92 07 cpc r25, r18
c3e: d1 f7 brne .-12 ; 0xc34 <USB_Delay+0x2>
c40: 08 95 ret
00000c42 <D12SuspChgProc>:
}
/******************Init USB********************/
U8 USB_Init()
{
// D12_PORT_INI();
USB_Delay(20000);
if(D12_Read_Chip_ID()!=0x1210 )
return 0;
D12_Set_DMA(MyD12DmaCfg);
if(D12_Get_DMA()!=MyD12DmaCfg)
return 0;
D12_Set_Mode(MyD12EpCfgOff, D12Pll24M);
USB_Delay(20000);
USB_Delay(20000);
D12_Set_Mode(MyD12EpCfgOn, D12Pll24M);
return 1;
}
/********************** D12 interrupt process ******************/
void D12Ep0IntProc()
{
U8 SetupPacket[8];
U8 i = 0;
Clear_Remain_Descriptor_Flag();
//printf("\nEndpoint0 Process!");
if(D12_Read_Last_Transaction_Status(0)&0x20)
{
if(D12_Read_Endpoint(0, SetupPacket, 8)==8)
{
D12_Ack_Endpoint(0);
D12_Ack_Endpoint(1);
//for(i=0; i<8; i++)
//printf("%x,", SetupPacket[i]);
if(SetupPacket[0] == 0xa1 && SetupPacket[1] == 0xfe)
{
D12_Write_Endpoint(1,&i,1);
}
if(!Stand_Device_Request[SetupPacket[1]&0xf](SetupPacket)); //setup packet
return;
}
}
D12_Set_Endpoint_Status(0, D12EpStall);
D12_Set_Endpoint_Status(1, D12EpStall);
}
void D12Ep1IntProc()
{
U8 i;
//printf("\nEndpoint1 Process!\n");
i = D12_Read_Last_Transaction_Status(1);
if(Remain_Descriptor_Flag())
Send_Descriptor();
}
void D12Ep2IntProc()
{
// printf("\nEndpoint2 Process!\n");
D12_Set_Endpoint_Status(2, D12EpStall);
}
void D12Ep3IntProc()
{
// printf("\nEndpoint3 Process!\n");
D12_Set_Endpoint_Status(3, D12EpStall);
}
void D12Ep4IntProc()
{
//printf("\nEndpoint4 Process!\n");
D12_Read_Last_Transaction_Status(4);
D12_Read_Endpoint(4, (U8 *)&cbw, Endpoint2_Packet_Size);
if(cbw.dCBWSignature != 0x43425355)return; //cbw signature
if(cbw.bmCBWFlags&0x80) //CBW Flag
{
switch(cbw.CBWCB[0])
{
case Read_10: read_10();Send_CSW(0x00,SUCCESS);break;
case Inquiry: D12_Write_Endpoint(5,DISK_INF,36);Send_CSW(0x00,SUCCESS); break;
case Read_Capacity: D12_Write_Endpoint(5,DISK_CAPACITY,0x08);Send_CSW(0x00,SUCCESS);break;
case Read_Format_capacity: D12_Write_Endpoint(5,0x00,0x00);Send_CSW(cbw.dCBWDataTransgerLength,FAIL);break;
case Request_Sense: D12_Write_Endpoint(5,SENSE,0x12);Send_CSW(0x00,SUCCESS);break;
case 0x1a: D12_Write_Endpoint(5,0x00,0x00);Send_CSW(cbw.dCBWDataTransgerLength,FAIL);break;
default : D12_Write_Endpoint(5,0x00,0x00);Send_CSW(cbw.dCBWDataTransgerLength,FAIL);break;
}
}
else //read
{
switch(cbw.CBWCB[0])
{
case Write_10: write_10();Send_CSW(0x00,SUCCESS);break;
case Test_Unit_Ready: Send_CSW(0x00,SUCCESS);break;
case Verify: Send_CSW(0x00,SUCCESS);break;
default : Send_CSW(cbw.dCBWDataTransgerLength,FAIL);break;
}
}
}
void D12Ep5IntProc()
{
//printf("\nEndpoint5 Process!\n");
D12_Read_Last_Transaction_Status(5); //end at ep4, not interrupt
}
void D12BusRstProc()
{
//printf("\nBus Reset!");
D12_Clear_Buffer();
D12_Enable_Buffer();
D12_Set_Endpoint_Enable(1);
}
void D12SuspChgProc()
{
c42: 08 95 ret
00000c44 <D12BusRstProc>:
c44: 0e 94 86 02 call 0x50c ; 0x50c <D12_Clear_Buffer>
c48: 0e 94 bc 02 call 0x578 ; 0x578 <D12_Enable_Buffer>
c4c: 81 e0 ldi r24, 0x01 ; 1
c4e: 0e 94 86 01 call 0x30c ; 0x30c <D12_Set_Endpoint_Enable>
c52: 08 95 ret
00000c54 <D12Ep5IntProc>:
c54: 85 e0 ldi r24, 0x05 ; 5
c56: 0e 94 04 03 call 0x608 ; 0x608 <D12_Read_Last_Transaction_Status>
c5a: 08 95 ret
00000c5c <D12Ep3IntProc>:
c5c: 61 e0 ldi r22, 0x01 ; 1
c5e: 83 e0 ldi r24, 0x03 ; 3
c60: 0e 94 44 01 call 0x288 ; 0x288 <D12_Set_Endpoint_Status>
c64: 08 95 ret
00000c66 <D12Ep2IntProc>:
c66: 61 e0 ldi r22, 0x01 ; 1
c68: 82 e0 ldi r24, 0x02 ; 2
c6a: 0e 94 44 01 call 0x288 ; 0x288 <D12_Set_Endpoint_Status>
c6e: 08 95 ret
00000c70 <D12Ep1IntProc>:
c70: 81 e0 ldi r24, 0x01 ; 1
c72: 0e 94 04 03 call 0x608 ; 0x608 <D12_Read_Last_Transaction_Status>
c76: 0e 94 99 08 call 0x1132 ; 0x1132 <Remain_Descriptor_Flag>
c7a: 88 23 and r24, r24
c7c: 11 f0 breq .+4 ; 0xc82 <D12Ep1IntProc+0x12>
c7e: 0e 94 e3 08 call 0x11c6 ; 0x11c6 <Send_Descriptor>
c82: 08 95 ret
00000c84 <D12Ep0IntProc>:
c84: cf 93 push r28
c86: df 93 push r29
c88: cd b7 in r28, 0x3d ; 61
c8a: de b7 in r29, 0x3e ; 62
c8c: 29 97 sbiw r28, 0x09 ; 9
c8e: 0f b6 in r0, 0x3f ; 63
c90: f8 94 cli
c92: de bf out 0x3e, r29 ; 62
c94: 0f be out 0x3f, r0 ; 63
c96: cd bf out 0x3d, r28 ; 61
c98: 19 82 std Y+1, r1 ; 0x01
c9a: 0e 94 9d 08 call 0x113a ; 0x113a <Clear_Remain_Descriptor_Flag>
c9e: 80 e0 ldi r24, 0x00 ; 0
ca0: 0e 94 04 03 call 0x608 ; 0x608 <D12_Read_Last_Transaction_Status>
ca4: 85 ff sbrs r24, 5
ca6: 2b c0 rjmp .+86 ; 0xcfe <D12Ep0IntProc+0x7a>
ca8: 48 e0 ldi r20, 0x08 ; 8
caa: be 01 movw r22, r28
cac: 6e 5f subi r22, 0xFE ; 254
cae: 7f 4f sbci r23, 0xFF ; 255
cb0: 80 e0 ldi r24, 0x00 ; 0
cb2: 0e 94 7b 03 call 0x6f6 ; 0x6f6 <D12_Read_Endpoint>
cb6: 88 30 cpi r24, 0x08 ; 8
cb8: 11 f5 brne .+68 ; 0xcfe <D12Ep0IntProc+0x7a>
cba: 80 e0 ldi r24, 0x00 ; 0
cbc: 0e 94 99 02 call 0x532 ; 0x532 <D12_Ack_Endpoint>
cc0: 81 e0 ldi r24, 0x01 ; 1
cc2: 0e 94 99 02 call 0x532 ; 0x532 <D12_Ack_Endpoint>
cc6: 8a 81 ldd r24, Y+2 ; 0x02
cc8: 81 3a cpi r24, 0xA1 ; 161
cca: 51 f4 brne .+20 ; 0xce0 <D12Ep0IntProc+0x5c>
ccc: 8b 81 ldd r24, Y+3 ; 0x03
cce: 8e 3f cpi r24, 0xFE ; 254
cd0: 39 f4 brne .+14 ; 0xce0 <D12Ep0IntProc+0x5c>
cd2: 41 e0 ldi r20, 0x01 ; 1
cd4: be 01 movw r22, r28
cd6: 6f 5f subi r22, 0xFF ; 255
cd8: 7f 4f sbci r23, 0xFF ; 255
cda: 81 e0 ldi r24, 0x01 ; 1
cdc: 0e 94 28 03 call 0x650 ; 0x650 <D12_Write_Endpoint>
ce0: eb 81 ldd r30, Y+3 ; 0x03
ce2: ff 27 eor r31, r31
ce4: ef 70 andi r30, 0x0F ; 15
ce6: f0 70 andi r31, 0x00 ; 0
ce8: ee 0f add r30, r30
cea: ff 1f adc r31, r31
cec: ee 5b subi r30, 0xBE ; 190
cee: fe 4f sbci r31, 0xFE ; 254
cf0: 01 90 ld r0, Z+
cf2: f0 81 ld r31, Z
cf4: e0 2d mov r30, r0
cf6: ce 01 movw r24, r28
cf8: 02 96 adiw r24, 0x02 ; 2
cfa: 09 95 icall
cfc: 08 c0 rjmp .+16 ; 0xd0e <D12Ep0IntProc+0x8a>
cfe: 61 e0 ldi r22, 0x01 ; 1
d00: 80 e0 ldi r24, 0x00 ; 0
d02: 0e 94 44 01 call 0x288 ; 0x288 <D12_Set_Endpoint_Status>
d06: 61 e0 ldi r22, 0x01 ; 1
d08: 81 e0 ldi r24, 0x01 ; 1
d0a: 0e 94 44 01 call 0x288 ; 0x288 <D12_Set_Endpoint_Status>
d0e: 29 96 adiw r28, 0x09 ; 9
d10: 0f b6 in r0, 0x3f ; 63
d12: f8 94 cli
d14: de bf out 0x3e, r29 ; 62
d16: 0f be out 0x3f, r0 ; 63
d18: cd bf out 0x3d, r28 ; 61
d1a: df 91 pop r29
d1c: cf 91 pop r28
d1e: 08 95 ret
00000d20 <write_10>:
d20: 4f 92 push r4
d22: 5f 92 push r5
d24: 6f 92 push r6
d26: 7f 92 push r7
d28: 8f 92 push r8
d2a: 9f 92 push r9
d2c: af 92 push r10
d2e: bf 92 push r11
d30: cf 92 push r12
d32: df 92 push
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -