1 ;-------------------------------------------------------- 2 ; File Created by SDCC : free open source ANSI-C Compiler 3 ; Version 4.2.0 #13081 (Linux) 4 ;-------------------------------------------------------- 5 .module usb_common 6 .optsdcc -mmcs51 --model-small 7 8 ;-------------------------------------------------------- 9 ; Public variables in this module 10 ;-------------------------------------------------------- 11 .globl _epcs 12 .globl _plausible_endpoint 13 .globl _hook_uv 14 .globl _fx2_reset_data_toggle 15 .globl _fx2_stall_ep0 16 .globl _app_vendor_cmd 17 .globl _EIPX6 18 .globl _EIPX5 19 .globl _EIPX4 20 .globl _PI2C 21 .globl _PUSB 22 .globl _EIEX6 23 .globl _EIEX5 24 .globl _EIEX4 25 .globl _EI2C 26 .globl _EIUSB 27 .globl _SMOD1 28 .globl _ERESI 29 .globl _RESI 30 .globl _INT6 31 .globl _CY 32 .globl _AC 33 .globl _F0 34 .globl _RS1 35 .globl _RS0 36 .globl _OV 37 .globl _FL 38 .globl _P 39 .globl _TF2 40 .globl _EXF2 41 .globl _RCLK 42 .globl _TCLK 43 .globl _EXEN2 44 .globl _TR2 45 .globl _C_T2 46 .globl _CP_RL2 47 .globl _SM01 48 .globl _SM11 49 .globl _SM21 50 .globl _REN1 51 .globl _TB81 52 .globl _RB81 53 .globl _TI1 54 .globl _RI1 55 .globl _PS1 56 .globl _PT2 57 .globl _PS0 58 .globl _PT1 59 .globl _PX1 60 .globl _PT0 61 .globl _PX0 62 .globl _EA 63 .globl _ES1 64 .globl _ET2 65 .globl _ES0 66 .globl _ET1 67 .globl _EX1 68 .globl _ET0 69 .globl _EX0 70 .globl _SM0 71 .globl _SM1 72 .globl _SM2 73 .globl _REN 74 .globl _TB8 75 .globl _RB8 76 .globl _TI 77 .globl _RI 78 .globl _TF1 79 .globl _TR1 80 .globl _TF0 81 .globl _TR0 82 .globl _IE1 83 .globl _IT1 84 .globl _IE0 85 .globl _IT0 86 .globl _SEL 87 .globl _EIP 88 .globl _B 89 .globl _EIE 90 .globl _ACC 91 .globl _EICON 92 .globl _PSW 93 .globl _TH2 94 .globl _TL2 95 .globl _RCAP2H 96 .globl _RCAP2L 97 .globl _T2CON 98 .globl _SBUF1 99 .globl _SCON1 100 .globl _GPIFSGLDATLNOX 101 .globl _GPIFSGLDATLX 102 .globl _GPIFSGLDATH 103 .globl _GPIFTRIG 104 .globl _EP01STAT 105 .globl _IP 106 .globl _OEE 107 .globl _OED 108 .globl _OEC 109 .globl _OEB 110 .globl _OEA 111 .globl _IOE 112 .globl _IOD 113 .globl _AUTOPTRSETUP 114 .globl _EP68FIFOFLGS 115 .globl _EP24FIFOFLGS 116 .globl _EP2468STAT 117 .globl _IE 118 .globl _INT4CLR 119 .globl _INT2CLR 120 .globl _IOC 121 .globl _AUTODAT2 122 .globl _AUTOPTRL2 123 .globl _AUTOPTRH2 124 .globl _AUTODAT1 125 .globl _APTR1L 126 .globl _APTR1H 127 .globl _SBUF0 128 .globl _SCON0 129 .globl _MPAGE 130 .globl _EXIF 131 .globl _IOB 132 .globl _CKCON 133 .globl _TH1 134 .globl _TH0 135 .globl _TL1 136 .globl _TL0 137 .globl _TMOD 138 .globl _TCON 139 .globl _PCON 140 .globl _DPS 141 .globl _DPH1 142 .globl _DPL1 143 .globl _DPH 144 .globl _DPL 145 .globl _SP 146 .globl _IOA 147 .globl _EP8FIFOBUF 148 .globl _EP6FIFOBUF 149 .globl _EP4FIFOBUF 150 .globl _EP2FIFOBUF 151 .globl _EP1INBUF 152 .globl _EP1OUTBUF 153 .globl _EP0BUF 154 .globl _CT4 155 .globl _CT3 156 .globl _CT2 157 .globl _CT1 158 .globl _USBTEST 159 .globl _TESTCFG 160 .globl _DBUG 161 .globl _UDMACRCQUAL 162 .globl _UDMACRCL 163 .globl _UDMACRCH 164 .globl _GPIFHOLDAMOUNT 165 .globl _FLOWSTBHPERIOD 166 .globl _FLOWSTBEDGE 167 .globl _FLOWSTB 168 .globl _FLOWHOLDOFF 169 .globl _FLOWEQ1CTL 170 .globl _FLOWEQ0CTL 171 .globl _FLOWLOGIC 172 .globl _FLOWSTATE 173 .globl _GPIFABORT 174 .globl _GPIFREADYSTAT 175 .globl _GPIFREADYCFG 176 .globl _XGPIFSGLDATLNOX 177 .globl _XGPIFSGLDATLX 178 .globl _XGPIFSGLDATH 179 .globl _EP8GPIFTRIG 180 .globl _EP8GPIFPFSTOP 181 .globl _EP8GPIFFLGSEL 182 .globl _EP6GPIFTRIG 183 .globl _EP6GPIFPFSTOP 184 .globl _EP6GPIFFLGSEL 185 .globl _EP4GPIFTRIG 186 .globl _EP4GPIFPFSTOP 187 .globl _EP4GPIFFLGSEL 188 .globl _EP2GPIFTRIG 189 .globl _EP2GPIFPFSTOP 190 .globl _EP2GPIFFLGSEL 191 .globl _GPIFTCB0 192 .globl _GPIFTCB1 193 .globl _GPIFTCB2 194 .globl _GPIFTCB3 195 .globl _GPIFADRL 196 .globl _GPIFADRH 197 .globl _GPIFCTLCFG 198 .globl _GPIFIDLECTL 199 .globl _GPIFIDLECS 200 .globl _GPIFWFSELECT 201 .globl _SETUPDAT 202 .globl _SUDPTRCTL 203 .globl _SUDPTRL 204 .globl _SUDPTRH 205 .globl _EP8FIFOBCL 206 .globl _EP8FIFOBCH 207 .globl _EP6FIFOBCL 208 .globl _EP6FIFOBCH 209 .globl _EP4FIFOBCL 210 .globl _EP4FIFOBCH 211 .globl _EP2FIFOBCL 212 .globl _EP2FIFOBCH 213 .globl _EP8FIFOFLGS 214 .globl _EP6FIFOFLGS 215 .globl _EP4FIFOFLGS 216 .globl _EP2FIFOFLGS 217 .globl _EP8CS 218 .globl _EP6CS 219 .globl _EP4CS 220 .globl _EP2CS 221 .globl _EP1INCS 222 .globl _EP1OUTCS 223 .globl _EP0CS 224 .globl _EP8BCL 225 .globl _EP8BCH 226 .globl _EP6BCL 227 .globl _EP6BCH 228 .globl _EP4BCL 229 .globl _EP4BCH 230 .globl _EP2BCL 231 .globl _EP2BCH 232 .globl _EP1INBC 233 .globl _EP1OUTBC 234 .globl _EP0BCL 235 .globl _EP0BCH 236 .globl _FNADDR 237 .globl _MICROFRAME 238 .globl _USBFRAMEL 239 .globl _USBFRAMEH 240 .globl _TOGCTL 241 .globl _WAKEUPCS 242 .globl _SUSPEND 243 .globl _USBCS 244 .globl _XAUTODAT2 245 .globl _XAUTODAT1 246 .globl _I2CTL 247 .globl _I2DAT 248 .globl _I2CS 249 .globl _PORTECFG 250 .globl _PORTCCFG 251 .globl _PORTACFG 252 .globl _INTSETUP 253 .globl _INT4IVEC 254 .globl _INT2IVEC 255 .globl _CLRERRCNT 256 .globl _ERRCNTLIM 257 .globl _USBERRIRQ 258 .globl _USBERRIE 259 .globl _GPIFIRQ 260 .globl _GPIFIE 261 .globl _EPIRQ 262 .globl _EPIE 263 .globl _USBIRQ 264 .globl _USBIE 265 .globl _NAKIRQ 266 .globl _NAKIE 267 .globl _IBNIRQ 268 .globl _IBNIE 269 .globl _EP8FIFOIRQ 270 .globl _EP8FIFOIE 271 .globl _EP6FIFOIRQ 272 .globl _EP6FIFOIE 273 .globl _EP4FIFOIRQ 274 .globl _EP4FIFOIE 275 .globl _EP2FIFOIRQ 276 .globl _EP2FIFOIE 277 .globl _OUTPKTEND 278 .globl _INPKTEND 279 .globl _EP8ISOINPKTS 280 .globl _EP6ISOINPKTS 281 .globl _EP4ISOINPKTS 282 .globl _EP2ISOINPKTS 283 .globl _EP8FIFOPFL 284 .globl _EP8FIFOPFH 285 .globl _EP6FIFOPFL 286 .globl _EP6FIFOPFH 287 .globl _EP4FIFOPFL 288 .globl _EP4FIFOPFH 289 .globl _EP2FIFOPFL 290 .globl _EP2FIFOPFH 291 .globl _EP8AUTOINLENL 292 .globl _EP8AUTOINLENH 293 .globl _EP6AUTOINLENL 294 .globl _EP6AUTOINLENH 295 .globl _EP4AUTOINLENL 296 .globl _EP4AUTOINLENH 297 .globl _EP2AUTOINLENL 298 .globl _EP2AUTOINLENH 299 .globl _EP8FIFOCFG 300 .globl _EP6FIFOCFG 301 .globl _EP4FIFOCFG 302 .globl _EP2FIFOCFG 303 .globl _EP8CFG 304 .globl _EP6CFG 305 .globl _EP4CFG 306 .globl _EP2CFG 307 .globl _EP1INCFG 308 .globl _EP1OUTCFG 309 .globl _REVCTL 310 .globl _REVID 311 .globl _FIFOPINPOLAR 312 .globl _UART230 313 .globl _BPADDRL 314 .globl _BPADDRH 315 .globl _BREAKPT 316 .globl _FIFORESET 317 .globl _PINFLAGSCD 318 .globl _PINFLAGSAB 319 .globl _IFCONFIG 320 .globl _CPUCS 321 .globl _RES_WAVEDATA_END 322 .globl _GPIF_WAVE_DATA 323 .globl __usb_got_SUDAV 324 .globl _other_config_descr 325 .globl _current_config_descr 326 .globl _current_devqual_descr 327 .globl _current_device_descr 328 .globl __usb_alt_setting 329 .globl __usb_config 330 .globl _usb_install_handlers 331 .globl _usb_handle_setup_packet 332 ;-------------------------------------------------------- 333 ; special function registers 334 ;-------------------------------------------------------- 335 .area RSEG (ABS,DATA) 000000 336 .org 0x0000 000080 337 _IOA = 0x0080 000081 338 _SP = 0x0081 000082 339 _DPL = 0x0082 000083 340 _DPH = 0x0083 000084 341 _DPL1 = 0x0084 000085 342 _DPH1 = 0x0085 000086 343 _DPS = 0x0086 000087 344 _PCON = 0x0087 000088 345 _TCON = 0x0088 000089 346 _TMOD = 0x0089 00008A 347 _TL0 = 0x008a 00008B 348 _TL1 = 0x008b 00008C 349 _TH0 = 0x008c 00008D 350 _TH1 = 0x008d 00008E 351 _CKCON = 0x008e 000090 352 _IOB = 0x0090 000091 353 _EXIF = 0x0091 000092 354 _MPAGE = 0x0092 000098 355 _SCON0 = 0x0098 000099 356 _SBUF0 = 0x0099 00009A 357 _APTR1H = 0x009a 00009B 358 _APTR1L = 0x009b 00009C 359 _AUTODAT1 = 0x009c 00009D 360 _AUTOPTRH2 = 0x009d 00009E 361 _AUTOPTRL2 = 0x009e 00009F 362 _AUTODAT2 = 0x009f 0000A0 363 _IOC = 0x00a0 0000A1 364 _INT2CLR = 0x00a1 0000A2 365 _INT4CLR = 0x00a2 0000A8 366 _IE = 0x00a8 0000AA 367 _EP2468STAT = 0x00aa 0000AB 368 _EP24FIFOFLGS = 0x00ab 0000AC 369 _EP68FIFOFLGS = 0x00ac 0000AF 370 _AUTOPTRSETUP = 0x00af 0000B0 371 _IOD = 0x00b0 0000B1 372 _IOE = 0x00b1 0000B2 373 _OEA = 0x00b2 0000B3 374 _OEB = 0x00b3 0000B4 375 _OEC = 0x00b4 0000B5 376 _OED = 0x00b5 0000B6 377 _OEE = 0x00b6 0000B8 378 _IP = 0x00b8 0000BA 379 _EP01STAT = 0x00ba 0000BB 380 _GPIFTRIG = 0x00bb 0000BD 381 _GPIFSGLDATH = 0x00bd 0000BE 382 _GPIFSGLDATLX = 0x00be 0000BF 383 _GPIFSGLDATLNOX = 0x00bf 0000C0 384 _SCON1 = 0x00c0 0000C1 385 _SBUF1 = 0x00c1 0000C8 386 _T2CON = 0x00c8 0000CA 387 _RCAP2L = 0x00ca 0000CB 388 _RCAP2H = 0x00cb 0000CC 389 _TL2 = 0x00cc 0000CD 390 _TH2 = 0x00cd 0000D0 391 _PSW = 0x00d0 0000D8 392 _EICON = 0x00d8 0000E0 393 _ACC = 0x00e0 0000E8 394 _EIE = 0x00e8 0000F0 395 _B = 0x00f0 0000F8 396 _EIP = 0x00f8 397 ;-------------------------------------------------------- 398 ; special function bits 399 ;-------------------------------------------------------- 400 .area RSEG (ABS,DATA) 000000 401 .org 0x0000 000086 402 _SEL = 0x0086 000088 403 _IT0 = 0x0088 000089 404 _IE0 = 0x0089 00008A 405 _IT1 = 0x008a 00008B 406 _IE1 = 0x008b 00008C 407 _TR0 = 0x008c 00008D 408 _TF0 = 0x008d 00008E 409 _TR1 = 0x008e 00008F 410 _TF1 = 0x008f 000098 411 _RI = 0x0098 000099 412 _TI = 0x0099 00009A 413 _RB8 = 0x009a 00009B 414 _TB8 = 0x009b 00009C 415 _REN = 0x009c 00009D 416 _SM2 = 0x009d 00009E 417 _SM1 = 0x009e 00009F 418 _SM0 = 0x009f 0000A8 419 _EX0 = 0x00a8 0000A9 420 _ET0 = 0x00a9 0000AA 421 _EX1 = 0x00aa 0000AB 422 _ET1 = 0x00ab 0000AC 423 _ES0 = 0x00ac 0000AD 424 _ET2 = 0x00ad 0000AE 425 _ES1 = 0x00ae 0000AF 426 _EA = 0x00af 0000B8 427 _PX0 = 0x00b8 0000B9 428 _PT0 = 0x00b9 0000BA 429 _PX1 = 0x00ba 0000BB 430 _PT1 = 0x00bb 0000BC 431 _PS0 = 0x00bc 0000BD 432 _PT2 = 0x00bd 0000BE 433 _PS1 = 0x00be 0000C0 434 _RI1 = 0x00c0 0000C1 435 _TI1 = 0x00c1 0000C2 436 _RB81 = 0x00c2 0000C3 437 _TB81 = 0x00c3 0000C4 438 _REN1 = 0x00c4 0000C5 439 _SM21 = 0x00c5 0000C6 440 _SM11 = 0x00c6 0000C7 441 _SM01 = 0x00c7 0000C8 442 _CP_RL2 = 0x00c8 0000C9 443 _C_T2 = 0x00c9 0000CA 444 _TR2 = 0x00ca 0000CB 445 _EXEN2 = 0x00cb 0000CC 446 _TCLK = 0x00cc 0000CD 447 _RCLK = 0x00cd 0000CE 448 _EXF2 = 0x00ce 0000CF 449 _TF2 = 0x00cf 0000D0 450 _P = 0x00d0 0000D1 451 _FL = 0x00d1 0000D2 452 _OV = 0x00d2 0000D3 453 _RS0 = 0x00d3 0000D4 454 _RS1 = 0x00d4 0000D5 455 _F0 = 0x00d5 0000D6 456 _AC = 0x00d6 0000D7 457 _CY = 0x00d7 0000DB 458 _INT6 = 0x00db 0000DC 459 _RESI = 0x00dc 0000DD 460 _ERESI = 0x00dd 0000DF 461 _SMOD1 = 0x00df 0000E8 462 _EIUSB = 0x00e8 0000E9 463 _EI2C = 0x00e9 0000EA 464 _EIEX4 = 0x00ea 0000EB 465 _EIEX5 = 0x00eb 0000EC 466 _EIEX6 = 0x00ec 0000F8 467 _PUSB = 0x00f8 0000F9 468 _PI2C = 0x00f9 0000FA 469 _EIPX4 = 0x00fa 0000FB 470 _EIPX5 = 0x00fb 0000FC 471 _EIPX6 = 0x00fc 472 ;-------------------------------------------------------- 473 ; overlayable register banks 474 ;-------------------------------------------------------- 475 .area REG_BANK_0 (REL,OVR,DATA) 000000 476 .ds 8 477 ;-------------------------------------------------------- 478 ; overlayable bit register bank 479 ;-------------------------------------------------------- 480 .area BIT_BANK (REL,OVR,DATA) 000000 481 bits: 000000 482 .ds 1 008000 483 b0 = bits[0] 008100 484 b1 = bits[1] 008200 485 b2 = bits[2] 008300 486 b3 = bits[3] 008400 487 b4 = bits[4] 008500 488 b5 = bits[5] 008600 489 b6 = bits[6] 008700 490 b7 = bits[7] 491 ;-------------------------------------------------------- 492 ; internal ram data 493 ;-------------------------------------------------------- 494 .area DSEG (DATA) 000000 495 __usb_config:: 000000 496 .ds 1 000001 497 __usb_alt_setting:: 000001 498 .ds 1 000002 499 _current_device_descr:: 000002 500 .ds 2 000004 501 _current_devqual_descr:: 000004 502 .ds 2 000006 503 _current_config_descr:: 000006 504 .ds 2 000008 505 _other_config_descr:: 000008 506 .ds 2 507 ;-------------------------------------------------------- 508 ; overlayable items in internal ram 509 ;-------------------------------------------------------- 510 .area OSEG (OVR,DATA) 511 .area OSEG (OVR,DATA) 512 ;-------------------------------------------------------- 513 ; indirectly addressable internal ram data 514 ;-------------------------------------------------------- 515 .area ISEG (DATA) 516 ;-------------------------------------------------------- 517 ; absolute internal ram data 518 ;-------------------------------------------------------- 519 .area IABS (ABS,DATA) 520 .area IABS (ABS,DATA) 521 ;-------------------------------------------------------- 522 ; bit data 523 ;-------------------------------------------------------- 524 .area BSEG (BIT) 000000 525 __usb_got_SUDAV:: 000000 526 .ds 1 527 ;-------------------------------------------------------- 528 ; paged external ram data 529 ;-------------------------------------------------------- 530 .area PSEG (PAG,XDATA) 531 ;-------------------------------------------------------- 532 ; external ram data 533 ;-------------------------------------------------------- 534 .area XSEG (XDATA) 00E400 535 _GPIF_WAVE_DATA = 0xe400 00E480 536 _RES_WAVEDATA_END = 0xe480 00E600 537 _CPUCS = 0xe600 00E601 538 _IFCONFIG = 0xe601 00E602 539 _PINFLAGSAB = 0xe602 00E603 540 _PINFLAGSCD = 0xe603 00E604 541 _FIFORESET = 0xe604 00E605 542 _BREAKPT = 0xe605 00E606 543 _BPADDRH = 0xe606 00E607 544 _BPADDRL = 0xe607 00E608 545 _UART230 = 0xe608 00E609 546 _FIFOPINPOLAR = 0xe609 00E60A 547 _REVID = 0xe60a 00E60B 548 _REVCTL = 0xe60b 00E610 549 _EP1OUTCFG = 0xe610 00E611 550 _EP1INCFG = 0xe611 00E612 551 _EP2CFG = 0xe612 00E613 552 _EP4CFG = 0xe613 00E614 553 _EP6CFG = 0xe614 00E615 554 _EP8CFG = 0xe615 00E618 555 _EP2FIFOCFG = 0xe618 00E619 556 _EP4FIFOCFG = 0xe619 00E61A 557 _EP6FIFOCFG = 0xe61a 00E61B 558 _EP8FIFOCFG = 0xe61b 00E620 559 _EP2AUTOINLENH = 0xe620 00E621 560 _EP2AUTOINLENL = 0xe621 00E622 561 _EP4AUTOINLENH = 0xe622 00E623 562 _EP4AUTOINLENL = 0xe623 00E624 563 _EP6AUTOINLENH = 0xe624 00E625 564 _EP6AUTOINLENL = 0xe625 00E626 565 _EP8AUTOINLENH = 0xe626 00E627 566 _EP8AUTOINLENL = 0xe627 00E630 567 _EP2FIFOPFH = 0xe630 00E631 568 _EP2FIFOPFL = 0xe631 00E632 569 _EP4FIFOPFH = 0xe632 00E633 570 _EP4FIFOPFL = 0xe633 00E634 571 _EP6FIFOPFH = 0xe634 00E635 572 _EP6FIFOPFL = 0xe635 00E636 573 _EP8FIFOPFH = 0xe636 00E637 574 _EP8FIFOPFL = 0xe637 00E640 575 _EP2ISOINPKTS = 0xe640 00E641 576 _EP4ISOINPKTS = 0xe641 00E642 577 _EP6ISOINPKTS = 0xe642 00E643 578 _EP8ISOINPKTS = 0xe643 00E648 579 _INPKTEND = 0xe648 00E649 580 _OUTPKTEND = 0xe649 00E650 581 _EP2FIFOIE = 0xe650 00E651 582 _EP2FIFOIRQ = 0xe651 00E652 583 _EP4FIFOIE = 0xe652 00E653 584 _EP4FIFOIRQ = 0xe653 00E654 585 _EP6FIFOIE = 0xe654 00E655 586 _EP6FIFOIRQ = 0xe655 00E656 587 _EP8FIFOIE = 0xe656 00E657 588 _EP8FIFOIRQ = 0xe657 00E658 589 _IBNIE = 0xe658 00E659 590 _IBNIRQ = 0xe659 00E65A 591 _NAKIE = 0xe65a 00E65B 592 _NAKIRQ = 0xe65b 00E65C 593 _USBIE = 0xe65c 00E65D 594 _USBIRQ = 0xe65d 00E65E 595 _EPIE = 0xe65e 00E65F 596 _EPIRQ = 0xe65f 00E660 597 _GPIFIE = 0xe660 00E661 598 _GPIFIRQ = 0xe661 00E662 599 _USBERRIE = 0xe662 00E663 600 _USBERRIRQ = 0xe663 00E664 601 _ERRCNTLIM = 0xe664 00E665 602 _CLRERRCNT = 0xe665 00E666 603 _INT2IVEC = 0xe666 00E667 604 _INT4IVEC = 0xe667 00E668 605 _INTSETUP = 0xe668 00E670 606 _PORTACFG = 0xe670 00E671 607 _PORTCCFG = 0xe671 00E672 608 _PORTECFG = 0xe672 00E678 609 _I2CS = 0xe678 00E679 610 _I2DAT = 0xe679 00E67A 611 _I2CTL = 0xe67a 00E67B 612 _XAUTODAT1 = 0xe67b 00E67C 613 _XAUTODAT2 = 0xe67c 00E680 614 _USBCS = 0xe680 00E681 615 _SUSPEND = 0xe681 00E682 616 _WAKEUPCS = 0xe682 00E683 617 _TOGCTL = 0xe683 00E684 618 _USBFRAMEH = 0xe684 00E685 619 _USBFRAMEL = 0xe685 00E686 620 _MICROFRAME = 0xe686 00E687 621 _FNADDR = 0xe687 00E68A 622 _EP0BCH = 0xe68a 00E68B 623 _EP0BCL = 0xe68b 00E68D 624 _EP1OUTBC = 0xe68d 00E68F 625 _EP1INBC = 0xe68f 00E690 626 _EP2BCH = 0xe690 00E691 627 _EP2BCL = 0xe691 00E694 628 _EP4BCH = 0xe694 00E695 629 _EP4BCL = 0xe695 00E698 630 _EP6BCH = 0xe698 00E699 631 _EP6BCL = 0xe699 00E69C 632 _EP8BCH = 0xe69c 00E69D 633 _EP8BCL = 0xe69d 00E6A0 634 _EP0CS = 0xe6a0 00E6A1 635 _EP1OUTCS = 0xe6a1 00E6A2 636 _EP1INCS = 0xe6a2 00E6A3 637 _EP2CS = 0xe6a3 00E6A4 638 _EP4CS = 0xe6a4 00E6A5 639 _EP6CS = 0xe6a5 00E6A6 640 _EP8CS = 0xe6a6 00E6A7 641 _EP2FIFOFLGS = 0xe6a7 00E6A8 642 _EP4FIFOFLGS = 0xe6a8 00E6A9 643 _EP6FIFOFLGS = 0xe6a9 00E6AA 644 _EP8FIFOFLGS = 0xe6aa 00E6AB 645 _EP2FIFOBCH = 0xe6ab 00E6AC 646 _EP2FIFOBCL = 0xe6ac 00E6AD 647 _EP4FIFOBCH = 0xe6ad 00E6AE 648 _EP4FIFOBCL = 0xe6ae 00E6AF 649 _EP6FIFOBCH = 0xe6af 00E6B0 650 _EP6FIFOBCL = 0xe6b0 00E6B1 651 _EP8FIFOBCH = 0xe6b1 00E6B2 652 _EP8FIFOBCL = 0xe6b2 00E6B3 653 _SUDPTRH = 0xe6b3 00E6B4 654 _SUDPTRL = 0xe6b4 00E6B5 655 _SUDPTRCTL = 0xe6b5 00E6B8 656 _SETUPDAT = 0xe6b8 00E6C0 657 _GPIFWFSELECT = 0xe6c0 00E6C1 658 _GPIFIDLECS = 0xe6c1 00E6C2 659 _GPIFIDLECTL = 0xe6c2 00E6C3 660 _GPIFCTLCFG = 0xe6c3 00E6C4 661 _GPIFADRH = 0xe6c4 00E6C5 662 _GPIFADRL = 0xe6c5 00E6CE 663 _GPIFTCB3 = 0xe6ce 00E6CF 664 _GPIFTCB2 = 0xe6cf 00E6D0 665 _GPIFTCB1 = 0xe6d0 00E6D1 666 _GPIFTCB0 = 0xe6d1 00E6D2 667 _EP2GPIFFLGSEL = 0xe6d2 00E6D3 668 _EP2GPIFPFSTOP = 0xe6d3 00E6D4 669 _EP2GPIFTRIG = 0xe6d4 00E6DA 670 _EP4GPIFFLGSEL = 0xe6da 00E6DB 671 _EP4GPIFPFSTOP = 0xe6db 00E6DC 672 _EP4GPIFTRIG = 0xe6dc 00E6E2 673 _EP6GPIFFLGSEL = 0xe6e2 00E6E3 674 _EP6GPIFPFSTOP = 0xe6e3 00E6E4 675 _EP6GPIFTRIG = 0xe6e4 00E6EA 676 _EP8GPIFFLGSEL = 0xe6ea 00E6EB 677 _EP8GPIFPFSTOP = 0xe6eb 00E6EC 678 _EP8GPIFTRIG = 0xe6ec 00E6F0 679 _XGPIFSGLDATH = 0xe6f0 00E6F1 680 _XGPIFSGLDATLX = 0xe6f1 00E6F2 681 _XGPIFSGLDATLNOX = 0xe6f2 00E6F3 682 _GPIFREADYCFG = 0xe6f3 00E6F4 683 _GPIFREADYSTAT = 0xe6f4 00E6F5 684 _GPIFABORT = 0xe6f5 00E6C6 685 _FLOWSTATE = 0xe6c6 00E6C7 686 _FLOWLOGIC = 0xe6c7 00E6C8 687 _FLOWEQ0CTL = 0xe6c8 00E6C9 688 _FLOWEQ1CTL = 0xe6c9 00E6CA 689 _FLOWHOLDOFF = 0xe6ca 00E6CB 690 _FLOWSTB = 0xe6cb 00E6CC 691 _FLOWSTBEDGE = 0xe6cc 00E6CD 692 _FLOWSTBHPERIOD = 0xe6cd 00E60C 693 _GPIFHOLDAMOUNT = 0xe60c 00E67D 694 _UDMACRCH = 0xe67d 00E67E 695 _UDMACRCL = 0xe67e 00E67F 696 _UDMACRCQUAL = 0xe67f 00E6F8 697 _DBUG = 0xe6f8 00E6F9 698 _TESTCFG = 0xe6f9 00E6FA 699 _USBTEST = 0xe6fa 00E6FB 700 _CT1 = 0xe6fb 00E6FC 701 _CT2 = 0xe6fc 00E6FD 702 _CT3 = 0xe6fd 00E6FE 703 _CT4 = 0xe6fe 00E740 704 _EP0BUF = 0xe740 00E780 705 _EP1OUTBUF = 0xe780 00E7C0 706 _EP1INBUF = 0xe7c0 00F000 707 _EP2FIFOBUF = 0xf000 00F400 708 _EP4FIFOBUF = 0xf400 00F800 709 _EP6FIFOBUF = 0xf800 00FC00 710 _EP8FIFOBUF = 0xfc00 711 ;-------------------------------------------------------- 712 ; absolute external ram data 713 ;-------------------------------------------------------- 714 .area XABS (ABS,XDATA) 715 ;-------------------------------------------------------- 716 ; external initialized ram data 717 ;-------------------------------------------------------- 718 .area HOME (CODE) 719 .area GSINIT0 (CODE) 720 .area GSINIT1 (CODE) 721 .area GSINIT2 (CODE) 722 .area GSINIT3 (CODE) 723 .area GSINIT4 (CODE) 724 .area GSINIT5 (CODE) 725 .area GSINIT (CODE) 726 .area GSFINAL (CODE) 727 .area CSEG (CODE) 728 ;-------------------------------------------------------- 729 ; global & static initialisations 730 ;-------------------------------------------------------- 731 .area HOME (CODE) 732 .area GSINIT (CODE) 733 .area GSFINAL (CODE) 734 .area GSINIT (CODE) 735 ; usb_common.c:53: unsigned char _usb_config = 0; 000000 75*00 00 [24] 736 mov __usb_config,#0x00 737 ; usb_common.c:54: unsigned char _usb_alt_setting = 0; // FIXME really 1/interface 000003 75*01 00 [24] 738 mov __usb_alt_setting,#0x00 739 ;-------------------------------------------------------- 740 ; Home 741 ;-------------------------------------------------------- 742 .area HOME (CODE) 743 .area HOME (CODE) 744 ;-------------------------------------------------------- 745 ; code 746 ;-------------------------------------------------------- 747 .area CSEG (CODE) 748 ;------------------------------------------------------------ 749 ;Allocation info for local variables in function 'setup_descriptors' 750 ;------------------------------------------------------------ 751 ; usb_common.c:62: setup_descriptors (void) 752 ; ----------------------------------------- 753 ; function setup_descriptors 754 ; ----------------------------------------- 000000 755 _setup_descriptors: 000007 756 ar7 = 0x07 000006 757 ar6 = 0x06 000005 758 ar5 = 0x05 000004 759 ar4 = 0x04 000003 760 ar3 = 0x03 000002 761 ar2 = 0x02 000001 762 ar1 = 0x01 000000 763 ar0 = 0x00 764 ; usb_common.c:64: if (USBCS & bmHSM){ // high speed mode 000000 90 E6 80 [24] 765 mov dptr,#_USBCS 000003 E0 [24] 766 movx a,@dptr 000004 30 E7 19 [24] 767 jnb acc.7,00102$ 768 ; usb_common.c:65: current_device_descr = high_speed_device_descr; 000007 75*02r00 [24] 769 mov _current_device_descr,#_high_speed_device_descr 00000A 75*03s00 [24] 770 mov (_current_device_descr + 1),#(_high_speed_device_descr >> 8) 771 ; usb_common.c:66: current_devqual_descr = high_speed_devqual_descr; 00000D 75*04r00 [24] 772 mov _current_devqual_descr,#_high_speed_devqual_descr 000010 75*05s00 [24] 773 mov (_current_devqual_descr + 1),#(_high_speed_devqual_descr >> 8) 774 ; usb_common.c:67: current_config_descr = high_speed_config_descr; 000013 75*06r00 [24] 775 mov _current_config_descr,#_high_speed_config_descr 000016 75*07s00 [24] 776 mov (_current_config_descr + 1),#(_high_speed_config_descr >> 8) 777 ; usb_common.c:68: other_config_descr = full_speed_config_descr; 000019 75*08r00 [24] 778 mov _other_config_descr,#_full_speed_config_descr 00001C 75*09s00 [24] 779 mov (_other_config_descr + 1),#(_full_speed_config_descr >> 8) 00001F 22 [24] 780 ret 000020 781 00102$: 782 ; usb_common.c:71: current_device_descr = full_speed_device_descr; 000020 75*02r00 [24] 783 mov _current_device_descr,#_full_speed_device_descr 000023 75*03s00 [24] 784 mov (_current_device_descr + 1),#(_full_speed_device_descr >> 8) 785 ; usb_common.c:72: current_devqual_descr = full_speed_devqual_descr; 000026 75*04r00 [24] 786 mov _current_devqual_descr,#_full_speed_devqual_descr 000029 75*05s00 [24] 787 mov (_current_devqual_descr + 1),#(_full_speed_devqual_descr >> 8) 788 ; usb_common.c:73: current_config_descr = full_speed_config_descr; 00002C 75*06r00 [24] 789 mov _current_config_descr,#_full_speed_config_descr 00002F 75*07s00 [24] 790 mov (_current_config_descr + 1),#(_full_speed_config_descr >> 8) 791 ; usb_common.c:74: other_config_descr = high_speed_config_descr; 000032 75*08r00 [24] 792 mov _other_config_descr,#_high_speed_config_descr 000035 75*09s00 [24] 793 mov (_other_config_descr + 1),#(_high_speed_config_descr >> 8) 794 ; usb_common.c:81: } 000038 22 [24] 795 ret 796 ;------------------------------------------------------------ 797 ;Allocation info for local variables in function 'isr_SUDAV' 798 ;------------------------------------------------------------ 799 ; usb_common.c:84: isr_SUDAV (void) __interrupt 800 ; ----------------------------------------- 801 ; function isr_SUDAV 802 ; ----------------------------------------- 000039 803 _isr_SUDAV: 804 ; usb_common.c:86: clear_usb_irq (); 000039 53 91 EF [24] 805 anl _EXIF,#0xef 00003C 75 A1 00 [24] 806 mov _INT2CLR,#0x00 807 ; usb_common.c:87: _usb_got_SUDAV = 1; 808 ; assignBit 00003F D2*00 [12] 809 setb __usb_got_SUDAV 810 ; usb_common.c:88: } 000041 32 [24] 811 reti 812 ; eliminated unneeded mov psw,# (no regs used in bank) 813 ; eliminated unneeded push/pop not_psw 814 ; eliminated unneeded push/pop dpl 815 ; eliminated unneeded push/pop dph 816 ; eliminated unneeded push/pop b 817 ; eliminated unneeded push/pop acc 818 ;------------------------------------------------------------ 819 ;Allocation info for local variables in function 'isr_USBRESET' 820 ;------------------------------------------------------------ 821 ; usb_common.c:91: isr_USBRESET (void) __interrupt 822 ; ----------------------------------------- 823 ; function isr_USBRESET 824 ; ----------------------------------------- 000042 825 _isr_USBRESET: 000042 C0*00 [24] 826 push bits 000044 C0 E0 [24] 827 push acc 000046 C0 F0 [24] 828 push b 000048 C0 82 [24] 829 push dpl 00004A C0 83 [24] 830 push dph 00004C C0 07 [24] 831 push (0+7) 00004E C0 06 [24] 832 push (0+6) 000050 C0 05 [24] 833 push (0+5) 000052 C0 04 [24] 834 push (0+4) 000054 C0 03 [24] 835 push (0+3) 000056 C0 02 [24] 836 push (0+2) 000058 C0 01 [24] 837 push (0+1) 00005A C0 00 [24] 838 push (0+0) 00005C C0 D0 [24] 839 push psw 00005E 75 D0 00 [24] 840 mov psw,#0x00 841 ; usb_common.c:93: clear_usb_irq (); 000061 53 91 EF [24] 842 anl _EXIF,#0xef 000064 75 A1 00 [24] 843 mov _INT2CLR,#0x00 844 ; usb_common.c:94: setup_descriptors (); 000067 12r00r00 [24] 845 lcall _setup_descriptors 846 ; usb_common.c:95: } 00006A D0 D0 [24] 847 pop psw 00006C D0 00 [24] 848 pop (0+0) 00006E D0 01 [24] 849 pop (0+1) 000070 D0 02 [24] 850 pop (0+2) 000072 D0 03 [24] 851 pop (0+3) 000074 D0 04 [24] 852 pop (0+4) 000076 D0 05 [24] 853 pop (0+5) 000078 D0 06 [24] 854 pop (0+6) 00007A D0 07 [24] 855 pop (0+7) 00007C D0 83 [24] 856 pop dph 00007E D0 82 [24] 857 pop dpl 000080 D0 F0 [24] 858 pop b 000082 D0 E0 [24] 859 pop acc 000084 D0*00 [24] 860 pop bits 000086 32 [24] 861 reti 862 ;------------------------------------------------------------ 863 ;Allocation info for local variables in function 'isr_HIGHSPEED' 864 ;------------------------------------------------------------ 865 ; usb_common.c:98: isr_HIGHSPEED (void) __interrupt 866 ; ----------------------------------------- 867 ; function isr_HIGHSPEED 868 ; ----------------------------------------- 000087 869 _isr_HIGHSPEED: 000087 C0*00 [24] 870 push bits 000089 C0 E0 [24] 871 push acc 00008B C0 F0 [24] 872 push b 00008D C0 82 [24] 873 push dpl 00008F C0 83 [24] 874 push dph 000091 C0 07 [24] 875 push (0+7) 000093 C0 06 [24] 876 push (0+6) 000095 C0 05 [24] 877 push (0+5) 000097 C0 04 [24] 878 push (0+4) 000099 C0 03 [24] 879 push (0+3) 00009B C0 02 [24] 880 push (0+2) 00009D C0 01 [24] 881 push (0+1) 00009F C0 00 [24] 882 push (0+0) 0000A1 C0 D0 [24] 883 push psw 0000A3 75 D0 00 [24] 884 mov psw,#0x00 885 ; usb_common.c:100: clear_usb_irq (); 0000A6 53 91 EF [24] 886 anl _EXIF,#0xef 0000A9 75 A1 00 [24] 887 mov _INT2CLR,#0x00 888 ; usb_common.c:101: setup_descriptors (); 0000AC 12r00r00 [24] 889 lcall _setup_descriptors 890 ; usb_common.c:102: } 0000AF D0 D0 [24] 891 pop psw 0000B1 D0 00 [24] 892 pop (0+0) 0000B3 D0 01 [24] 893 pop (0+1) 0000B5 D0 02 [24] 894 pop (0+2) 0000B7 D0 03 [24] 895 pop (0+3) 0000B9 D0 04 [24] 896 pop (0+4) 0000BB D0 05 [24] 897 pop (0+5) 0000BD D0 06 [24] 898 pop (0+6) 0000BF D0 07 [24] 899 pop (0+7) 0000C1 D0 83 [24] 900 pop dph 0000C3 D0 82 [24] 901 pop dpl 0000C5 D0 F0 [24] 902 pop b 0000C7 D0 E0 [24] 903 pop acc 0000C9 D0*00 [24] 904 pop bits 0000CB 32 [24] 905 reti 906 ;------------------------------------------------------------ 907 ;Allocation info for local variables in function 'usb_install_handlers' 908 ;------------------------------------------------------------ 909 ; usb_common.c:105: usb_install_handlers (void) 910 ; ----------------------------------------- 911 ; function usb_install_handlers 912 ; ----------------------------------------- 0000CC 913 _usb_install_handlers: 914 ; usb_common.c:107: setup_descriptors (); // ensure that they're set before use 0000CC 12r00r00 [24] 915 lcall _setup_descriptors 916 ; usb_common.c:109: hook_uv (UV_SUDAV, (unsigned short) isr_SUDAV); 0000CF 75*00r39 [24] 917 mov _hook_uv_PARM_2,#_isr_SUDAV 0000D2 75*01s00 [24] 918 mov (_hook_uv_PARM_2 + 1),#(_isr_SUDAV >> 8) 0000D5 75 82 00 [24] 919 mov dpl,#0x00 0000D8 12r00r00 [24] 920 lcall _hook_uv 921 ; usb_common.c:110: hook_uv (UV_USBRESET, (unsigned short) isr_USBRESET); 0000DB 75*00r42 [24] 922 mov _hook_uv_PARM_2,#_isr_USBRESET 0000DE 75*01s00 [24] 923 mov (_hook_uv_PARM_2 + 1),#(_isr_USBRESET >> 8) 0000E1 75 82 10 [24] 924 mov dpl,#0x10 0000E4 12r00r00 [24] 925 lcall _hook_uv 926 ; usb_common.c:111: hook_uv (UV_HIGHSPEED, (unsigned short) isr_HIGHSPEED); 0000E7 75*00r87 [24] 927 mov _hook_uv_PARM_2,#_isr_HIGHSPEED 0000EA 75*01s00 [24] 928 mov (_hook_uv_PARM_2 + 1),#(_isr_HIGHSPEED >> 8) 0000ED 75 82 14 [24] 929 mov dpl,#0x14 0000F0 12r00r00 [24] 930 lcall _hook_uv 931 ; usb_common.c:113: USBIE = bmSUDAV | bmURES | bmHSGRANT; 0000F3 90 E6 5C [24] 932 mov dptr,#_USBIE 0000F6 74 31 [12] 933 mov a,#0x31 0000F8 F0 [24] 934 movx @dptr,a 935 ; usb_common.c:114: } 0000F9 22 [24] 936 ret 937 ;------------------------------------------------------------ 938 ;Allocation info for local variables in function 'plausible_endpoint' 939 ;------------------------------------------------------------ 940 ;ep Allocated to registers r7 941 ;------------------------------------------------------------ 942 ; usb_common.c:120: plausible_endpoint (unsigned char ep) 943 ; ----------------------------------------- 944 ; function plausible_endpoint 945 ; ----------------------------------------- 0000FA 946 _plausible_endpoint: 947 ; usb_common.c:122: ep &= ~0x80; // ignore direction bit 948 ; usb_common.c:124: if (ep > 8) 0000FA E5 82 [12] 949 mov a,dpl 0000FC 54 7F [12] 950 anl a,#0x7f 0000FE FF [12] 951 mov r7,a 0000FF 24 F7 [12] 952 add a,#0xff - 0x08 000101 50 04 [24] 953 jnc 00102$ 954 ; usb_common.c:125: return 0; 000103 75 82 00 [24] 955 mov dpl,#0x00 000106 22 [24] 956 ret 000107 957 00102$: 958 ; usb_common.c:127: if (ep == 1) 000107 BF 01 04 [24] 959 cjne r7,#0x01,00104$ 960 ; usb_common.c:128: return 1; 00010A 75 82 01 [24] 961 mov dpl,#0x01 00010D 22 [24] 962 ret 00010E 963 00104$: 964 ; usb_common.c:130: return (ep & 0x1) == 0; // must be even 00010E 53 07 01 [24] 965 anl ar7,#0x01 000111 7E 00 [12] 966 mov r6,#0x00 000113 E4 [12] 967 clr a 000114 BF 00 04 [24] 968 cjne r7,#0x00,00120$ 000117 BE 00 01 [24] 969 cjne r6,#0x00,00120$ 00011A 04 [12] 970 inc a 00011B 971 00120$: 00011B F5 82 [12] 972 mov dpl,a 973 ; usb_common.c:131: } 00011D 22 [24] 974 ret 975 ;------------------------------------------------------------ 976 ;Allocation info for local variables in function 'epcs' 977 ;------------------------------------------------------------ 978 ;ep Allocated to registers r7 979 ;------------------------------------------------------------ 980 ; usb_common.c:137: epcs (unsigned char ep) 981 ; ----------------------------------------- 982 ; function epcs 983 ; ----------------------------------------- 00011E 984 _epcs: 00011E AF 82 [24] 985 mov r7,dpl 986 ; usb_common.c:139: if (ep == 0x01) // ep1 has different in and out CS regs 000120 BF 01 0C [24] 987 cjne r7,#0x01,00102$ 988 ; usb_common.c:140: return EP1OUTCS; 000123 90 E6 A1 [24] 989 mov dptr,#_EP1OUTCS 000126 E0 [24] 990 movx a,@dptr 000127 FE [12] 991 mov r6,a 000128 7D 00 [12] 992 mov r5,#0x00 00012A 8E 82 [24] 993 mov dpl,r6 00012C 8D 83 [24] 994 mov dph,r5 00012E 22 [24] 995 ret 00012F 996 00102$: 997 ; usb_common.c:142: if (ep == 0x81) 00012F BF 81 0C [24] 998 cjne r7,#0x81,00104$ 999 ; usb_common.c:143: return EP1INCS; 000132 90 E6 A2 [24] 1000 mov dptr,#_EP1INCS 000135 E0 [24] 1001 movx a,@dptr 000136 FE [12] 1002 mov r6,a 000137 7D 00 [12] 1003 mov r5,#0x00 000139 8E 82 [24] 1004 mov dpl,r6 00013B 8D 83 [24] 1005 mov dph,r5 00013D 22 [24] 1006 ret 00013E 1007 00104$: 1008 ; usb_common.c:145: ep &= ~0x80; // ignore direction bit 00013E 53 07 7F [24] 1009 anl ar7,#0x7f 1010 ; usb_common.c:147: if (ep == 0x00) // ep0 000141 EF [12] 1011 mov a,r7 000142 70 0C [24] 1012 jnz 00106$ 1013 ; usb_common.c:148: return EP0CS; 000144 90 E6 A0 [24] 1014 mov dptr,#_EP0CS 000147 E0 [24] 1015 movx a,@dptr 000148 FE [12] 1016 mov r6,a 000149 7D 00 [12] 1017 mov r5,#0x00 00014B 8E 82 [24] 1018 mov dpl,r6 00014D 8D 83 [24] 1019 mov dph,r5 00014F 22 [24] 1020 ret 000150 1021 00106$: 1022 ; usb_common.c:150: return EP2CS + (ep >> 1); // 2, 4, 6, 8 are consecutive 000150 90 E6 A3 [24] 1023 mov dptr,#_EP2CS 000153 E0 [24] 1024 movx a,@dptr 000154 FE [12] 1025 mov r6,a 000155 7D 00 [12] 1026 mov r5,#0x00 000157 EF [12] 1027 mov a,r7 000158 C3 [12] 1028 clr c 000159 13 [12] 1029 rrc a 00015A 7C 00 [12] 1030 mov r4,#0x00 00015C 2E [12] 1031 add a,r6 00015D FE [12] 1032 mov r6,a 00015E EC [12] 1033 mov a,r4 00015F 3D [12] 1034 addc a,r5 1035 ; usb_common.c:151: } 000160 8E 82 [24] 1036 mov dpl,r6 000162 F5 83 [12] 1037 mov dph,a 000164 22 [24] 1038 ret 1039 ;------------------------------------------------------------ 1040 ;Allocation info for local variables in function 'usb_handle_setup_packet' 1041 ;------------------------------------------------------------ 1042 ;p Allocated to registers r6 r7 1043 ;__3932160000 Allocated to registers r6 r7 1044 ;__3276800001 Allocated to registers r6 r7 1045 ;------------------------------------------------------------ 1046 ; usb_common.c:154: usb_handle_setup_packet (void) 1047 ; ----------------------------------------- 1048 ; function usb_handle_setup_packet 1049 ; ----------------------------------------- 000165 1050 _usb_handle_setup_packet: 1051 ; usb_common.c:156: _usb_got_SUDAV = 0; 1052 ; assignBit 000165 C2*00 [12] 1053 clr __usb_got_SUDAV 1054 ; usb_common.c:160: switch (bRequestType & bmRT_TYPE_MASK){ 000167 90 E6 B8 [24] 1055 mov dptr,#_SETUPDAT 00016A E0 [24] 1056 movx a,@dptr 00016B FF [12] 1057 mov r7,a 00016C 53 07 60 [24] 1058 anl ar7,#0x60 00016F 8F 06 [24] 1059 mov ar6,r7 000171 BE 00 02 [24] 1060 cjne r6,#0x00,00290$ 000174 80 28 [24] 1061 sjmp 00106$ 000176 1062 00290$: 000176 BF 20 02 [24] 1063 cjne r7,#0x20,00291$ 000179 80 0D [24] 1064 sjmp 00102$ 00017B 1065 00291$: 00017B BF 40 02 [24] 1066 cjne r7,#0x40,00292$ 00017E 80 0E [24] 1067 sjmp 00103$ 000180 1068 00292$: 000180 BF 60 02 [24] 1069 cjne r7,#0x60,00293$ 000183 80 03 [24] 1070 sjmp 00294$ 000185 1071 00293$: 000185 02r04r23 [24] 1072 ljmp 00175$ 000188 1073 00294$: 1074 ; usb_common.c:163: case bmRT_TYPE_RESERVED: 000188 1075 00102$: 1076 ; usb_common.c:164: fx2_stall_ep0 (); // we don't handle these. indicate error 000188 12r00r00 [24] 1077 lcall _fx2_stall_ep0 1078 ; usb_common.c:165: break; 00018B 02r04r23 [24] 1079 ljmp 00175$ 1080 ; usb_common.c:167: case bmRT_TYPE_VENDOR: 00018E 1081 00103$: 1082 ; usb_common.c:171: if (!app_vendor_cmd ()) 00018E 12r00r00 [24] 1083 lcall _app_vendor_cmd 000191 E5 82 [12] 1084 mov a,dpl 000193 60 03 [24] 1085 jz 00295$ 000195 02r04r23 [24] 1086 ljmp 00175$ 000198 1087 00295$: 1088 ; usb_common.c:172: fx2_stall_ep0 (); 000198 12r00r00 [24] 1089 lcall _fx2_stall_ep0 1090 ; usb_common.c:173: break; 00019B 02r04r23 [24] 1091 ljmp 00175$ 1092 ; usb_common.c:175: case bmRT_TYPE_STD: 00019E 1093 00106$: 1094 ; usb_common.c:178: if ((bRequestType & bmRT_DIR_MASK) == bmRT_DIR_IN){ 00019E 90 E6 B8 [24] 1095 mov dptr,#_SETUPDAT 0001A1 E0 [24] 1096 movx a,@dptr 0001A2 FF [12] 1097 mov r7,a 0001A3 53 07 80 [24] 1098 anl ar7,#0x80 0001A6 BF 80 02 [24] 1099 cjne r7,#0x80,00296$ 0001A9 80 03 [24] 1100 sjmp 00297$ 0001AB 1101 00296$: 0001AB 02r03r28 [24] 1102 ljmp 00173$ 0001AE 1103 00297$: 1104 ; usb_common.c:184: switch (bRequest){ 0001AE 90 E6 B9 [24] 1105 mov dptr,#(_SETUPDAT + 0x0001) 0001B1 E0 [24] 1106 movx a,@dptr 0001B2 FF [12] 1107 mov r7,a 0001B3 BF 00 03 [24] 1108 cjne r7,#0x00,00298$ 0001B6 02r02r9D [24] 1109 ljmp 00128$ 0001B9 1110 00298$: 0001B9 BF 06 02 [24] 1111 cjne r7,#0x06,00299$ 0001BC 80 33 [24] 1112 sjmp 00109$ 0001BE 1113 00299$: 0001BE BF 08 02 [24] 1114 cjne r7,#0x08,00300$ 0001C1 80 08 [24] 1115 sjmp 00107$ 0001C3 1116 00300$: 0001C3 BF 0A 02 [24] 1117 cjne r7,#0x0a,00301$ 0001C6 80 16 [24] 1118 sjmp 00108$ 0001C8 1119 00301$: 0001C8 02r03r22 [24] 1120 ljmp 00138$ 1121 ; usb_common.c:186: case RQ_GET_CONFIG: 0001CB 1122 00107$: 1123 ; usb_common.c:187: EP0BUF[0] = _usb_config; // FIXME app should handle 0001CB 90 E7 40 [24] 1124 mov dptr,#_EP0BUF 0001CE E5*00 [12] 1125 mov a,__usb_config 0001D0 F0 [24] 1126 movx @dptr,a 1127 ; usb_common.c:188: EP0BCH = 0; 0001D1 90 E6 8A [24] 1128 mov dptr,#_EP0BCH 0001D4 E4 [12] 1129 clr a 0001D5 F0 [24] 1130 movx @dptr,a 1131 ; usb_common.c:189: EP0BCL = 1; 0001D6 90 E6 8B [24] 1132 mov dptr,#_EP0BCL 0001D9 04 [12] 1133 inc a 0001DA F0 [24] 1134 movx @dptr,a 1135 ; usb_common.c:190: break; 0001DB 02r04r23 [24] 1136 ljmp 00175$ 1137 ; usb_common.c:194: case RQ_GET_INTERFACE: 0001DE 1138 00108$: 1139 ; usb_common.c:195: EP0BUF[0] = _usb_alt_setting; // FIXME app should handle 0001DE 90 E7 40 [24] 1140 mov dptr,#_EP0BUF 0001E1 E5*01 [12] 1141 mov a,__usb_alt_setting 0001E3 F0 [24] 1142 movx @dptr,a 1143 ; usb_common.c:196: EP0BCH = 0; 0001E4 90 E6 8A [24] 1144 mov dptr,#_EP0BCH 0001E7 E4 [12] 1145 clr a 0001E8 F0 [24] 1146 movx @dptr,a 1147 ; usb_common.c:197: EP0BCL = 1; 0001E9 90 E6 8B [24] 1148 mov dptr,#_EP0BCL 0001EC 04 [12] 1149 inc a 0001ED F0 [24] 1150 movx @dptr,a 1151 ; usb_common.c:198: break; 0001EE 02r04r23 [24] 1152 ljmp 00175$ 1153 ; usb_common.c:202: case RQ_GET_DESCR: 0001F1 1154 00109$: 1155 ; usb_common.c:203: switch (wValueH){ 0001F1 90 E6 BB [24] 1156 mov dptr,#(_SETUPDAT + 0x0003) 0001F4 E0 [24] 1157 movx a,@dptr 0001F5 FF [12] 1158 mov r7,a 0001F6 BF 01 02 [24] 1159 cjne r7,#0x01,00302$ 0001F9 80 17 [24] 1160 sjmp 00110$ 0001FB 1161 00302$: 0001FB BF 02 02 [24] 1162 cjne r7,#0x02,00303$ 0001FE 80 36 [24] 1163 sjmp 00114$ 000200 1164 00303$: 000200 BF 03 02 [24] 1165 cjne r7,#0x03,00304$ 000203 80 55 [24] 1166 sjmp 00122$ 000205 1167 00304$: 000205 BF 06 02 [24] 1168 cjne r7,#0x06,00305$ 000208 80 1A [24] 1169 sjmp 00111$ 00020A 1170 00305$: 00020A BF 07 02 [24] 1171 cjne r7,#0x07,00306$ 00020D 80 39 [24] 1172 sjmp 00119$ 00020F 1173 00306$: 00020F 02r02r97 [24] 1174 ljmp 00126$ 1175 ; usb_common.c:205: case DT_DEVICE: 000212 1176 00110$: 1177 ; usb_common.c:206: SUDPTRH = MSB (current_device_descr); 000212 AE*02 [24] 1178 mov r6,_current_device_descr 000214 AF*03 [24] 1179 mov r7,(_current_device_descr + 1) 000216 90 E6 B3 [24] 1180 mov dptr,#_SUDPTRH 000219 EF [12] 1181 mov a,r7 00021A F0 [24] 1182 movx @dptr,a 1183 ; usb_common.c:207: SUDPTRL = LSB (current_device_descr); 00021B 90 E6 B4 [24] 1184 mov dptr,#_SUDPTRL 00021E E5*02 [12] 1185 mov a,_current_device_descr 000220 F0 [24] 1186 movx @dptr,a 1187 ; usb_common.c:208: break; 000221 02r04r23 [24] 1188 ljmp 00175$ 1189 ; usb_common.c:210: case DT_DEVQUAL: 000224 1190 00111$: 1191 ; usb_common.c:211: SUDPTRH = MSB (current_devqual_descr); 000224 AE*04 [24] 1192 mov r6,_current_devqual_descr 000226 AF*05 [24] 1193 mov r7,(_current_devqual_descr + 1) 000228 90 E6 B3 [24] 1194 mov dptr,#_SUDPTRH 00022B EF [12] 1195 mov a,r7 00022C F0 [24] 1196 movx @dptr,a 1197 ; usb_common.c:212: SUDPTRL = LSB (current_devqual_descr); 00022D 90 E6 B4 [24] 1198 mov dptr,#_SUDPTRL 000230 E5*04 [12] 1199 mov a,_current_devqual_descr 000232 F0 [24] 1200 movx @dptr,a 1201 ; usb_common.c:213: break; 000233 02r04r23 [24] 1202 ljmp 00175$ 1203 ; usb_common.c:217: fx2_stall_ep0 (); 000236 1204 00114$: 1205 ; usb_common.c:219: SUDPTRH = MSB (current_config_descr); 000236 AE*06 [24] 1206 mov r6,_current_config_descr 000238 AF*07 [24] 1207 mov r7,(_current_config_descr + 1) 00023A 90 E6 B3 [24] 1208 mov dptr,#_SUDPTRH 00023D EF [12] 1209 mov a,r7 00023E F0 [24] 1210 movx @dptr,a 1211 ; usb_common.c:220: SUDPTRL = LSB (current_config_descr); 00023F 90 E6 B4 [24] 1212 mov dptr,#_SUDPTRL 000242 E5*06 [12] 1213 mov a,_current_config_descr 000244 F0 [24] 1214 movx @dptr,a 1215 ; usb_common.c:222: break; 000245 02r04r23 [24] 1216 ljmp 00175$ 1217 ; usb_common.c:226: fx2_stall_ep0 (); 000248 1218 00119$: 1219 ; usb_common.c:228: SUDPTRH = MSB (other_config_descr); 000248 AE*08 [24] 1220 mov r6,_other_config_descr 00024A AF*09 [24] 1221 mov r7,(_other_config_descr + 1) 00024C 90 E6 B3 [24] 1222 mov dptr,#_SUDPTRH 00024F EF [12] 1223 mov a,r7 000250 F0 [24] 1224 movx @dptr,a 1225 ; usb_common.c:229: SUDPTRL = LSB (other_config_descr); 000251 90 E6 B4 [24] 1226 mov dptr,#_SUDPTRL 000254 E5*08 [12] 1227 mov a,_other_config_descr 000256 F0 [24] 1228 movx @dptr,a 1229 ; usb_common.c:231: break; 000257 02r04r23 [24] 1230 ljmp 00175$ 1231 ; usb_common.c:233: case DT_STRING: 00025A 1232 00122$: 1233 ; usb_common.c:234: if (wValueL >= nstring_descriptors) 00025A 90 E6 BA [24] 1234 mov dptr,#(_SETUPDAT + 0x0002) 00025D E0 [24] 1235 movx a,@dptr 00025E FF [12] 1236 mov r7,a 00025F 90r00r00 [24] 1237 mov dptr,#_nstring_descriptors 000262 E0 [24] 1238 movx a,@dptr 000263 FE [12] 1239 mov r6,a 000264 C3 [12] 1240 clr c 000265 EF [12] 1241 mov a,r7 000266 9E [12] 1242 subb a,r6 000267 40 06 [24] 1243 jc 00124$ 1244 ; usb_common.c:235: fx2_stall_ep0 (); 000269 12r00r00 [24] 1245 lcall _fx2_stall_ep0 00026C 02r04r23 [24] 1246 ljmp 00175$ 00026F 1247 00124$: 1248 ; usb_common.c:237: __xdata char *p = string_descriptors[wValueL]; 00026F 90 E6 BA [24] 1249 mov dptr,#(_SETUPDAT + 0x0002) 000272 E0 [24] 1250 movx a,@dptr 000273 75 F0 02 [24] 1251 mov b,#0x02 000276 A4 [48] 1252 mul ab 000277 24r00 [12] 1253 add a,#_string_descriptors 000279 F5 82 [12] 1254 mov dpl,a 00027B 74s00 [12] 1255 mov a,#(_string_descriptors >> 8) 00027D 35 F0 [12] 1256 addc a,b 00027F F5 83 [12] 1257 mov dph,a 000281 E0 [24] 1258 movx a,@dptr 000282 FE [12] 1259 mov r6,a 000283 A3 [24] 1260 inc dptr 000284 E0 [24] 1261 movx a,@dptr 000285 FF [12] 1262 mov r7,a 1263 ; usb_common.c:238: SUDPTRH = MSB (p); 000286 8E 04 [24] 1264 mov ar4,r6 000288 8F 05 [24] 1265 mov ar5,r7 00028A 90 E6 B3 [24] 1266 mov dptr,#_SUDPTRH 00028D ED [12] 1267 mov a,r5 00028E F0 [24] 1268 movx @dptr,a 1269 ; usb_common.c:239: SUDPTRL = LSB (p); 00028F 90 E6 B4 [24] 1270 mov dptr,#_SUDPTRL 000292 EE [12] 1271 mov a,r6 000293 F0 [24] 1272 movx @dptr,a 1273 ; usb_common.c:241: break; 000294 02r04r23 [24] 1274 ljmp 00175$ 1275 ; usb_common.c:243: default: 000297 1276 00126$: 1277 ; usb_common.c:244: fx2_stall_ep0 (); // invalid request 000297 12r00r00 [24] 1278 lcall _fx2_stall_ep0 1279 ; usb_common.c:247: break; 00029A 02r04r23 [24] 1280 ljmp 00175$ 1281 ; usb_common.c:251: case RQ_GET_STATUS: 00029D 1282 00128$: 1283 ; usb_common.c:252: switch (bRequestType & bmRT_RECIP_MASK){ 00029D 90 E6 B8 [24] 1284 mov dptr,#_SETUPDAT 0002A0 E0 [24] 1285 movx a,@dptr 0002A1 FF [12] 1286 mov r7,a 0002A2 53 07 1F [24] 1287 anl ar7,#0x1f 0002A5 8F 06 [24] 1288 mov ar6,r7 0002A7 BE 00 02 [24] 1289 cjne r6,#0x00,00308$ 0002AA 80 0A [24] 1290 sjmp 00129$ 0002AC 1291 00308$: 0002AC BE 01 02 [24] 1292 cjne r6,#0x01,00309$ 0002AF 80 1D [24] 1293 sjmp 00130$ 0002B1 1294 00309$: 1295 ; usb_common.c:253: case bmRT_RECIP_DEVICE: 0002B1 BF 02 68 [24] 1296 cjne r7,#0x02,00135$ 0002B4 80 2E [24] 1297 sjmp 00131$ 0002B6 1298 00129$: 1299 ; usb_common.c:254: EP0BUF[0] = bmGSDA_SELF_POWERED; // FIXME app should handle 0002B6 90 E7 40 [24] 1300 mov dptr,#_EP0BUF 0002B9 74 01 [12] 1301 mov a,#0x01 0002BB F0 [24] 1302 movx @dptr,a 1303 ; usb_common.c:255: EP0BUF[1] = 0; 0002BC 90 E7 41 [24] 1304 mov dptr,#(_EP0BUF + 0x0001) 0002BF E4 [12] 1305 clr a 0002C0 F0 [24] 1306 movx @dptr,a 1307 ; usb_common.c:256: EP0BCH = 0; 0002C1 90 E6 8A [24] 1308 mov dptr,#_EP0BCH 0002C4 F0 [24] 1309 movx @dptr,a 1310 ; usb_common.c:257: EP0BCL = 2; 0002C5 90 E6 8B [24] 1311 mov dptr,#_EP0BCL 0002C8 74 02 [12] 1312 mov a,#0x02 0002CA F0 [24] 1313 movx @dptr,a 1314 ; usb_common.c:258: break; 0002CB 02r04r23 [24] 1315 ljmp 00175$ 1316 ; usb_common.c:260: case bmRT_RECIP_INTERFACE: 0002CE 1317 00130$: 1318 ; usb_common.c:261: EP0BUF[0] = 0; 0002CE 90 E7 40 [24] 1319 mov dptr,#_EP0BUF 0002D1 E4 [12] 1320 clr a 0002D2 F0 [24] 1321 movx @dptr,a 1322 ; usb_common.c:262: EP0BUF[1] = 0; 0002D3 90 E7 41 [24] 1323 mov dptr,#(_EP0BUF + 0x0001) 0002D6 F0 [24] 1324 movx @dptr,a 1325 ; usb_common.c:263: EP0BCH = 0; 0002D7 90 E6 8A [24] 1326 mov dptr,#_EP0BCH 0002DA F0 [24] 1327 movx @dptr,a 1328 ; usb_common.c:264: EP0BCL = 2; 0002DB 90 E6 8B [24] 1329 mov dptr,#_EP0BCL 0002DE 74 02 [12] 1330 mov a,#0x02 0002E0 F0 [24] 1331 movx @dptr,a 1332 ; usb_common.c:265: break; 0002E1 02r04r23 [24] 1333 ljmp 00175$ 1334 ; usb_common.c:267: case bmRT_RECIP_ENDPOINT: 0002E4 1335 00131$: 1336 ; usb_common.c:268: if (plausible_endpoint (wIndexL)){ 0002E4 90 E6 BC [24] 1337 mov dptr,#(_SETUPDAT + 0x0004) 0002E7 E0 [24] 1338 movx a,@dptr 0002E8 F5 82 [12] 1339 mov dpl,a 0002EA 12r00rFA [24] 1340 lcall _plausible_endpoint 0002ED E5 82 [12] 1341 mov a,dpl 0002EF 60 25 [24] 1342 jz 00133$ 1343 ; usb_common.c:269: EP0BUF[0] = *epcs (wIndexL) & bmEPSTALL; 0002F1 90 E6 BC [24] 1344 mov dptr,#(_SETUPDAT + 0x0004) 0002F4 E0 [24] 1345 movx a,@dptr 0002F5 F5 82 [12] 1346 mov dpl,a 0002F7 12r01r1E [24] 1347 lcall _epcs 0002FA E0 [24] 1348 movx a,@dptr 0002FB FF [12] 1349 mov r7,a 0002FC 53 07 01 [24] 1350 anl ar7,#0x01 0002FF 90 E7 40 [24] 1351 mov dptr,#_EP0BUF 000302 EF [12] 1352 mov a,r7 000303 F0 [24] 1353 movx @dptr,a 1354 ; usb_common.c:270: EP0BUF[1] = 0; 000304 90 E7 41 [24] 1355 mov dptr,#(_EP0BUF + 0x0001) 000307 E4 [12] 1356 clr a 000308 F0 [24] 1357 movx @dptr,a 1358 ; usb_common.c:271: EP0BCH = 0; 000309 90 E6 8A [24] 1359 mov dptr,#_EP0BCH 00030C F0 [24] 1360 movx @dptr,a 1361 ; usb_common.c:272: EP0BCL = 2; 00030D 90 E6 8B [24] 1362 mov dptr,#_EP0BCL 000310 74 02 [12] 1363 mov a,#0x02 000312 F0 [24] 1364 movx @dptr,a 000313 02r04r23 [24] 1365 ljmp 00175$ 000316 1366 00133$: 1367 ; usb_common.c:275: fx2_stall_ep0 (); 000316 12r00r00 [24] 1368 lcall _fx2_stall_ep0 1369 ; usb_common.c:276: break; 000319 02r04r23 [24] 1370 ljmp 00175$ 1371 ; usb_common.c:278: default: 00031C 1372 00135$: 1373 ; usb_common.c:279: fx2_stall_ep0 (); 00031C 12r00r00 [24] 1374 lcall _fx2_stall_ep0 1375 ; usb_common.c:282: break; 00031F 02r04r23 [24] 1376 ljmp 00175$ 1377 ; usb_common.c:287: default: 000322 1378 00138$: 1379 ; usb_common.c:288: fx2_stall_ep0 (); 000322 12r00r00 [24] 1380 lcall _fx2_stall_ep0 1381 ; usb_common.c:290: } 000325 02r04r23 [24] 1382 ljmp 00175$ 000328 1383 00173$: 1384 ; usb_common.c:299: switch (bRequest){ 000328 90 E6 B9 [24] 1385 mov dptr,#(_SETUPDAT + 0x0001) 00032B E0 [24] 1386 movx a,@dptr 00032C FF [12] 1387 mov r7,a 00032D 24 F4 [12] 1388 add a,#0xff - 0x0b 00032F 50 03 [24] 1389 jnc 00312$ 000331 02r04r20 [24] 1390 ljmp 00170$ 000334 1391 00312$: 000334 EF [12] 1392 mov a,r7 000335 24 0A [12] 1393 add a,#(00313$-3-.) 000337 83 [24] 1394 movc a,@a+pc 000338 F5 82 [12] 1395 mov dpl,a 00033A EF [12] 1396 mov a,r7 00033B 24 10 [12] 1397 add a,#(00314$-3-.) 00033D 83 [24] 1398 movc a,@a+pc 00033E F5 83 [12] 1399 mov dph,a 000340 E4 [12] 1400 clr a 000341 73 [24] 1401 jmp @a+dptr 000342 1402 00313$: 000342r20 1403 .db 00170$ 000343r6C 1404 .db 00142$ 000344rE9 1405 .db 00161$ 000345rCA 1406 .db 00154$ 000346r20 1407 .db 00170$ 000347r20 1408 .db 00170$ 000348r20 1409 .db 00170$ 000349r20 1410 .db 00170$ 00034Ar20 1411 .db 00170$ 00034Br5A 1412 .db 00140$ 00034Cr20 1413 .db 00170$ 00034Dr63 1414 .db 00141$ 00034E 1415 00314$: 00034Es04 1416 .db 00170$>>8 00034Fs03 1417 .db 00142$>>8 000350s03 1418 .db 00161$>>8 000351s03 1419 .db 00154$>>8 000352s04 1420 .db 00170$>>8 000353s04 1421 .db 00170$>>8 000354s04 1422 .db 00170$>>8 000355s04 1423 .db 00170$>>8 000356s04 1424 .db 00170$>>8 000357s03 1425 .db 00140$>>8 000358s04 1426 .db 00170$>>8 000359s03 1427 .db 00141$>>8 1428 ; usb_common.c:301: case RQ_SET_CONFIG: 00035A 1429 00140$: 1430 ; usb_common.c:302: _usb_config = wValueL; // FIXME app should handle 00035A 90 E6 BA [24] 1431 mov dptr,#(_SETUPDAT + 0x0002) 00035D E0 [24] 1432 movx a,@dptr 00035E F5*00 [12] 1433 mov __usb_config,a 1434 ; usb_common.c:303: break; 000360 02r04r23 [24] 1435 ljmp 00175$ 1436 ; usb_common.c:305: case RQ_SET_INTERFACE: 000363 1437 00141$: 1438 ; usb_common.c:306: _usb_alt_setting = wValueL; // FIXME app should handle 000363 90 E6 BA [24] 1439 mov dptr,#(_SETUPDAT + 0x0002) 000366 E0 [24] 1440 movx a,@dptr 000367 F5*01 [12] 1441 mov __usb_alt_setting,a 1442 ; usb_common.c:307: break; 000369 02r04r23 [24] 1443 ljmp 00175$ 1444 ; usb_common.c:311: case RQ_CLEAR_FEATURE: 00036C 1445 00142$: 1446 ; usb_common.c:312: switch (bRequestType & bmRT_RECIP_MASK){ 00036C 90 E6 B8 [24] 1447 mov dptr,#_SETUPDAT 00036F E0 [24] 1448 movx a,@dptr 000370 FF [12] 1449 mov r7,a 000371 53 07 1F [24] 1450 anl ar7,#0x1f 000374 8F 06 [24] 1451 mov ar6,r7 000376 BE 00 02 [24] 1452 cjne r6,#0x00,00315$ 000379 80 05 [24] 1453 sjmp 00143$ 00037B 1454 00315$: 1455 ; usb_common.c:314: case bmRT_RECIP_DEVICE: 00037B BF 02 47 [24] 1456 cjne r7,#0x02,00152$ 00037E 80 0A [24] 1457 sjmp 00147$ 000380 1458 00143$: 1459 ; usb_common.c:315: switch (wValueL){ 000380 90 E6 BA [24] 1460 mov dptr,#(_SETUPDAT + 0x0002) 000383 E0 [24] 1461 movx a,@dptr 1462 ; usb_common.c:318: fx2_stall_ep0 (); 000384 12r00r00 [24] 1463 lcall _fx2_stall_ep0 1464 ; usb_common.c:320: break; 000387 02r04r23 [24] 1465 ljmp 00175$ 1466 ; usb_common.c:322: case bmRT_RECIP_ENDPOINT: 00038A 1467 00147$: 1468 ; usb_common.c:323: if (wValueL == FS_ENDPOINT_HALT && plausible_endpoint (wIndexL)){ 00038A 90 E6 BA [24] 1469 mov dptr,#(_SETUPDAT + 0x0002) 00038D E0 [24] 1470 movx a,@dptr 00038E 70 30 [24] 1471 jnz 00149$ 000390 90 E6 BC [24] 1472 mov dptr,#(_SETUPDAT + 0x0004) 000393 E0 [24] 1473 movx a,@dptr 000394 F5 82 [12] 1474 mov dpl,a 000396 12r00rFA [24] 1475 lcall _plausible_endpoint 000399 E5 82 [12] 1476 mov a,dpl 00039B 60 23 [24] 1477 jz 00149$ 1478 ; usb_common.c:324: *epcs (wIndexL) &= ~bmEPSTALL; 00039D 90 E6 BC [24] 1479 mov dptr,#(_SETUPDAT + 0x0004) 0003A0 E0 [24] 1480 movx a,@dptr 0003A1 F5 82 [12] 1481 mov dpl,a 0003A3 12r01r1E [24] 1482 lcall _epcs 0003A6 AE 82 [24] 1483 mov r6,dpl 0003A8 AF 83 [24] 1484 mov r7,dph 0003AA E0 [24] 1485 movx a,@dptr 0003AB FD [12] 1486 mov r5,a 0003AC 53 05 FE [24] 1487 anl ar5,#0xfe 0003AF 8E 82 [24] 1488 mov dpl,r6 0003B1 8F 83 [24] 1489 mov dph,r7 0003B3 ED [12] 1490 mov a,r5 0003B4 F0 [24] 1491 movx @dptr,a 1492 ; usb_common.c:325: fx2_reset_data_toggle (wIndexL); 0003B5 90 E6 BC [24] 1493 mov dptr,#(_SETUPDAT + 0x0004) 0003B8 E0 [24] 1494 movx a,@dptr 0003B9 F5 82 [12] 1495 mov dpl,a 0003BB 12r00r00 [24] 1496 lcall _fx2_reset_data_toggle 0003BE 80 63 [24] 1497 sjmp 00175$ 0003C0 1498 00149$: 1499 ; usb_common.c:328: fx2_stall_ep0 (); 0003C0 12r00r00 [24] 1500 lcall _fx2_stall_ep0 1501 ; usb_common.c:329: break; 1502 ; usb_common.c:331: default: 0003C3 80 5E [24] 1503 sjmp 00175$ 0003C5 1504 00152$: 1505 ; usb_common.c:332: fx2_stall_ep0 (); 0003C5 12r00r00 [24] 1506 lcall _fx2_stall_ep0 1507 ; usb_common.c:335: break; 1508 ; usb_common.c:339: case RQ_SET_FEATURE: 0003C8 80 59 [24] 1509 sjmp 00175$ 0003CA 1510 00154$: 1511 ; usb_common.c:340: switch (bRequestType & bmRT_RECIP_MASK){ 0003CA 90 E6 B8 [24] 1512 mov dptr,#_SETUPDAT 0003CD E0 [24] 1513 movx a,@dptr 0003CE FF [12] 1514 mov r7,a 0003CF 53 07 1F [24] 1515 anl ar7,#0x1f 0003D2 BF 00 4E [24] 1516 cjne r7,#0x00,00175$ 1517 ; usb_common.c:343: switch (wValueL){ 0003D5 90 E6 BA [24] 1518 mov dptr,#(_SETUPDAT + 0x0002) 0003D8 E0 [24] 1519 movx a,@dptr 0003D9 FF [12] 1520 mov r7,a 0003DA BF 01 02 [24] 1521 cjne r7,#0x01,00321$ 0003DD 80 05 [24] 1522 sjmp 00158$ 0003DF 1523 00321$: 0003DF BF 02 02 [24] 1524 cjne r7,#0x02,00322$ 0003E2 80 3F [24] 1525 sjmp 00175$ 0003E4 1526 00322$: 1527 ; usb_common.c:349: default: 0003E4 1528 00158$: 1529 ; usb_common.c:350: fx2_stall_ep0 (); 0003E4 12r00r00 [24] 1530 lcall _fx2_stall_ep0 1531 ; usb_common.c:354: break; 1532 ; usb_common.c:356: case bmRT_RECIP_ENDPOINT: 0003E7 80 3A [24] 1533 sjmp 00175$ 0003E9 1534 00161$: 1535 ; usb_common.c:357: switch (wValueL){ 0003E9 90 E6 BA [24] 1536 mov dptr,#(_SETUPDAT + 0x0002) 0003EC E0 [24] 1537 movx a,@dptr 0003ED 70 2C [24] 1538 jnz 00166$ 1539 ; usb_common.c:359: if (plausible_endpoint (wIndexL)) 0003EF 90 E6 BC [24] 1540 mov dptr,#(_SETUPDAT + 0x0004) 0003F2 E0 [24] 1541 movx a,@dptr 0003F3 F5 82 [12] 1542 mov dpl,a 0003F5 12r00rFA [24] 1543 lcall _plausible_endpoint 0003F8 E5 82 [12] 1544 mov a,dpl 0003FA 60 1A [24] 1545 jz 00164$ 1546 ; usb_common.c:360: *epcs (wIndexL) |= bmEPSTALL; 0003FC 90 E6 BC [24] 1547 mov dptr,#(_SETUPDAT + 0x0004) 0003FF E0 [24] 1548 movx a,@dptr 000400 F5 82 [12] 1549 mov dpl,a 000402 12r01r1E [24] 1550 lcall _epcs 000405 AE 82 [24] 1551 mov r6,dpl 000407 AF 83 [24] 1552 mov r7,dph 000409 E0 [24] 1553 movx a,@dptr 00040A FD [12] 1554 mov r5,a 00040B 43 05 01 [24] 1555 orl ar5,#0x01 00040E 8E 82 [24] 1556 mov dpl,r6 000410 8F 83 [24] 1557 mov dph,r7 000412 ED [12] 1558 mov a,r5 000413 F0 [24] 1559 movx @dptr,a 000414 80 0D [24] 1560 sjmp 00175$ 000416 1561 00164$: 1562 ; usb_common.c:362: fx2_stall_ep0 (); 000416 12r00r00 [24] 1563 lcall _fx2_stall_ep0 1564 ; usb_common.c:363: break; 1565 ; usb_common.c:365: default: 000419 80 08 [24] 1566 sjmp 00175$ 00041B 1567 00166$: 1568 ; usb_common.c:366: fx2_stall_ep0 (); 00041B 12r00r00 [24] 1569 lcall _fx2_stall_ep0 1570 ; usb_common.c:369: break; 1571 ; usb_common.c:375: default: 00041E 80 03 [24] 1572 sjmp 00175$ 000420 1573 00170$: 1574 ; usb_common.c:376: fx2_stall_ep0 (); 000420 12r00r00 [24] 1575 lcall _fx2_stall_ep0 1576 ; usb_common.c:382: } // bmRT_TYPE_MASK 000423 1577 00175$: 1578 ; usb_common.c:385: EP0CS |= bmHSNAK; 000423 90 E6 A0 [24] 1579 mov dptr,#_EP0CS 000426 E0 [24] 1580 movx a,@dptr 000427 43 E0 80 [24] 1581 orl acc,#0x80 00042A F0 [24] 1582 movx @dptr,a 1583 ; usb_common.c:386: } 00042B 22 [24] 1584 ret 1585 .area CSEG (CODE) 1586 .area CONST (CODE) 1587 .area CABS (ABS,CODE)