📄 touch.cod
字号:
0004c e35e0000 cmp lr, #0
00050 d26ee000 rsble lr, lr, #0
; 438 :
; 439 : if (diff0 < diff1)
00054 e1550004 cmp r5, r4
00058 aa000003 bge |$L32465|
; 440 : *sample=(ULONG)(val0 + ((diff2 < diff0) ? val2 : val1));
0005c e15e0005 cmp lr, r5
00060 a1a06001 movge r6, r1
00064 e0863000 add r3, r6, r0
; 441 : else
00068 ea000002 b |$L32823|
0006c |$L32465|
; 442 : *sample=(ULONG)(val2 + ((diff2 < diff1) ? val0 : val1));
0006c e15e0004 cmp lr, r4
00070 a1a00001 movge r0, r1
00074 e0803006 add r3, r0, r6
00078 |$L32823|
00078 e59d2018 ldr r2, [sp, #0x18]
; 443 :
; 444 : *sample>>=1;
; 445 :
; 446 : if ((diff0 < maxError) && (diff1 < maxError) && (diff2 < maxError))
0007c e1550007 cmp r5, r7
00080 e5823000 str r3, [r2]
00084 e1a030c3 mov r3, r3, asr #1
00088 e5823000 str r3, [r2]
0008c aa000002 bge |$L32469|
00090 e1540007 cmp r4, r7
00094 b15e0007 cmplt lr, r7
; 447 : retval = TouchSampleValidFlag ;
00098 b3a08001 movlt r8, #1
0009c |$L32469|
; 448 : }
; 449 : return(retval);
0009c e1a00008 mov r0, r8
; 450 : }
000a0 e8bd41f0 ldmia sp!, {r4 - r8, lr}
000a4 e12fff1e bx lr
000a8 |$M32825|
ENDP ; |?evaluateSample@@YAHGGGHPAH@Z|, evaluateSample
EXPORT |?sampleADC@@YAHPAGI@Z| ; sampleADC
00000 AREA |.text| { |?sampleADC@@YAHPAGI@Z| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$?sampleADC@@YAHPAGI@Z|, PDATA, SELECTION=5, ASSOC=|.text| { |?sampleADC@@YAHPAGI@Z| } ; comdat associative
|$T32845| DCD |$L32844|
DCD 0x40003702
; Function compile flags: /Ogsy
00000 AREA |.text| { |?sampleADC@@YAHPAGI@Z| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |?sampleADC@@YAHPAGI@Z| PROC ; sampleADC
; 454 : {
00000 |$L32844|
00000 e92d40f0 stmdb sp!, {r4 - r7, lr}
00004 e24dd008 sub sp, sp, #8
00008 |$M32842|
00008 e1a07000 mov r7, r0
; 455 : UINT32 adccr=0;
; 456 : UINT32 adcDataReg;
; 457 :
; 458 : BOOL noError=FALSE;
; 459 :
; 460 : adccr = (axis == UCB_ADC_X ? ADC_INPUT_TSPY : ADC_INPUT_TSPX) | ADC_ENA ;
0000c e3a03902 mov r3, #2, 18
00010 e3833008 orr r3, r3, #8
00014 e1510003 cmp r1, r3
00018 03a03008 moveq r3, #8
0001c 13a03000 movne r3, #0
00020 e3835902 orr r5, r3, #2, 18
00024 e58d5000 str r5, [sp]
; 461 :
; 462 : if (WriteAC97(UCB_ADC_CR,*(UINT16 *)&adccr, DEV_TOUCH))
00028 e3a02001 mov r2, #1
0002c e1dd10b0 ldrh r1, [sp]
00030 e3a00066 mov r0, #0x66
00034 e3a04000 mov r4, #0
00038 eb000000 bl WriteAC97
0003c e3500000 cmp r0, #0
00040 0a000020 beq |$L32481|
; 463 : {
; 464 : XllpOstDelayMicroSeconds((P_XLLP_OST_T) g_pOSTRegs, 50);
00044 e59f608c ldr r6, [pc, #0x8C]
00048 e3a01032 mov r1, #0x32
0004c e5960000 ldr r0, [r6]
00050 eb000000 bl XllpOstDelayMicroSeconds
; 465 :
; 466 : adccr |= ADC_START;
00054 e3855080 orr r5, r5, #0x80
00058 e58d5000 str r5, [sp]
; 467 : if (WriteAC97(UCB_ADC_CR,*(UINT16 *)&adccr, DEV_TOUCH))
0005c e3a02001 mov r2, #1
00060 e1dd10b0 ldrh r1, [sp]
00064 e3a00066 mov r0, #0x66
00068 eb000000 bl WriteAC97
0006c e3500000 cmp r0, #0
00070 0a000014 beq |$L32481|
; 468 : {
; 469 : XllpOstDelayMicroSeconds((P_XLLP_OST_T) g_pOSTRegs, 50);
00074 e5960000 ldr r0, [r6]
00078 e3a01032 mov r1, #0x32
0007c eb000000 bl XllpOstDelayMicroSeconds
00080 |$L32483|
; 470 :
; 471 : do
; 472 : { // wait for sample completion
; 473 : ReadAC97(UCB_ADC_DATA,(UINT16 *) &adcDataReg,DEV_TOUCH);
00080 e3a02001 mov r2, #1
00084 e28d1004 add r1, sp, #4
00088 e3a00068 mov r0, #0x68
0008c eb000000 bl ReadAC97
; 474 :
; 475 : } while (!TEST(adcDataReg,ADC_DATA_VAL));
00090 e59d0004 ldr r0, [sp, #4]
00094 e3100902 tst r0, #2, 18
00098 0afffff8 beq |$L32483|
; 476 :
; 477 :
; 478 :
; 479 : *sample=TEST(adcDataReg,ADC_DATA) ;
0009c e3a03fff mov r3, #0xFF, 30
; 480 : // disable adc
; 481 : CLEAR(adccr,ADC_ENA);
000a0 e3a01c7f mov r1, #0x7F, 24
000a4 e3833003 orr r3, r3, #3
000a8 e38110ff orr r1, r1, #0xFF
; 482 : WriteAC97(UCB_ADC_CR,*(UINT16 *)&adccr,DEV_TOUCH);
000ac e0003003 and r3, r0, r3
000b0 e3a00066 mov r0, #0x66
000b4 e3a02001 mov r2, #1
000b8 e0051001 and r1, r5, r1
000bc e1c730b0 strh r3, [r7]
000c0 eb000000 bl WriteAC97
; 483 : noError=TRUE;
000c4 e3a04001 mov r4, #1
000c8 |$L32481|
; 484 : }
; 485 : }
; 486 :
; 487 : return(noError);
000c8 e1a00004 mov r0, r4
; 488 : }
000cc e28dd008 add sp, sp, #8
000d0 e8bd40f0 ldmia sp!, {r4 - r7, lr}
000d4 e12fff1e bx lr
000d8 |$L32847|
000d8 00000000 DCD |g_pOSTRegs|
000dc |$M32843|
ENDP ; |?sampleADC@@YAHPAGI@Z|, sampleADC
EXPORT |?getTouchCoordinate@@YAGI@Z| ; getTouchCoordinate
00000 AREA |.text| { |?getTouchCoordinate@@YAGI@Z| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$?getTouchCoordinate@@YAGI@Z|, PDATA, SELECTION=5, ASSOC=|.text| { |?getTouchCoordinate@@YAGI@Z| } ; comdat associative
|$T32859| DCD |$L32858|
DCD 0x40001b02
; Function compile flags: /Ogsy
00000 AREA |.text| { |?getTouchCoordinate@@YAGI@Z| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |?getTouchCoordinate@@YAGI@Z| PROC ; getTouchCoordinate
; 492 : {
00000 |$L32858|
00000 e92d4030 stmdb sp!, {r4, r5, lr}
00004 e24dd004 sub sp, sp, #4
00008 |$M32856|
00008 e1a05000 mov r5, r0
; 493 : UINT32 tcr=0;
; 494 : BOOL noError=FALSE;
; 495 : USHORT sample=MAX_ADC_VAL;
; 496 :
; 497 : //Bias the ADC, set position mode and choose the correct axis.
; 498 :
; 499 : tcr = TSC_BIAS_ENA | TSC_MODE_POSITION | ((axis==UCB_ADC_X) ? (TSPX_POW | TSMX_GND) : (TSPY_POW | TSMY_GND));
0000c e3a03902 mov r3, #2, 18
00010 e3833008 orr r3, r3, #8
00014 e1550003 cmp r5, r3
00018 03a03012 moveq r3, #0x12
0001c 13a03048 movne r3, #0x48
00020 e3833c0a orr r3, r3, #0xA, 24
00024 e3a04fff mov r4, #0xFF, 30
; 500 : if (WriteAC97(UCB_TCH_CR,*(UINT16 *)&tcr, DEV_TOUCH))
00028 e1a01803 mov r1, r3, lsl #16
0002c e3844003 orr r4, r4, #3
00030 e1a01821 mov r1, r1, lsr #16
00034 e3a02001 mov r2, #1
00038 e3a00064 mov r0, #0x64
0003c e1cd40b0 strh r4, [sp]
00040 eb000000 bl WriteAC97
00044 e3500000 cmp r0, #0
00048 0a000003 beq |$L32495|
; 501 : noError=sampleADC(&sample,axis);
0004c e1a01005 mov r1, r5
00050 e28d0000 add r0, sp, #0
00054 eb000000 bl |?sampleADC@@YAHPAGI@Z|
00058 e1dd40b0 ldrh r4, [sp]
0005c |$L32495|
; 502 :
; 503 : return(sample);
0005c e1a00004 mov r0, r4
; 504 : }
00060 e28dd004 add sp, sp, #4
00064 e8bd4030 ldmia sp!, {r4, r5, lr}
00068 e12fff1e bx lr
0006c |$M32857|
ENDP ; |?getTouchCoordinate@@YAGI@Z|, getTouchCoordinate
EXPORT |TouchDriverCalibrationPointGet|
IMPORT |SetLastError|
00000 AREA |.text| { |TouchDriverCalibrationPointGet| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$TouchDriverCalibrationPointGet|, PDATA, SELECTION=5, ASSOC=|.text| { |TouchDriverCalibrationPointGet| } ; comdat associative
|$T32876| DCD |$L32875|
DCD 0x40003601
; Function compile flags: /Ogsy
00000 AREA |.text| { |TouchDriverCalibrationPointGet| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |TouchDriverCalibrationPointGet| PROC
; 508 : {
00000 |$L32875|
00000 e92d40f0 stmdb sp!, {r4 - r7, lr}
00004 |$M32873|
; 509 : INT32 cDisplayWidth = pTCP->cDisplayWidth;
00004 e5906004 ldr r6, [r0, #4]
; 510 : INT32 cDisplayHeight = pTCP->cDisplayHeight;
; 511 :
; 512 : int CalibrationRadiusX = cDisplayWidth/10;
00008 e59f30c4 ldr r3, [pc, #0xC4]
0000c e5907008 ldr r7, [r0, #8]
; 513 : int CalibrationRadiusY = cDisplayHeight/10;
; 514 :
; 515 :
; 516 : switch (pTCP->PointNumber)
00010 e5905000 ldr r5, [r0]
00014 e0c2e396 smull lr, r2, r6, r3
00018 e0c14397 smull r4, r1, r7, r3
0001c e1a03142 mov r3, r2, asr #2
00020 e1a02141 mov r2, r1, asr #2
00024 e0822fa2 add r2, r2, r2, lsr #31
00028 e0833fa3 add r3, r3, r3, lsr #31
0002c e3550000 cmp r5, #0
00030 0a00001e beq |$L32507|
00034 e3550001 cmp r5, #1
00038 0a000019 beq |$L32508|
0003c e3550002 cmp r5, #2
00040 0a000014 beq |$L32509|
00044 e3550003 cmp r5, #3
00048 0a00000f beq |$L32510|
0004c e3550004 cmp r5, #4
00050 0a00000a beq |$L32511|
; 540 : pTCP->CalibrationY = CalibrationRadiusY*2;
; 541 : break;
; 542 :
; 543 : default:
; 544 : pTCP->CalibrationX = cDisplayWidth/2;
00054 e0863fa6 add r3, r6, r6, lsr #31
; 545 : pTCP->CalibrationY = cDisplayHeight/2;
00058 e0872fa7 add r2, r7, r7, lsr #31
0005c e1a030c3 mov r3, r3, asr #1
00060 e1a020c2 mov r2, r2, asr #1
00064 e580300c str r3, [r0, #0xC]
00068 e5802010 str r2, [r0, #0x10]
; 546 : SetLastError(ERROR_INVALID_PARAMETER);
0006c e3a00057 mov r0, #0x57
00070 eb000000 bl SetLastError
; 547 : return (FALSE);
00074 e3a00000 mov r0, #0
; 551 : }
00078 e8bd40f0 ldmia sp!, {r4 - r7, lr}
0007c e12fff1e bx lr
00080 |$L32511|
; 535 : pTCP->CalibrationY = cDisplayHeight - CalibrationRadiusY*2;
; 536 : break;
; 537 :
; 538 : case 4: // Upper Right
; 539 : pTCP->CalibrationX = cDisplayWidth - CalibrationRadiusX*2;
00080 e0463083 sub r3, r6, r3, lsl #1
00084 e1a02082 mov r2, r2, lsl #1
00088 ea00000c b |$L32870|
0008c |$L32510|
; 532 :
; 533 : case 3: // Lower Right
; 534 : pTCP->CalibrationX = cDisplayWidth - CalibrationRadiusX*2;
0008c e0463083 sub r3, r6, r3, lsl #1
00090 e0472082 sub r2, r7, r2, lsl #1
00094 ea000009 b |$L32870|
00098 |$L32509|
; 527 :
; 528 : case 2: // Lower Left
; 529 : pTCP->CalibrationX = CalibrationRadiusX*2;
00098 e1a03083 mov r3, r3, lsl #1
; 530 : pTCP->CalibrationY = cDisplayHeight - CalibrationRadiusY*2;
0009c e0472082 sub r2, r7, r2, lsl #1
; 531 : break;
000a0 ea000006 b |$L32870|
000a4 |$L32508|
; 521 : break;
; 522 :
; 523 : case 1: // Upper Left
; 524 : pTCP->CalibrationX = CalibrationRadiusX*2;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -