FaxProcess.lst
上传用户:xhjmsc
上传日期:2019-09-13
资源大小:389k
文件大小:129k
- ##############################################################################
- # #
- # IAR MSP430 C/EC++ Compiler V2.10A/W32 23/Apr/2007 18:04:08 #
- # Copyright 1996-2003 IAR Systems. All rights reserved. #
- # #
- # __rt_version = 1 #
- # __double_size = 32 #
- # __reg_r4 = free #
- # __reg_r5 = free #
- # __pic = no #
- # Source file = E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
- # filesFaxProcess.c #
- # Command line = -I "C:Program FilesIAR SystemsEmbedded Workbench #
- # 3.2430INC" -I "C:Program FilesIAR #
- # SystemsEmbedded Workbench 3.2430INCCLIB" -lCN #
- # E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
- # DebugList -lA E:projectFaxProgramVson_Bryan_Fax_ #
- # Conexant_070423DebugList -o #
- # E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
- # DebugObj -z2 --no_cse --no_unroll --no_inline #
- # --no_code_motion --debug -e #
- # E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
- # filesFaxProcess.c #
- # List file = E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
- # DebugListFaxProcess.lst #
- # Object file = E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
- # DebugObjFaxProcess.r43 #
- # #
- # #
- ##############################################################################
- E:projectFaxProgramVson_Bryan_Fax_Conexant_070423filesFaxProcess.c
- 1
- 2
- 3 #include "includeH.h"
- In segment DATA16_AN, at 0x29
- unsigned char volatile __data P2OUT
- P2OUT:
- 000000 DS8 1
- In segment DATA16_AN, at 0x31
- unsigned char volatile __data P5OUT
- P5OUT:
- 000000 DS8 1
- In segment DATA16_AN, at 0x32
- unsigned char volatile __data P5DIR
- P5DIR:
- 000000 DS8 1
- 4
- 5
- 6 //**************************************************************************
- In segment CODE, align 2, keep-with-next
- 7 void FaxRXProcess(void)
- FaxRXProcess:
- 8 {
- 000000 0A12 PUSH.W R10
- 000002 0B12 PUSH.W R11
- 000004 0812 PUSH.W R8
- 000006 0912 PUSH.W R9
- 000008 0612 PUSH.W R6
- 00000A 0712 PUSH.W R7
- 00000C 0412 PUSH.W R4
- 00000E 0512 PUSH.W R5
- 000010 2182 SUB.W #0x4, SP
- 9 unsigned char ucFlashSttsOverflowCnt = 0;
- 000012 4643 MOV.B #0x0, R6
- 10 unsigned char ucGeneralCount = 0;
- 000014 4443 MOV.B #0x0, R4
- 11 unsigned char ucGeneralCnt = 0;
- 000016 4A43 MOV.B #0x0, R10
- 12 unsigned char ucRxIndex3 = 0;
- 000018 C1430000 MOV.B #0x0, 0x0(SP)
- 13 unsigned char ucRxIndex2 = 0;
- 00001C C1430100 MOV.B #0x0, 0x1(SP)
- 14 unsigned char ucRxIndex1 = 0;
- 000020 4B43 MOV.B #0x0, R11
- 15 unsigned char ucRxIndex0 = 0;
- 000022 4843 MOV.B #0x0, R8
- 16
- 17 unsigned int wNextPageAddress = 0;
- 000024 0543 MOV.W #0x0, R5
- 18 unsigned int wPageAddress = 0;
- 000026 0943 MOV.W #0x0, R9
- 19 unsigned int wGeneralCount = 0;
- 000028 0743 MOV.W #0x0, R7
- 20 unsigned int wDataRearCount = 0;
- 00002A 81430200 MOV.W #0x0, 0x2(SP)
- 21
- 22 FaxRxInit();
- 00002E B012.... CALL #FaxRxInit
- 23 /***************************************************************************/
- 24
- 25 //ATA
- 26
- 27 SendATcmdATA(); //Connect
- 000032 B012.... CALL #SendATcmdATA
- 28
- 29 while (1) //CONNECT(54) 0D 0A
- 30 {
- 31 ucRxIndex1 = gucUartRxCnt-3;//get array index
- ??FaxRXProcess_0:
- 000036 7E40FD00 MOV.B #0xfd, R14
- 00003A 5E52.... ADD.B &gucUartRxCnt, R14
- 00003E 4B4E MOV.B R14, R11
- 32 ucRxIndex0 = gucUartRxCnt-2;//get array index
- 000040 7E40FE00 MOV.B #0xfe, R14
- 000044 5E52.... ADD.B &gucUartRxCnt, R14
- 000048 484E MOV.B R14, R8
- 33 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x54 == aucUartRxBuf[ucRxIndex1]))
- 00004A 38F0FF00 AND.W #0xff, R8
- 00004E F8900D00.... CMP.B #0xd, aucUartRxBuf(R8)
- 000054 0620 JNE ??FaxRXProcess_32
- 000056 3BF0FF00 AND.W #0xff, R11
- 00005A FB905400.... CMP.B #0x54, aucUartRxBuf(R11)
- 000060 1724 JEQ ??FaxRXProcess_33
- 34 break;
- 35 //if check time>min. 5S, Receive Fax error, program should be quit
- 36 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_32:
- 000062 1E42.... MOV.W &gwTimeOverflowCount, R14
- 000066 1F43 MOV.W #0x1, R15
- 000068 0F5E ADD.W R14, R15
- 00006A 824F.... MOV.W R15, &gwTimeOverflowCount
- 00006E 3E93 CMP.W #0xffff, R14
- 000070 0420 JNE ??FaxRXProcess_34
- 000072 D253.... ADD.B #0x1, &gucTimeOverflowCount
- 000076 C243.... MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_34:
- 00007A F2901400.... CMP.B #0x14, &gucTimeOverflowCount
- 000080 DA23 JNE ??FaxRXProcess_0
- 000082 F2400300.... MOV.B #0x3, &gucFrhErrorStatus
- 000088 C243.... MOV.B #0x0, &gucTimeOverflowCount
- 00008C 8243.... MOV.W #0x0, &gwTimeOverflowCount
- 37
- 38 }
- 39
- 40 Delay1500ms(); // delay 1.5S minimun 1 second
- ??FaxRXProcess_33:
- 000090 B012.... CALL #Delay1500ms
- 41
- 42 SendATdataFTHCSI(); //If the final bit is 0, the modem will generates CONNECT message.
- 000094 B012.... CALL #SendATdataFTHCSI
- 43 while (1) //CONNECT(54) 0D 0A
- 44 {
- 45 ucRxIndex1 = gucUartRxCnt-3;
- ??FaxRXProcess_1:
- 000098 7E40FD00 MOV.B #0xfd, R14
- 00009C 5E52.... ADD.B &gucUartRxCnt, R14
- 0000A0 4B4E MOV.B R14, R11
- 46 ucRxIndex0 = gucUartRxCnt-2;
- 0000A2 7E40FE00 MOV.B #0xfe, R14
- 0000A6 5E52.... ADD.B &gucUartRxCnt, R14
- 0000AA 484E MOV.B R14, R8
- 47 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x54 == aucUartRxBuf[ucRxIndex1]))
- 0000AC 38F0FF00 AND.W #0xff, R8
- 0000B0 F8900D00.... CMP.B #0xd, aucUartRxBuf(R8)
- 0000B6 0620 JNE ??FaxRXProcess_35
- 0000B8 3BF0FF00 AND.W #0xff, R11
- 0000BC FB905400.... CMP.B #0x54, aucUartRxBuf(R11)
- 0000C2 1724 JEQ ??FaxRXProcess_36
- 48 break;
- 49 //if check time>min. 5S, Receive Fax error, progra should be quit
- 50 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_35:
- 0000C4 1E42.... MOV.W &gwTimeOverflowCount, R14
- 0000C8 1F43 MOV.W #0x1, R15
- 0000CA 0F5E ADD.W R14, R15
- 0000CC 824F.... MOV.W R15, &gwTimeOverflowCount
- 0000D0 3E93 CMP.W #0xffff, R14
- 0000D2 0420 JNE ??FaxRXProcess_37
- 0000D4 D253.... ADD.B #0x1, &gucTimeOverflowCount
- 0000D8 C243.... MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_37:
- 0000DC F2901400.... CMP.B #0x14, &gucTimeOverflowCount
- 0000E2 DA23 JNE ??FaxRXProcess_1
- 0000E4 F2400300.... MOV.B #0x3, &gucFrhErrorStatus
- 0000EA C243.... MOV.B #0x0, &gucTimeOverflowCount
- 0000EE 8243.... MOV.W #0x0, &gwTimeOverflowCount
- 51 }
- 52
- 53 for (ucGeneralCount = 0; ucGeneralCount < 50; ucGeneralCount++)// delay 1.5S minimun 1 second
- ??FaxRXProcess_36:
- 0000F2 4443 MOV.B #0x0, R4
- ??FaxRXProcess_2:
- 0000F4 74903200 CMP.B #0x32, R4
- 0000F8 042C JC ??FaxRXProcess_38
- 54 {
- 55 ATcmdDelay(); //50ms
- 0000FA B012.... CALL #ATcmdDelay
- 56 }
- 0000FE 5453 ADD.B #0x1, R4
- 000100 F93F JMP ??FaxRXProcess_2
- 57
- 58 SendATdataFTHDIS();//SendATdataFTHTSI(sizeof (FTHDIS)); a bug of Sep.18
- ??FaxRXProcess_38:
- 000102 B012.... CALL #SendATdataFTHDIS
- 59
- 60 while (1) //O K 0D 0A
- 61 {
- 62 ucRxIndex1 = gucUartRxCnt-3;
- ??FaxRXProcess_3:
- 000106 7E40FD00 MOV.B #0xfd, R14
- 00010A 5E52.... ADD.B &gucUartRxCnt, R14
- 00010E 4B4E MOV.B R14, R11
- 63 ucRxIndex0 = gucUartRxCnt-2;
- 000110 7E40FE00 MOV.B #0xfe, R14
- 000114 5E52.... ADD.B &gucUartRxCnt, R14
- 000118 484E MOV.B R14, R8
- 64 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x4B == aucUartRxBuf[ucRxIndex1])) //K ==0x4b
- 00011A 38F0FF00 AND.W #0xff, R8
- 00011E F8900D00.... CMP.B #0xd, aucUartRxBuf(R8)
- 000124 0620 JNE ??FaxRXProcess_39
- 000126 3BF0FF00 AND.W #0xff, R11
- 00012A FB904B00.... CMP.B #0x4b, aucUartRxBuf(R11)
- 000130 1724 JEQ ??FaxRXProcess_40
- 65 break;
- 66 //if check time>min. 5S, Receive Fax error, progra should be quit
- 67 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_39:
- 000132 1E42.... MOV.W &gwTimeOverflowCount, R14
- 000136 1F43 MOV.W #0x1, R15
- 000138 0F5E ADD.W R14, R15
- 00013A 824F.... MOV.W R15, &gwTimeOverflowCount
- 00013E 3E93 CMP.W #0xffff, R14
- 000140 0420 JNE ??FaxRXProcess_41
- 000142 D253.... ADD.B #0x1, &gucTimeOverflowCount
- 000146 C243.... MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_41:
- 00014A F2901400.... CMP.B #0x14, &gucTimeOverflowCount
- 000150 DA23 JNE ??FaxRXProcess_3
- 000152 F2400300.... MOV.B #0x3, &gucFrhErrorStatus
- 000158 C243.... MOV.B #0x0, &gucTimeOverflowCount
- 00015C 8243.... MOV.W #0x0, &gwTimeOverflowCount
- 68 }
- 69
- 70 //*
- 71 //FRH TSI (transmitting subscriber identification)
- 72 SendATcmdFRH();
- ??FaxRXProcess_40:
- 000160 B012.... CALL #SendATcmdFRH
- 73 while (1) //Connect data.....OK 0D 0A
- 74 {
- 75 ucRxIndex1 = gucUartRxCnt-3;
- ??FaxRXProcess_4:
- 000164 7E40FD00 MOV.B #0xfd, R14
- 000168 5E52.... ADD.B &gucUartRxCnt, R14
- 00016C 4B4E MOV.B R14, R11
- 76 ucRxIndex0 = gucUartRxCnt-2;
- 00016E 7E40FE00 MOV.B #0xfe, R14
- 000172 5E52.... ADD.B &gucUartRxCnt, R14
- 000176 484E MOV.B R14, R8
- 77 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x54 == aucUartRxBuf[ucRxIndex1])) //Connect
- 000178 4E48 MOV.B R8, R14
- 00017A 3EF0FF00 AND.W #0xff, R14
- 00017E FE900D00.... CMP.B #0xd, aucUartRxBuf(R14)
- 000184 0720 JNE ??FaxRXProcess_42
- 000186 4E4B MOV.B R11, R14
- 000188 3EF0FF00 AND.W #0xff, R14
- 00018C FE905400.... CMP.B #0x54, aucUartRxBuf(R14)
- 000192 2524 JEQ ??FaxRXProcess_43
- 78 break;
- 79 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x52 == aucUartRxBuf[ucRxIndex1])) //No Carrier
- ??FaxRXProcess_42:
- 000194 4E48 MOV.B R8, R14
- 000196 3EF0FF00 AND.W #0xff, R14
- 00019A FE900D00.... CMP.B #0xd, aucUartRxBuf(R14)
- 0001A0 0720 JNE ??FaxRXProcess_44
- 0001A2 4E4B MOV.B R11, R14
- 0001A4 3EF0FF00 AND.W #0xff, R14
- 0001A8 FE905200.... CMP.B #0x52, aucUartRxBuf(R14)
- 0001AE 1724 JEQ ??FaxRXProcess_43
- 80 break;
- 81 //if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4b==aucUartRxBuf[ucRxIndex1]))
- 82 //{ucFrhErrorStatus=0x03;break;}
- 83 //if check time>min. 5S, Receive Fax error, progra should be quit
- 84 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_44:
- 0001B0 1E42.... MOV.W &gwTimeOverflowCount, R14
- 0001B4 1F43 MOV.W #0x1, R15
- 0001B6 0F5E ADD.W R14, R15
- 0001B8 824F.... MOV.W R15, &gwTimeOverflowCount
- 0001BC 3E93 CMP.W #0xffff, R14
- 0001BE 0420 JNE ??FaxRXProcess_45
- 0001C0 D253.... ADD.B #0x1, &gucTimeOverflowCount
- 0001C4 C243.... MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_45:
- 0001C8 F2901400.... CMP.B #0x14, &gucTimeOverflowCount
- 0001CE CA23 JNE ??FaxRXProcess_4
- 0001D0 F2400300.... MOV.B #0x3, &gucFrhErrorStatus
- 0001D6 C243.... MOV.B #0x0, &gucTimeOverflowCount
- 0001DA 8243.... MOV.W #0x0, &gwTimeOverflowCount
- 85 }//while
- 86
- 87 for (ucGeneralCnt = 0;ucGeneralCnt < 5;ucGeneralCnt++)
- ??FaxRXProcess_43:
- 0001DE 4A43 MOV.B #0x0, R10
- ??FaxRXProcess_7:
- 0001E0 7A900500 CMP.B #0x5, R10
- 0001E4 D32C JC ??FaxRXProcess_46
- 88 {
- 89 if (gucFrhErrorStatus == 0x03 || (0x0d == aucUartRxBuf[ucRxIndex0]) && (0x52 == aucUartRxBuf[ucRxIndex1]))
- 0001E6 F2900300.... CMP.B #0x3, &gucFrhErrorStatus
- 0001EC 0E24 JEQ ??FaxRXProcess_47
- 0001EE 4E48 MOV.B R8, R14
- 0001F0 3EF0FF00 AND.W #0xff, R14
- 0001F4 FE900D00.... CMP.B #0xd, aucUartRxBuf(R14)
- 0001FA 5E20 JNE ??FaxRXProcess_48
- 0001FC 4E4B MOV.B R11, R14
- 0001FE 3EF0FF00 AND.W #0xff, R14
- 000202 FE905200.... CMP.B #0x52, aucUartRxBuf(R14)
- 000208 5720 JNE ??FaxRXProcess_48
- 90 {
- 91 SendATcmdSuffix();
- ??FaxRXProcess_47:
- 00020A B012.... CALL #SendATcmdSuffix
- 92 ATcmdDelay();
- 00020E B012.... CALL #ATcmdDelay
- 93 ATcmdDelay();
- 000212 B012.... CALL #ATcmdDelay
- 94 ATcmdDelay();
- 000216 B012.... CALL #ATcmdDelay
- 95 SendATcmdPrefix();
- 00021A B012.... CALL #SendATcmdPrefix
- 96 ATcmdDelay();
- 00021E B012.... CALL #ATcmdDelay
- 97 SendATcmdSuffix();
- 000222 B012.... CALL #SendATcmdSuffix
- 98 ATcmdDelay();
- 000226 B012.... CALL #ATcmdDelay
- 99 ATcmdDelay();
- 00022A B012.... CALL #ATcmdDelay
- 100 ATcmdDelay();
- 00022E B012.... CALL #ATcmdDelay
- 101 Delay2000ms();//add at Jan. 16, 2007
- 000232 B012.... CALL #Delay2000ms
- 102 FthCsiDis();
- 000236 B012.... CALL #FthCsiDis
- 103 SendATcmdFRH();
- 00023A B012.... CALL #SendATcmdFRH
- 104 while (1) //Connect data.....OK 0D 0A
- 105 {
- 106 ucRxIndex1 = gucUartRxCnt-3;
- ??FaxRXProcess_5:
- 00023E 7E40FD00 MOV.B #0xfd, R14
- 000242 5E52.... ADD.B &gucUartRxCnt, R14
- 000246 4B4E MOV.B R14, R11
- 107 ucRxIndex0 = gucUartRxCnt-2;
- 000248 7E40FE00 MOV.B #0xfe, R14
- 00024C 5E52.... ADD.B &gucUartRxCnt, R14
- 000250 484E MOV.B R14, R8
- 108 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x54 == aucUartRxBuf[ucRxIndex1]))
- 000252 4E48 MOV.B R8, R14
- 000254 3EF0FF00 AND.W #0xff, R14
- 000258 FE900D00.... CMP.B #0xd, aucUartRxBuf(R14)
- 00025E 0720 JNE ??FaxRXProcess_49
- 000260 4E4B MOV.B R11, R14
- 000262 3EF0FF00 AND.W #0xff, R14
- 000266 FE905400.... CMP.B #0x54, aucUartRxBuf(R14)
- 00026C 2524 JEQ ??FaxRXProcess_48
- 109 break;
- 110 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x52 == aucUartRxBuf[ucRxIndex1]))
- ??FaxRXProcess_49:
- 00026E 4E48 MOV.B R8, R14
- 000270 3EF0FF00 AND.W #0xff, R14
- 000274 FE900D00.... CMP.B #0xd, aucUartRxBuf(R14)
- 00027A 0720 JNE ??FaxRXProcess_50
- 00027C 4E4B MOV.B R11, R14
- 00027E 3EF0FF00 AND.W #0xff, R14
- 000282 FE905200.... CMP.B #0x52, aucUartRxBuf(R14)
- 000288 1724 JEQ ??FaxRXProcess_48
- 111 break;
- 112 //if check time>min. 5S, Receive Fax error, progra should be quit
- 113 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_50:
- 00028A 1E42.... MOV.W &gwTimeOverflowCount, R14
- 00028E 1F43 MOV.W #0x1, R15
- 000290 0F5E ADD.W R14, R15
- 000292 824F.... MOV.W R15, &gwTimeOverflowCount
- 000296 3E93 CMP.W #0xffff, R14
- 000298 0420 JNE ??FaxRXProcess_51
- 00029A D253.... ADD.B #0x1, &gucTimeOverflowCount
- 00029E C243.... MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_51:
- 0002A2 F2901400.... CMP.B #0x14, &gucTimeOverflowCount
- 0002A8 CA23 JNE ??FaxRXProcess_5
- 0002AA F2400300.... MOV.B #0x3, &gucFrhErrorStatus
- 0002B0 C243.... MOV.B #0x0, &gucTimeOverflowCount
- 0002B4 8243.... MOV.W #0x0, &gwTimeOverflowCount
- 114 }//while
- 115 }//if
- 116 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x54 == aucUartRxBuf[ucRxIndex1]))
- ??FaxRXProcess_48:
- 0002B8 4E48 MOV.B R8, R14
- 0002BA 3EF0FF00 AND.W #0xff, R14
- 0002BE FE900D00.... CMP.B #0xd, aucUartRxBuf(R14)
- 0002C4 6120 JNE ??FaxRXProcess_52
- 0002C6 4E4B MOV.B R11, R14
- 0002C8 3EF0FF00 AND.W #0xff, R14
- 0002CC FE905400.... CMP.B #0x54, aucUartRxBuf(R14)
- 0002D2 5A20 JNE ??FaxRXProcess_52
- 117 {
- 118 while (1)
- 119 {
- 120 ucRxIndex1 = gucUartRxCnt-3;
- ??FaxRXProcess_6:
- 0002D4 7E40FD00 MOV.B #0xfd, R14
- 0002D8 5E52.... ADD.B &gucUartRxCnt, R14
- 0002DC 4B4E MOV.B R14, R11
- 121 ucRxIndex0 = gucUartRxCnt-2;
- 0002DE 7E40FE00 MOV.B #0xfe, R14
- 0002E2 5E52.... ADD.B &gucUartRxCnt, R14
- 0002E6 484E MOV.B R14, R8
- 122 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x4B == aucUartRxBuf[ucRxIndex1]))
- 0002E8 4E48 MOV.B R8, R14
- 0002EA 3EF0FF00 AND.W #0xff, R14
- 0002EE FE900D00.... CMP.B #0xd, aucUartRxBuf(R14)
- 0002F4 0720 JNE ??FaxRXProcess_53
- 0002F6 4E4B MOV.B R11, R14
- 0002F8 3EF0FF00 AND.W #0xff, R14
- 0002FC FE904B00.... CMP.B #0x4b, aucUartRxBuf(R14)
- 000302 3424 JEQ ??FaxRXProcess_54
- 123 break;
- 124 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x52 == aucUartRxBuf[ucRxIndex1]))
- ??FaxRXProcess_53:
- 000304 4E48 MOV.B R8, R14
- 000306 3EF0FF00 AND.W #0xff, R14
- 00030A FE900D00.... CMP.B #0xd, aucUartRxBuf(R14)
- 000310 0720 JNE ??FaxRXProcess_55
- 000312 4E4B MOV.B R11, R14
- 000314 3EF0FF00 AND.W #0xff, R14
- 000318 FE905200.... CMP.B #0x52, aucUartRxBuf(R14)
- 00031E 2624 JEQ ??FaxRXProcess_54
- 125 break;
- 126 if ((0x13 == aucUartRxBuf[ucRxIndex0]) && (0xff == aucUartRxBuf[ucRxIndex1]))
- ??FaxRXProcess_55:
- 000320 4E48 MOV.B R8, R14
- 000322 3EF0FF00 AND.W #0xff, R14
- 000326 FE901300.... CMP.B #0x13, aucUartRxBuf(R14)
- 00032C 0820 JNE ??FaxRXProcess_56
- 00032E 4E4B MOV.B R11, R14
- 000330 3EF0FF00 AND.W #0xff, R14
- 000334 FE93.... CMP.B #0xff, aucUartRxBuf(R14)
- 000338 0220 JNE ??FaxRXProcess_56
- 127 {gucFrhErrorStatus=CNGFthOnlySendOneNSF;}
- 00033A D243.... MOV.B #0x1, &gucFrhErrorStatus
- 128 //if check time>min. 5S, Receive Fax error, progra should be quit
- 129 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_56:
- 00033E 1E42.... MOV.W &gwTimeOverflowCount, R14
- 000342 1F43 MOV.W #0x1, R15
- 000344 0F5E ADD.W R14, R15
- 000346 824F.... MOV.W R15, &gwTimeOverflowCount
- 00034A 3E93 CMP.W #0xffff, R14
- 00034C 0420 JNE ??FaxRXProcess_57
- 00034E D253.... ADD.B #0x1, &gucTimeOverflowCount
- 000352 C243.... MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_57:
- 000356 F2901400.... CMP.B #0x14, &gucTimeOverflowCount
- 00035C BB23 JNE ??FaxRXProcess_6
- 00035E F2400300.... MOV.B #0x3, &gucFrhErrorStatus
- 000364 C243.... MOV.B #0x0, &gucTimeOverflowCount
- 000368 8243.... MOV.W #0x0, &gwTimeOverflowCount
- 130 }//while
- 131 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x52 == aucUartRxBuf[ucRxIndex1]))
- ??FaxRXProcess_54:
- 00036C 4E48 MOV.B R8, R14
- 00036E 3EF0FF00 AND.W #0xff, R14
- 000372 FE900D00.... CMP.B #0xd, aucUartRxBuf(R14)
- 000378 0920 JNE ??FaxRXProcess_46
- 00037A 4E4B MOV.B R11, R14
- 00037C 3EF0FF00 AND.W #0xff, R14
- 000380 FE905200.... CMP.B #0x52, aucUartRxBuf(R14)
- 000386 0220 JNE ??FaxRXProcess_46
- 132 continue;//Response is not OK, but NO Carrier. should Re FTH CSI and DIS
- 133 else
- 134 break;//break for cycle
- 135 }//if
- 136 }//for
- ??FaxRXProcess_52:
- 000388 5A53 ADD.B #0x1, R10
- 00038A 2A3F JMP ??FaxRXProcess_7
- 137 ucRxIndex0 = gucUartRxCnt-25;
- ??FaxRXProcess_46:
- 00038C 7E40E700 MOV.B #0xe7, R14
- 000390 5E52.... ADD.B &gucUartRxCnt, R14
- 000394 484E MOV.B R14, R8
- 138 for (ucGeneralCnt = 0;ucGeneralCnt < 25;ucGeneralCnt++)
- 000396 4A43 MOV.B #0x0, R10
- ??FaxRXProcess_8:
- 000398 7A901900 CMP.B #0x19, R10
- 00039C 0D2C JC ??FaxRXProcess_58
- 139 {FRHTSI[ucRxIndex1++] = aucUartRxBuf[ucRxIndex0++];}
- 00039E 4F4B MOV.B R11, R15
- 0003A0 3FF0FF00 AND.W #0xff, R15
- 0003A4 4E48 MOV.B R8, R14
- 0003A6 3EF0FF00 AND.W #0xff, R14
- 0003AA DF4E........ MOV.B aucUartRxBuf(R14), FRHTSI(R15)
- 0003B0 5853 ADD.B #0x1, R8
- 0003B2 5B53 ADD.B #0x1, R11
- 0003B4 5A53 ADD.B #0x1, R10
- 0003B6 F03F JMP ??FaxRXProcess_8
- 140
- 141 //FRH DCS (digital command signal)
- 142 if (gucFrhErrorStatus != CNGFthOnlySendOneNSF)
- ??FaxRXProcess_58:
- 0003B8 D293.... CMP.B #0x1, &gucFrhErrorStatus
- 0003BC 6824 JEQ ??FaxRXProcess_59
- 143 {
- 144 SendATcmdFRH();
- 0003BE B012.... CALL #SendATcmdFRH
- 145 while (1)
- 146 {
- 147 ucRxIndex1 = gucUartRxCnt-3;
- ??FaxRXProcess_9:
- 0003C2 7E40FD00 MOV.B #0xfd, R14
- 0003C6 5E52.... ADD.B &gucUartRxCnt, R14
- 0003CA 4B4E MOV.B R14, R11
- 148 ucRxIndex0 = gucUartRxCnt-2;
- 0003CC 7E40FE00 MOV.B #0xfe, R14
- 0003D0 5E52.... ADD.B &gucUartRxCnt, R14
- 0003D4 484E MOV.B R14, R8
- 149 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x54 == aucUartRxBuf[ucRxIndex1]))
- 0003D6 38F0FF00 AND.W #0xff, R8
- 0003DA F8900D00.... CMP.B #0xd, aucUartRxBuf(R8)
- 0003E0 0620 JNE ??FaxRXProcess_60
- 0003E2 3BF0FF00 AND.W #0xff, R11
- 0003E6 FB905400.... CMP.B #0x54, aucUartRxBuf(R11)
- 0003EC 1724 JEQ ??FaxRXProcess_61
- 150 break;
- 151 //if check time>min. 5S, Receive Fax error, progra should be quit
- 152 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_60:
- 0003EE 1E42.... MOV.W &gwTimeOverflowCount, R14
- 0003F2 1F43 MOV.W #0x1, R15
- 0003F4 0F5E ADD.W R14, R15
- 0003F6 824F.... MOV.W R15, &gwTimeOverflowCount
- 0003FA 3E93 CMP.W #0xffff, R14
- 0003FC 0420 JNE ??FaxRXProcess_62
- 0003FE D253.... ADD.B #0x1, &gucTimeOverflowCount
- 000402 C243.... MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_62:
- 000406 F2901400.... CMP.B #0x14, &gucTimeOverflowCount
- 00040C DA23 JNE ??FaxRXProcess_9
- 00040E F2400300.... MOV.B #0x3, &gucFrhErrorStatus
- 000414 C243.... MOV.B #0x0, &gucTimeOverflowCount
- 000418 8243.... MOV.W #0x0, &gwTimeOverflowCount
- 153 }//while
- 154 if (gucFrhErrorStatus == 0x03) return; //add at Mar. 16, 2007.
- ??FaxRXProcess_61:
- 00041C F2900300.... CMP.B #0x3, &gucFrhErrorStatus
- 000422 .... JNE $+6
- 000424 3040.... BR #??FaxRXProcess_63
- 155
- 156 while (1)
- 157 {
- 158 ucRxIndex1 = gucUartRxCnt-3;
- ??FaxRXProcess_10:
- 000428 7E40FD00 MOV.B #0xfd, R14
- 00042C 5E52.... ADD.B &gucUartRxCnt, R14
- 000430 4B4E MOV.B R14, R11
- 159 ucRxIndex0 = gucUartRxCnt-2;
- 000432 7E40FE00 MOV.B #0xfe, R14
- 000436 5E52.... ADD.B &gucUartRxCnt, R14
- 00043A 484E MOV.B R14, R8
- 160 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x4B == aucUartRxBuf[ucRxIndex1]))
- 00043C 38F0FF00 AND.W #0xff, R8
- 000440 F8900D00.... CMP.B #0xd, aucUartRxBuf(R8)
- 000446 0620 JNE ??FaxRXProcess_64
- 000448 3BF0FF00 AND.W #0xff, R11
- 00044C FB904B00.... CMP.B #0x4b, aucUartRxBuf(R11)
- 000452 1724 JEQ ??FaxRXProcess_65
- 161 break;
- 162 //if check time>min. 5S, Receive Fax error, progra should be quit
- 163 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_64:
- 000454 1E42.... MOV.W &gwTimeOverflowCount, R14
- 000458 1F43 MOV.W #0x1, R15
- 00045A 0F5E ADD.W R14, R15
- 00045C 824F.... MOV.W R15, &gwTimeOverflowCount
- 000460 3E93 CMP.W #0xffff, R14
- 000462 0420 JNE ??FaxRXProcess_66
- 000464 D253.... ADD.B #0x1, &gucTimeOverflowCount
- 000468 C243.... MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_66:
- 00046C F2901400.... CMP.B #0x14, &gucTimeOverflowCount
- 000472 DA23 JNE ??FaxRXProcess_10
- 000474 F2400300.... MOV.B #0x3, &gucFrhErrorStatus
- 00047A C243.... MOV.B #0x0, &gucTimeOverflowCount
- 00047E 8243.... MOV.W #0x0, &gwTimeOverflowCount
- 164 }//while
- 165 if (gucFrhErrorStatus == 0x03) return; //add at Mar. 16, 2007.
- ??FaxRXProcess_65:
- 000482 F2900300.... CMP.B #0x3, &gucFrhErrorStatus
- 000488 .... JNE $+6
- 00048A 3040.... BR #??FaxRXProcess_63
- 166 }//if
- 167
- 168 //if (ucFrhErrorStatus==03) return; //add at Mar. 16, 2007.
- 169 //*/
- 170
- 171
- 172
- 173 //FRM TCF (training check)
- 174 SendATcmdFRM();
- ??FaxRXProcess_59:
- 00048E B012.... CALL #SendATcmdFRM
- 175
- 176 while (1)
- 177 {
- 178 ucRxIndex1 = gucUartRxCnt-3;
- ??FaxRXProcess_11:
- 000492 7E40FD00 MOV.B #0xfd, R14
- 000496 5E52.... ADD.B &gucUartRxCnt, R14
- 00049A 4B4E MOV.B R14, R11
- 179 ucRxIndex0 = gucUartRxCnt-2;
- 00049C 7E40FE00 MOV.B #0xfe, R14
- 0004A0 5E52.... ADD.B &gucUartRxCnt, R14
- 0004A4 484E MOV.B R14, R8
- 180 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x54 == aucUartRxBuf[ucRxIndex1]))
- 0004A6 38F0FF00 AND.W #0xff, R8
- 0004AA F8900D00.... CMP.B #0xd, aucUartRxBuf(R8)
- 0004B0 0620 JNE ??FaxRXProcess_67
- 0004B2 3BF0FF00 AND.W #0xff, R11
- 0004B6 FB905400.... CMP.B #0x54, aucUartRxBuf(R11)
- 0004BC 1724 JEQ ??FaxRXProcess_68
- 181 break;
- 182 //if check time>min. 5S, Receive Fax error, progra should be quit
- 183 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_67:
- 0004BE 1E42.... MOV.W &gwTimeOverflowCount, R14
- 0004C2 1F43 MOV.W #0x1, R15
- 0004C4 0F5E ADD.W R14, R15
- 0004C6 824F.... MOV.W R15, &gwTimeOverflowCount
- 0004CA 3E93 CMP.W #0xffff, R14
- 0004CC 0420 JNE ??FaxRXProcess_69
- 0004CE D253.... ADD.B #0x1, &gucTimeOverflowCount
- 0004D2 C243.... MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_69:
- 0004D6 F2901400.... CMP.B #0x14, &gucTimeOverflowCount
- 0004DC DA23 JNE ??FaxRXProcess_11
- 0004DE F2400300.... MOV.B #0x3, &gucFrhErrorStatus
- 0004E4 C243.... MOV.B #0x0, &gucTimeOverflowCount
- 0004E8 8243.... MOV.W #0x0, &gwTimeOverflowCount
- 184 }
- 185 if (gucFrhErrorStatus == 0x03) return;
- ??FaxRXProcess_68:
- 0004EC F2900300.... CMP.B #0x3, &gucFrhErrorStatus
- 0004F2 .... JNE $+6
- 0004F4 3040.... BR #??FaxRXProcess_63
- 186 //Carrier==Training check
- 187 ///* //add the No carrier check a bug of Dec.25,2006
- 188 while (1)
- 189 {
- 190 ucRxIndex1 = gucUartRxCnt-3;
- ??FaxRXProcess_12:
- 0004F8 7E40FD00 MOV.B #0xfd, R14
- 0004FC 5E52.... ADD.B &gucUartRxCnt, R14
- 000500 4B4E MOV.B R14, R11
- 191 ucRxIndex0 = gucUartRxCnt-2;
- 000502 7E40FE00 MOV.B #0xfe, R14
- 000506 5E52.... ADD.B &gucUartRxCnt, R14
- 00050A 484E MOV.B R14, R8
- 192 if ((aucUartRxBuf[ucRxIndex0] == 0x0d)&&(aucUartRxBuf[ucRxIndex1] == 0x52))//4B Result code is not OK, but No carrier
- 00050C 38F0FF00 AND.W #0xff, R8
- 000510 F8900D00.... CMP.B #0xd, aucUartRxBuf(R8)
- 000516 0620 JNE ??FaxRXProcess_70
- 000518 3BF0FF00 AND.W #0xff, R11
- 00051C FB905200.... CMP.B #0x52, aucUartRxBuf(R11)
- 000522 1724 JEQ ??FaxRXProcess_71
- 193 break;
- 194 //if check time>min. 5S, Receive Fax error, progra should be quit
- 195 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_70:
- 000524 1E42.... MOV.W &gwTimeOverflowCount, R14
- 000528 1F43 MOV.W #0x1, R15
- 00052A 0F5E ADD.W R14, R15
- 00052C 824F.... MOV.W R15, &gwTimeOverflowCount
- 000530 3E93 CMP.W #0xffff, R14
- 000532 0420 JNE ??FaxRXProcess_72
- 000534 D253.... ADD.B #0x1, &gucTimeOverflowCount
- 000538 C243.... MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_72:
- 00053C F2901400.... CMP.B #0x14, &gucTimeOverflowCount
- 000542 DA23 JNE ??FaxRXProcess_12
- 000544 F2400300.... MOV.B #0x3, &gucFrhErrorStatus
- 00054A C243.... MOV.B #0x0, &gucTimeOverflowCount
- 00054E 8243.... MOV.W #0x0, &gwTimeOverflowCount
- 196 }
- 197 if (gucFrhErrorStatus == 0x03) return;
- ??FaxRXProcess_71:
- 000552 F2900300.... CMP.B #0x3, &gucFrhErrorStatus
- 000558 .... JNE $+6
- 00055A 3040.... BR #??FaxRXProcess_63
- 198 //*/
- 199 //Training check over
- 200 //FTHCFR (confirmation to receive)
- 201 SendATcmdFTH();
- 00055E B012.... CALL #SendATcmdFTH
- 202 while (1) //Connect
- 203 {
- 204 ucRxIndex1=gucUartRxCnt-3;
- ??FaxRXProcess_13:
- 000562 7E40FD00 MOV.B #0xfd, R14
- 000566 5E52.... ADD.B &gucUartRxCnt, R14
- 00056A 4B4E MOV.B R14, R11
- 205 ucRxIndex0=gucUartRxCnt-2;
- 00056C 7E40FE00 MOV.B #0xfe, R14
- 000570 5E52.... ADD.B &gucUartRxCnt, R14
- 000574 484E MOV.B R14, R8
- 206 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x54==aucUartRxBuf[ucRxIndex1]))
- 000576 38F0FF00 AND.W #0xff, R8
- 00057A F8900D00.... CMP.B #0xd, aucUartRxBuf(R8)
- 000580 0620 JNE ??FaxRXProcess_73
- 000582 3BF0FF00 AND.W #0xff, R11
- 000586 FB905400.... CMP.B #0x54, aucUartRxBuf(R11)
- 00058C 1724 JEQ ??FaxRXProcess_74
- 207 break;
- 208 //if check time>min. 5S, Receive Fax error, progra should be quit
- 209 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_73:
- 00058E 1E42.... MOV.W &gwTimeOverflowCount, R14
- 000592 1F43 MOV.W #0x1, R15
- 000594 0F5E ADD.W R14, R15
- 000596 824F.... MOV.W R15, &gwTimeOverflowCount
- 00059A 3E93 CMP.W #0xffff, R14
- 00059C 0420 JNE ??FaxRXProcess_75
- 00059E D253.... ADD.B #0x1, &gucTimeOverflowCount
- 0005A2 C243.... MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_75:
- 0005A6 F2901400.... CMP.B #0x14, &gucTimeOverflowCount
- 0005AC DA23 JNE ??FaxRXProcess_13
- 0005AE F2400300.... MOV.B #0x3, &gucFrhErrorStatus
- 0005B4 C243.... MOV.B #0x0, &gucTimeOverflowCount
- 0005B8 8243.... MOV.W #0x0, &gwTimeOverflowCount
- 210 }
- 211 if (gucFrhErrorStatus==0x03) return;
- ??FaxRXProcess_74:
- 0005BC F2900300.... CMP.B #0x3, &gucFrhErrorStatus
- 0005C2 .... JNE $+6
- 0005C4 3040.... BR #??FaxRXProcess_63
- 212
- 213 for (ucGeneralCount=0; ucGeneralCount<30; ucGeneralCount++)// delay 1.5S minimun 1 second
- 0005C8 4443 MOV.B #0x0, R4
- ??FaxRXProcess_14:
- 0005CA 74901E00 CMP.B #0x1e, R4
- 0005CE 042C JC ??FaxRXProcess_76
- 214 {
- 215 ATcmdDelay(); //50ms
- 0005D0 B012.... CALL #ATcmdDelay
- 216 }
- 0005D4 5453 ADD.B #0x1, R4
- 0005D6 F93F JMP ??FaxRXProcess_14
- 217
- 218 SendATdataFTHCFR();
- ??FaxRXProcess_76:
- 0005D8 B012.... CALL #SendATdataFTHCFR
- 219
- 220 while (1)
- 221 {
- 222 ucRxIndex1=gucUartRxCnt-3;
- ??FaxRXProcess_15:
- 0005DC 7E40FD00 MOV.B #0xfd, R14
- 0005E0 5E52.... ADD.B &gucUartRxCnt, R14
- 0005E4 4B4E MOV.B R14, R11
- 223 ucRxIndex0=gucUartRxCnt-2;
- 0005E6 7E40FE00 MOV.B #0xfe, R14
- 0005EA 5E52.... ADD.B &gucUartRxCnt, R14
- 0005EE 484E MOV.B R14, R8
- 224 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
- 0005F0 38F0FF00 AND.W #0xff, R8
- 0005F4 F8900D00.... CMP.B #0xd, aucUartRxBuf(R8)
- 0005FA 0620 JNE ??FaxRXProcess_77
- 0005FC 3BF0FF00 AND.W #0xff, R11
- 000600 FB904B00.... CMP.B #0x4b, aucUartRxBuf(R11)
- 000606 1724 JEQ ??FaxRXProcess_78
- 225 break;
- 226 //if check time>min. 5S, Receive Fax error, progra should be quit
- 227 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_77:
- 000608 1E42.... MOV.W &gwTimeOverflowCount, R14
- 00060C 1F43 MOV.W #0x1, R15
- 00060E 0F5E ADD.W R14, R15
- 000610 824F.... MOV.W R15, &gwTimeOverflowCount
- 000614 3E93 CMP.W #0xffff, R14
- 000616 0420 JNE ??FaxRXProcess_79
- 000618 D253.... ADD.B #0x1, &gucTimeOverflowCount
- 00061C C243.... MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_79:
- 000620 F2901400.... CMP.B #0x14, &gucTimeOverflowCount
- 000626 DA23 JNE ??FaxRXProcess_15
- 000628 F2400300.... MOV.B #0x3, &gucFrhErrorStatus
- 00062E C243.... MOV.B #0x0, &gucTimeOverflowCount
- 000632 8243.... MOV.W #0x0, &gwTimeOverflowCount
- 228 }
- 229 if (gucFrhErrorStatus==0x03) return;
- ??FaxRXProcess_78:
- 000636 F2900300.... CMP.B #0x3, &gucFrhErrorStatus
- 00063C .... JNE $+6
- 00063E 3040.... BR #??FaxRXProcess_63
- 230
- 231
- 232
- 233 //FRM pageimage
- 234 //SendATcmdFRM146();
- 235 SendATcmdFRM();
- 000642 B012.... CALL #SendATcmdFRM
- 236
- 237 wGeneralCount=0;//63;
- 000646 0743 MOV.W #0x0, R7
- 238 ucGeneralCnt=0;//28;
- 000648 4A43 MOV.B #0x0, R10
- 239 //wPageAddress=0;
- 240 gucFrhErrorStatus=0;
- 00064A C243.... MOV.B #0x0, &gucFrhErrorStatus
- 241 gucUartRxCnt=0;
- 00064E C243.... MOV.B #0x0, &gucUartRxCnt
- 242 gpucQueueRear=0;
- 000652 C243.... MOV.B #0x0, &gpucQueueRear
- 243 gpucQueueFront=0;
- 000656 C243.... MOV.B #0x0, &gpucQueueFront
- 244 gdwRxQueueRearCnt=0;
- 00065A 8243.... MOV.W #0x0, &gdwRxQueueRearCnt
- 00065E 8243.... MOV.W #0x0, &gdwRxQueueRearCnt + 0x2
- 245 gdwRxQueueFrontCnt=0;
- 000662 8243.... MOV.W #0x0, &gdwRxQueueFrontCnt
- 000666 8243.... MOV.W #0x0, &gdwRxQueueFrontCnt + 0x2
- 246 //ZERO_ADDRESS();
- 247
- 248 wPageAddress=cstFaxRxBufStartPage;//+1;//Block 19 Modify at Jan. 6, 2007
- 00066A 3940C004 MOV.W #0x4c0, R9
- 249
- 250 do{
- 251 wNextPageAddress=wPageAddress+64;
- ??FaxRXProcess_16:
- 00066E 3E404000 MOV.W #0x40, R14
- 000672 0E59 ADD.W R9, R14
- 000674 054E MOV.W R14, R5
- 252 wPageAddress=CalNextPageAddress(wPageAddress);
- 000676 0C49 MOV.W R9, R12
- 000678 B012.... CALL #CalNextPageAddress
- 00067C 094C MOV.W R12, R9
- 253 }while(wNextPageAddress==wPageAddress);
- 00067E 0599 CMP.W R9, R5
- 000680 F627 JEQ ??FaxRXProcess_16
- 254 //erase next block
- 255 if (wPageAddress%64==0)
- 000682 0C49 MOV.W R9, R12
- 000684 3E404000 MOV.W #0x40, R14
- 000688 B012.... CALL #?DivMod16u
- 00068C 0E93 CMP.W #0x0, R14
- 00068E 0A20 JNE ??FaxRXProcess_80
- 256 {
- 257 ROW_ADDRESS_LOW=wPageAddress & 0XFF;
- 000690 C249.... MOV.B R9, &ROW_ADDRESS_LOW
- 258 ROW_ADDRESS_HIGH=(wPageAddress>>8) & 0XFF;
- 000694 0E49 MOV.W R9, R14
- 000696 8E10 SWPB R14
- 000698 3EF0FF00 AND.W #0xff, R14
- 00069C C24E.... MOV.B R14, &ROW_ADDRESS_HIGH
- 259 ERASE_ONE_BLOCK();
- 0006A0 B012.... CALL #ERASE_ONE_BLOCK
- 260 }
- 261 wPageAddress=cstFaxRxBufStartPage+1;
- ??FaxRXProcess_80:
- 0006A4 3940C104 MOV.W #0x4c1, R9
- 262 //COMMAND
- 263 //Flash_Reset();
- 264 COMMAND_VAL=0X80;
- 0006A8 F2408000.... MOV.B #0x80, &COMMAND_VAL
- 265 COMMAND_LATCH_INTO();
- 0006AE B012.... CALL #COMMAND_LATCH_INTO
- 266
- 267 //ADDRESS
- 268 ADDRESS_VALUE=0;//COLUMN_ADDRESS_HIGH; //#0X00
- 0006B2 C243.... MOV.B #0x0, &ADDRESS_VALUE
- 269 ADDRESS_LATCH_INTO();
- 0006B6 B012.... CALL #ADDRESS_LATCH_INTO
- 270
- 271 ADDRESS_VALUE=0;//COLUMN_ADDRESS_HIGH; //#0X00
- 0006BA C243.... MOV.B #0x0, &ADDRESS_VALUE
- 272 ADDRESS_LATCH_INTO();
- 0006BE B012.... CALL #ADDRESS_LATCH_INTO
- 273
- 274 ADDRESS_VALUE=wPageAddress & 0xff; //#0X00
- 0006C2 C249.... MOV.B R9, &ADDRESS_VALUE
- 275 ADDRESS_LATCH_INTO();
- 0006C6 B012.... CALL #ADDRESS_LATCH_INTO
- 276
- 277 ADDRESS_VALUE=(wPageAddress>>8) & 0xff; //#0X00
- 0006CA 0E49 MOV.W R9, R14
- 0006CC 8E10 SWPB R14
- 0006CE 3EF0FF00 AND.W #0xff, R14
- 0006D2 C24E.... MOV.B R14, &ADDRESS_VALUE
- 278 ADDRESS_LATCH_INTO();
- 0006D6 B012.... CALL #ADDRESS_LATCH_INTO
- 279
- 280 FLASH_CON_PORT_OUT &=~ ALE;
- 0006DA E2C32900 BIC.B #0x2, &0x29
- 281 //CALL DELAY_100US
- 282 //for(i=0;i<0xff;i++);
- 283 DATA_PORT_OUT_INITIAL; //MCU OUTPUT,MCU WRITE A DATA TO FLASH
- 0006DE F2433200 MOV.B #0xff, &0x32
- 284 //Pageimage
- 285 while (1)
- 286 {
- 287 //if ((0x10 == aucUartRxBuf[ucRxIndex1]) && (0x03 == aucUartRxBuf[ucRxIndex0]))//terminate stream 10 03
- 288 //if ((0x10 == aucUartRxBuf[gucUartRxCnt-1]) && (0x03 == aucUartRxBuf[gucUartRxCnt]))//terminate stream 10 03
- 289 //break;
- 290 //if check time>min. 5S, Receive Fax error, progra should be quit
- 291 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_17:
- 0006E2 1E42.... MOV.W &gwTimeOverflowCount, R14
- 0006E6 1F43 MOV.W #0x1, R15
- 0006E8 0F5E ADD.W R14, R15
- 0006EA 824F.... MOV.W R15, &gwTimeOverflowCount
- 0006EE 3E93 CMP.W #0xffff, R14
- 0006F0 0420 JNE ??FaxRXProcess_81
- 0006F2 D253.... ADD.B #0x1, &gucTimeOverflowCount
- 0006F6 C243.... MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_81:
- 0006FA F2901400.... CMP.B #0x14, &gucTimeOverflowCount
- 000700 0820 JNE ??FaxRXProcess_82
- 000702 F2400300.... MOV.B #0x3, &gucFrhErrorStatus
- 000708 C243.... MOV.B #0x0, &gucTimeOverflowCount
- 00070C 8243.... MOV.W #0x0, &gwTimeOverflowCount
- 000710 023D JMP ??FaxRXProcess_83
- 292 ucRxIndex1=gucUartRxCnt-3;
- ??FaxRXProcess_82:
- 000712 7E40FD00 MOV.B #0xfd, R14
- 000716 5E52.... ADD.B &gucUartRxCnt, R14
- 00071A 4B4E MOV.B R14, R11
- 293 ucRxIndex0=gucUartRxCnt-2;
- 00071C 7E40FE00 MOV.B #0xfe, R14
- 000720 5E52.... ADD.B &gucUartRxCnt, R14
- 000724 484E MOV.B R14, R8
- 294 if ((aucUartRxBuf[ucRxIndex0]==0x0d)&&(aucUartRxBuf[ucRxIndex1]==0x52))//4B Result code is not OK, but No carrier
- 000726 38F0FF00 AND.W #0xff, R8
- 00072A F8900D00.... CMP.B #0xd, aucUartRxBuf(R8)
- 000730 6A20 JNE ??FaxRXProcess_84
- 000732 3BF0FF00 AND.W #0xff, R11
- 000736 FB905200.... CMP.B #0x52, aucUartRxBuf(R11)
- 00073C 6420 JNE ??FaxRXProcess_84
- 295 {
- 296
- 297 PageImageEndProcess();
- 00073E B012.... CALL #PageImageEndProcess
- 298
- 299 if (gucFrhErrorStatus==0x03) break; //add at Mar. 16, 2007.
- 000742 F2900300.... CMP.B #0x3, &gucFrhErrorStatus
- 000748 E624 JEQ ??FaxRXProcess_83
- 300
- 301 //More than two pages process //add at Dec.27,2006
- 302 ucRxIndex3=gucUartRxCnt-38;
- 00074A 7E40DA00 MOV.B #0xda, R14
- 00074E 5E52.... ADD.B &gucUartRxCnt, R14
- 000752 C14E0000 MOV.B R14, 0x0(SP)
- 303 ucRxIndex2=gucUartRxCnt-37;
- 000756 7E40DB00 MOV.B #0xdb, R14
- 00075A 5E52.... ADD.B &gucUartRxCnt, R14
- 00075E C14E0100 MOV.B R14, 0x1(SP)
- 304 ucRxIndex1=gucUartRxCnt-36;
- 000762 7E40DC00 MOV.B #0xdc, R14
- 000766 5E52.... ADD.B &gucUartRxCnt, R14
- 00076A 4B4E MOV.B R14, R11
- 305 ucRxIndex0=gucUartRxCnt-35;
- 00076C 7E40DD00 MOV.B #0xdd, R14
- 000770 5E52.... ADD.B &gucUartRxCnt, R14
- 000774 484E MOV.B R14, R8
- 306 if ((aucUartRxBuf[ucRxIndex0]==0x05)&&(aucUartRxBuf[ucRxIndex1]==0x35)&&
- 307 (aucUartRxBuf[ucRxIndex2]==0x4f)&&(aucUartRxBuf[ucRxIndex3]==0x13))
- 000776 4E48 MOV.B R8, R14
- 000778 3EF0FF00 AND.W #0xff, R14
- 00077C FE900500.... CMP.B #0x5, aucUartRxBuf(R14)
- 000782 1820 JNE ??FaxRXProcess_85
- 000784 4E4B MOV.B R11, R14
- 000786 3EF0FF00 AND.W #0xff, R14
- 00078A FE903500.... CMP.B #0x35, aucUartRxBuf(R14)
- 000790 1120 JNE ??FaxRXProcess_85
- 000792 5E410100 MOV.B 0x1(SP), R14
- 000796 3EF0FF00 AND.W #0xff, R14
- 00079A FE904F00.... CMP.B #0x4f, aucUartRxBuf(R14)
- 0007A0 0920 JNE ??FaxRXProcess_85
- 0007A2 6E41 MOV.B 0x0(SP), R14
- 0007A4 3EF0FF00 AND.W #0xff, R14
- 0007A8 FE901300.... CMP.B #0x13, aucUartRxBuf(R14)
- 0007AE 0220 JNE ??FaxRXProcess_85
- 308 {
- 309 SendATcmdFRM();
- 0007B0 B012.... CALL #SendATcmdFRM
- 310 }
- 311 // multi pages over flag
- 312 if ((aucUartRxBuf[ucRxIndex0]==0x66)&&(aucUartRxBuf[ucRxIndex1]==0x33)&&
- 313 (aucUartRxBuf[ucRxIndex2]==0x2f)&&(aucUartRxBuf[ucRxIndex3]==0x13))
- ??FaxRXProcess_85:
- 0007B4 4E48 MOV.B R8, R14
- 0007B6 3EF0FF00 AND.W #0xff, R14
- 0007BA FE906600.... CMP.B #0x66, aucUartRxBuf(R14)
- 0007C0 1620 JNE ??FaxRXProcess_86
- 0007C2 4E4B MOV.B R11, R14
- 0007C4 3EF0FF00 AND.W #0xff, R14
- 0007C8 FE903300.... CMP.B #0x33, aucUartRxBuf(R14)
- 0007CE 0F20 JNE ??FaxRXProcess_86
- 0007D0 5E410100 MOV.B 0x1(SP), R14
- 0007D4 3EF0FF00 AND.W #0xff, R14
- 0007D8 FE902F00.... CMP.B #0x2f, aucUartRxBuf(R14)
- 0007DE 0720 JNE ??FaxRXProcess_86
- 0007E0 6E41 MOV.B 0x0(SP), R14
- 0007E2 3EF0FF00 AND.W #0xff, R14
- 0007E6 FE901300.... CMP.B #0x13, aucUartRxBuf(R14)
- 0007EC 9424 JEQ ??FaxRXProcess_83
- 314 {
- 315 break;
- 316 }
- 317 // one page over flag
- 318 if ((aucUartRxBuf[ucRxIndex0]==0x2f)&&(aucUartRxBuf[ucRxIndex1]==0x13))
- ??FaxRXProcess_86:
- 0007EE 38F0FF00 AND.W #0xff, R8
- 0007F2 F8902F00.... CMP.B #0x2f, aucUartRxBuf(R8)
- 0007F8 0620 JNE ??FaxRXProcess_84
- 0007FA 3BF0FF00 AND.W #0xff, R11
- 0007FE FB901300.... CMP.B #0x13, aucUartRxBuf(R11)
- 000804 8824 JEQ ??FaxRXProcess_83
- 319 {
- 320 break;
- 321 }
- 322 }
- 323
- 324 if (gdwRxQueueRearCnt-gdwRxQueueFrontCnt>32)
- ??FaxRXProcess_84:
- 000806 1E42.... MOV.W &gdwRxQueueRearCnt, R14
- 00080A 1F42.... MOV.W &gdwRxQueueRearCnt + 0x2, R15
- 00080E 1E82.... SUB.W &gdwRxQueueFrontCnt, R14
- 000812 1F72.... SUBC.W &gdwRxQueueFrontCnt + 0x2, R15
- 000816 0F93 CMP.W #0x0, R15
- 000818 642B JNC ??FaxRXProcess_17
- 00081A 0320 JNE ??FaxRXProcess_87
- 00081C 3E902100 CMP.W #0x21, R14
- 000820 602B JNC ??FaxRXProcess_17
- 325 {
- 326 if (gdwRxQueueRearCnt-gdwRxQueueFrontCnt>254) // if data num is more than the buffer space, error happan.
- ??FaxRXProcess_87:
- 000822 1E42.... MOV.W &gdwRxQueueRearCnt, R14
- 000826 1F42.... MOV.W &gdwRxQueueRearCnt + 0x2, R15
- 00082A 1E82.... SUB.W &gdwRxQueueFrontCnt, R14
- 00082E 1F72.... SUBC.W &gdwRxQueueFrontCnt + 0x2, R15
- 000832 0F93 CMP.W #0x0, R15
- 000834 0528 JNC ??FaxRXProcess_88
- 000836 0320 JNE ??FaxRXProcess_31
- 000838 3E90FF00 CMP.W #0xff, R14
- 00083C 0128 JNC ??FaxRXProcess_88
- 327 {
- 328 while (1);//gucGeneralStatus |= FAXRXERROR;
- ??FaxRXProcess_31:
- 00083E FF3F JMP ??FaxRXProcess_31
- 329 }
- 330 if (wGeneralCount++<64) // 32*64=2048
- ??FaxRXProcess_88:
- 000840 0E47 MOV.W R7, R14
- 000842 1743 MOV.W #0x1, R7
- 000844 075E ADD.W R14, R7
- 000846 3E904000 CMP.W #0x40, R14
- 00084A 172C JC ??FaxRXProcess_89
- 331 {
- 332 for (ucGeneralCnt=0;ucGeneralCnt<32;ucGeneralCnt++)
- 00084C 4A43 MOV.B #0x0, R10
- ??FaxRXProcess_19:
- 00084E 7A902000 CMP.B #0x20, R10
- 000852 472F JC ??FaxRXProcess_17
- 333 {
- 334 FLASH_CON_PORT_OUT&=~WE;
- 000854 D2C32900 BIC.B #0x1, &0x29
- 335 DATA_PORT_OUT=aucUartRxBuf[gpucQueueFront++];
- 000858 5E42.... MOV.B &gpucQueueFront, R14
- 00085C 3EF0FF00 AND.W #0xff, R14
- 000860 D24E....3100 MOV.B aucUartRxBuf(R14), &0x31
- 000866 D253.... ADD.B #0x1, &gpucQueueFront
- 336 gdwRxQueueFrontCnt++; //The total num that is writed to flash
- 00086A 9253.... ADD.W #0x1, &gdwRxQueueFrontCnt
- 00086E 8263.... ADDC.W #0x0, &gdwRxQueueFrontCnt + 0x2
- 337 FLASH_CON_PORT_OUT |= WE;
- 000872 D2D32900 BIS.B #0x1, &0x29
- 338 }
- 000876 5A53 ADD.B #0x1, R10
- 000878 EA3F JMP ??FaxRXProcess_19
- 339 //ucGeneralCnt=0;
- 340 }
- 341 else
- 342 {
- 343 wGeneralCount=0;
- ??FaxRXProcess_89:
- 00087A 0743 MOV.W #0x0, R7
- 344
- 345 COMMAND_VAL=0X10; //10H INITIATES PROGRAM
- 00087C F2401000.... MOV.B #0x10, &COMMAND_VAL
- 346 COMMAND_LATCH_INTO();
- 000882 B012.... CALL #COMMAND_LATCH_INTO
- 347
- 348 READ_STATUS();
- 000886 B012.... CALL #READ_STATUS
- 349 ucFlashSttsOverflowCnt=0;
- 00088A 4643 MOV.B #0x0, R6
- 350 while (FLASH_STATUS==1&&(ucFlashSttsOverflowCnt++)<2)
- ??FaxRXProcess_20:
- 00088C D293.... CMP.B #0x1, &FLASH_STATUS
- 000890 0520 JNE ??FaxRXProcess_90
- 000892 4E46 MOV.B R6, R14
- 000894 5643 MOV.B #0x1, R6
- 000896 465E ADD.B R14, R6
- 000898 6E93 CMP.B #0x2, R14
- 00089A F82B JNC ??FaxRXProcess_20
- 351 {
- 352 ;//ERASE_ONE_BLOCK();
- 353 //PROGRAM_ONE_PAGE();
- 354 }
- 355 if (wPageAddress<2559) wPageAddress++; //add at Jan. 18, 2007
- ??FaxRXProcess_90:
- 00089C 3990FF09 CMP.W #0x9ff, R9
- 0008A0 012C JC ??FaxRXProcess_21
- 0008A2 1953 ADD.W #0x1, R9
- 356 do{
- 357 wNextPageAddress=wPageAddress+64;
- ??FaxRXProcess_21:
- 0008A4 3E404000 MOV.W #0x40, R14
- 0008A8 0E59 ADD.W R9, R14
- 0008AA 054E MOV.W R14, R5
- 358 wPageAddress=CalNextPageAddress(wPageAddress);
- 0008AC 0C49 MOV.W R9, R12
- 0008AE B012.... CALL #CalNextPageAddress
- 0008B2 094C MOV.W R12, R9
- 359 }while(wNextPageAddress==wPageAddress);
- 0008B4 0599 CMP.W R9, R5
- 0008B6 F627 JEQ ??FaxRXProcess_21
- 360 if (wPageAddress%64==0)
- 0008B8 0C49 MOV.W R9, R12
- 0008BA 3E404000 MOV.W #0x40, R14
- 0008BE B012.... CALL #?DivMod16u
- 0008C2 0E93 CMP.W #0x0, R14
- 0008C4 0A20 JNE ??FaxRXProcess_91
- 361 {
- 362 ROW_ADDRESS_LOW=wPageAddress & 0XFF;
- 0008C6 C249.... MOV.B R9, &ROW_ADDRESS_LOW
- 363 ROW_ADDRESS_HIGH=(wPageAddress>>8) & 0XFF;
- 0008CA 0E49 MOV.W R9, R14
- 0008CC 8E10 SWPB R14
- 0008CE 3EF0FF00 AND.W #0xff, R14
- 0008D2 C24E.... MOV.B R14, &ROW_ADDRESS_HIGH
- 364 ERASE_ONE_BLOCK();
- 0008D6 B012.... CALL #ERASE_ONE_BLOCK
- 365 }
- 366 //Flash_Reset();
- 367 COMMAND_VAL=0X80;
- ??FaxRXProcess_91:
- 0008DA F2408000.... MOV.B #0x80, &COMMAND_VAL
- 368 COMMAND_LATCH_INTO();
- 0008E0 B012.... CALL #COMMAND_LATCH_INTO
- 369
- 370 //ADDRESS
- 371 ADDRESS_VALUE=0;//COLUMN_ADDRESS_HIGH; //#0X00
- 0008E4 C243.... MOV.B #0x0, &ADDRESS_VALUE
- 372 ADDRESS_LATCH_INTO();
- 0008E8 B012.... CALL #ADDRESS_LATCH_INTO
- 373
- 374 ADDRESS_VALUE=0;//COLUMN_ADDRESS_HIGH; //#0X00
- 0008EC C243.... MOV.B #0x0, &ADDRESS_VALUE
- 375 ADDRESS_LATCH_INTO();
- 0008F0 B012.... CALL #ADDRESS_LATCH_INTO
- 376
- 377 ADDRESS_VALUE=wPageAddress & 0xff; //#0X00
- 0008F4 C249.... MOV.B R9, &ADDRESS_VALUE
- 378 ADDRESS_LATCH_INTO();
- 0008F8 B012.... CALL #ADDRESS_LATCH_INTO
- 379
- 380 ADDRESS_VALUE=(wPageAddress>>8) & 0xff; //#0X00
- 0008FC 0E49 MOV.W R9, R14
- 0008FE 8E10 SWPB R14
- 000900 3EF0FF00 AND.W #0xff, R14
- 000904 C24E.... MOV.B R14, &ADDRESS_VALUE
- 381 ADDRESS_LATCH_INTO();
- 000908 B012.... CALL #ADDRESS_LATCH_INTO
- 382
- 383 FLASH_CON_PORT_OUT &=~ ALE;
- 00090C E2C32900 BIC.B #0x2, &0x29
- 384 //CALL DELAY_100US
- 385 //for(i=0;i<0xff;i++);
- 386 DATA_PORT_OUT_INITIAL; //MCU OUTPUT,MCU WRITE A DATA TO FLASH
- 000910 F2433200 MOV.B #0xff, &0x32
- 000914 E63E JMP ??FaxRXProcess_17
- 387
- 388 }//else
- 389 }//if
- 390 }//while
- 391
- 392 if (gucFrhErrorStatus==0x03) return; //add at Mar. 16, 2007.
- ??FaxRXProcess_83:
- 000916 F2900300.... CMP.B #0x3, &gucFrhErrorStatus
- 00091C EA25 JEQ ??FaxRXProcess_63
- 393
- 394