FaxProcess.s43
上传用户:xhjmsc
上传日期:2019-09-13
资源大小:389k
文件大小:82k
- NAME FaxProcess
- RTMODEL "__double_size", "32"
- RTMODEL "__pic", "no"
- RTMODEL "__reg_r4", "free"
- RTMODEL "__reg_r5", "free"
- RTMODEL "__rt_version", "1"
- RSEG CSTACK:DATA:SORT:NOROOT(1)
- EXTERN ?Epilogue8
- EXTERN SendATcmdATA
- FUNCTION SendATcmdATA,0202H
- EXTERN gucUartRxCnt
- EXTERN aucUartRxBuf
- EXTERN gwTimeOverflowCount
- EXTERN gucTimeOverflowCount
- EXTERN gucFrhErrorStatus
- EXTERN Delay1500ms
- FUNCTION Delay1500ms,0202H
- EXTERN SendATdataFTHCSI
- FUNCTION SendATdataFTHCSI,0202H
- EXTERN ATcmdDelay
- FUNCTION ATcmdDelay,0202H
- EXTERN SendATdataFTHDIS
- FUNCTION SendATdataFTHDIS,0202H
- EXTERN SendATcmdFRH
- FUNCTION SendATcmdFRH,0202H
- EXTERN SendATcmdSuffix
- FUNCTION SendATcmdSuffix,0202H
- EXTERN SendATcmdPrefix
- FUNCTION SendATcmdPrefix,0202H
- EXTERN Delay2000ms
- FUNCTION Delay2000ms,0202H
- EXTERN FRHTSI
- EXTERN SendATcmdFRM
- FUNCTION SendATcmdFRM,0202H
- EXTERN SendATcmdFTH
- FUNCTION SendATcmdFTH,0202H
- EXTERN SendATdataFTHCFR
- FUNCTION SendATdataFTHCFR,0202H
- EXTERN gpucQueueRear
- EXTERN gpucQueueFront
- EXTERN gdwRxQueueRearCnt
- EXTERN gdwRxQueueFrontCnt
- EXTERN CalNextPageAddress
- FUNCTION CalNextPageAddress,0202H
- EXTERN ?DivMod16u
- EXTERN ROW_ADDRESS_LOW
- EXTERN ROW_ADDRESS_HIGH
- EXTERN ERASE_ONE_BLOCK
- FUNCTION ERASE_ONE_BLOCK,0202H
- EXTERN COMMAND_VAL
- EXTERN COMMAND_LATCH_INTO
- FUNCTION COMMAND_LATCH_INTO,0202H
- EXTERN ADDRESS_VALUE
- EXTERN ADDRESS_LATCH_INTO
- FUNCTION ADDRESS_LATCH_INTO,0202H
- EXTERN READ_STATUS
- FUNCTION READ_STATUS,0202H
- EXTERN FLASH_STATUS
- EXTERN gucGeneralStatus
- EXTERN SendATcmdH0
- FUNCTION SendATcmdH0,0202H
- EXTERN SendATcmdFCLASS0
- FUNCTION SendATcmdFCLASS0,0202H
- EXTERN SendATconfigFE0EndofRX
- FUNCTION SendATconfigFE0EndofRX,0202H
- EXTERN SendATconfigS7RX
- FUNCTION SendATconfigS7RX,0202H
- EXTERN SendATconfigS0RX
- FUNCTION SendATconfigS0RX,0202H
- EXTERN gwPageAddress
- EXTERN SendATconfigFS0
- FUNCTION SendATconfigFS0,0202H
- EXTERN SendATconfigS7
- FUNCTION SendATconfigS7,0202H
- EXTERN SendATconfigX4M1
- FUNCTION SendATconfigX4M1,0202H
- EXTERN SendATcmdFCLASS
- FUNCTION SendATcmdFCLASS,0202H
- EXTERN SendATdataFTHMCF
- FUNCTION SendATdataFTHMCF,0202H
- EXTERN ?longjmp_r4
- EXTERN ?longjmp_r5
- EXTERN ?setjmp_r4
- EXTERN ?setjmp_r5
- ??FaxRXProcess_18 EQU 0
- PUBWEAK ?setjmp_save_r4
- PUBWEAK ?setjmp_save_r5
- PUBLIC FRHDncProcess
- FUNCTION FRHDncProcess,0203H
- LOCFRAME CSTACK, 2, STACK
- PUBLIC FaxRXProcess
- FUNCTION FaxRXProcess,021203H
- LOCFRAME CSTACK, 22, STACK
- PUBLIC FaxRxInit
- FUNCTION FaxRxInit,021203H
- LOCFRAME CSTACK, 2, STACK
- PUBLIC FthCsiDis
- FUNCTION FthCsiDis,021203H
- LOCFRAME CSTACK, 8, STACK
- PUBWEAK P2OUT
- PUBWEAK P5DIR
- PUBWEAK P5OUT
- PUBLIC PageImageEndProcess
- FUNCTION PageImageEndProcess,021203H
- LOCFRAME CSTACK, 6, STACK
-
- CFI Names cfiNames0
- CFI StackFrame CFA SP DATA
- CFI Resource PC:16, SP:16, SR:16, R4:16, R5:16, R6:16, R7:16, R8:16
- CFI Resource R9:16, R10:16, R11:16, R12:16, R13:16, R14:16, R15:16
- CFI EndNames cfiNames0
-
- CFI Common cfiCommon0 Using cfiNames0
- CFI CodeAlign 2
- CFI DataAlign 2
- CFI ReturnAddress PC CODE
- CFI CFA SP+2
- CFI PC Frame(CFA, -2)
- CFI SR Undefined
- CFI R4 SameValue
- CFI R5 SameValue
- CFI R6 SameValue
- CFI R7 SameValue
- CFI R8 SameValue
- CFI R9 SameValue
- CFI R10 SameValue
- CFI R11 SameValue
- CFI R12 Undefined
- CFI R13 Undefined
- CFI R14 Undefined
- CFI R15 Undefined
- CFI EndCommon cfiCommon0
-
- // E:projectFaxProgramVson_Bryan_Fax_Conexant_070423filesFaxProcess.c
- // 1
- // 2
- // 3 #include "includeH.h"
- ASEGN DATA16_AN:DATA:NOROOT,029H
- // unsigned char volatile __data P2OUT
- P2OUT:
- DS8 1
- ASEGN DATA16_AN:DATA:NOROOT,031H
- // unsigned char volatile __data P5OUT
- P5OUT:
- DS8 1
- ASEGN DATA16_AN:DATA:NOROOT,032H
- // unsigned char volatile __data P5DIR
- P5DIR:
- DS8 1
- // 4
- // 5
- // 6 //**************************************************************************
- RSEG CODE:CODE:NOROOT(1)
- // 7 void FaxRXProcess(void)
- FaxRXProcess:
- CFI Block cfiBlock0 Using cfiCommon0
- CFI Function FaxRXProcess
- // 8 {
- FUNCALL FaxRXProcess, FaxRxInit
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATcmdATA
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, Delay1500ms
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATdataFTHCSI
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATdataFTHDIS
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATcmdFRH
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATcmdSuffix
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATcmdPrefix
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATcmdSuffix
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, Delay2000ms
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, FthCsiDis
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATcmdFRH
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATcmdFRH
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATcmdFRM
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATcmdFTH
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATdataFTHCFR
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATcmdFRM
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, CalNextPageAddress
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ERASE_ONE_BLOCK
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, COMMAND_LATCH_INTO
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ADDRESS_LATCH_INTO
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ADDRESS_LATCH_INTO
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ADDRESS_LATCH_INTO
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ADDRESS_LATCH_INTO
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, PageImageEndProcess
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATcmdFRM
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, COMMAND_LATCH_INTO
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, READ_STATUS
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, CalNextPageAddress
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ERASE_ONE_BLOCK
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, COMMAND_LATCH_INTO
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ADDRESS_LATCH_INTO
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ADDRESS_LATCH_INTO
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ADDRESS_LATCH_INTO
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ADDRESS_LATCH_INTO
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATcmdFRH
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, COMMAND_LATCH_INTO
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, READ_STATUS
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, CalNextPageAddress
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ERASE_ONE_BLOCK
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, COMMAND_LATCH_INTO
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ADDRESS_LATCH_INTO
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ADDRESS_LATCH_INTO
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ADDRESS_LATCH_INTO
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ADDRESS_LATCH_INTO
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, COMMAND_LATCH_INTO
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, READ_STATUS
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATcmdH0
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATcmdH0
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATcmdFCLASS0
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATcmdPrefix
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATcmdSuffix
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATcmdPrefix
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATcmdSuffix
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATcmdPrefix
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATcmdSuffix
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATconfigFE0EndofRX
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATconfigS7RX
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, SendATconfigS0RX
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- FUNCALL FaxRXProcess, ATcmdDelay
- LOCFRAME CSTACK, 22, STACK
- PUSH.W R10
- CFI R10 Frame(CFA, -4)
- CFI CFA SP+4
- PUSH.W R11
- CFI R11 Frame(CFA, -6)
- CFI CFA SP+6
- PUSH.W R8
- CFI R8 Frame(CFA, -8)
- CFI CFA SP+8
- PUSH.W R9
- CFI R9 Frame(CFA, -10)
- CFI CFA SP+10
- PUSH.W R6
- CFI R6 Frame(CFA, -12)
- CFI CFA SP+12
- PUSH.W R7
- CFI R7 Frame(CFA, -14)
- CFI CFA SP+14
- PUSH.W R4
- CFI R4 Frame(CFA, -16)
- CFI CFA SP+16
- PUSH.W R5
- CFI R5 Frame(CFA, -18)
- CFI CFA SP+18
- SUB.W #0x4, SP
- CFI CFA SP+22
- // 9 unsigned char ucFlashSttsOverflowCnt = 0;
- MOV.B #0x0, R6
- // 10 unsigned char ucGeneralCount = 0;
- MOV.B #0x0, R4
- // 11 unsigned char ucGeneralCnt = 0;
- MOV.B #0x0, R10
- // 12 unsigned char ucRxIndex3 = 0;
- MOV.B #0x0, 0x0(SP)
- // 13 unsigned char ucRxIndex2 = 0;
- MOV.B #0x0, 0x1(SP)
- // 14 unsigned char ucRxIndex1 = 0;
- MOV.B #0x0, R11
- // 15 unsigned char ucRxIndex0 = 0;
- MOV.B #0x0, R8
- // 16
- // 17 unsigned int wNextPageAddress = 0;
- MOV.W #0x0, R5
- // 18 unsigned int wPageAddress = 0;
- MOV.W #0x0, R9
- // 19 unsigned int wGeneralCount = 0;
- MOV.W #0x0, R7
- // 20 unsigned int wDataRearCount = 0;
- MOV.W #0x0, 0x2(SP)
- // 21
- // 22 FaxRxInit();
- CALL #FaxRxInit
- // 23 /***************************************************************************/
- // 24
- // 25 //ATA
- // 26
- // 27 SendATcmdATA(); //Connect
- CALL #SendATcmdATA
- // 28
- // 29 while (1) //CONNECT(54) 0D 0A
- // 30 {
- // 31 ucRxIndex1 = gucUartRxCnt-3;//get array index
- ??FaxRXProcess_0:
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 32 ucRxIndex0 = gucUartRxCnt-2;//get array index
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R8
- // 33 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x54 == aucUartRxBuf[ucRxIndex1]))
- AND.W #0xff, R8
- CMP.B #0xd, aucUartRxBuf(R8)
- JNE ??FaxRXProcess_32
- AND.W #0xff, R11
- CMP.B #0x54, aucUartRxBuf(R11)
- JEQ ??FaxRXProcess_33
- // 34 break;
- // 35 //if check time>min. 5S, Receive Fax error, program should be quit
- // 36 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_32:
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??FaxRXProcess_34
- ADD.B #0x1, &gucTimeOverflowCount
- MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_34:
- CMP.B #0x14, &gucTimeOverflowCount
- JNE ??FaxRXProcess_0
- MOV.B #0x3, &gucFrhErrorStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- // 37
- // 38 }
- // 39
- // 40 Delay1500ms(); // delay 1.5S minimun 1 second
- ??FaxRXProcess_33:
- CALL #Delay1500ms
- // 41
- // 42 SendATdataFTHCSI(); //If the final bit is 0, the modem will generates CONNECT message.
- CALL #SendATdataFTHCSI
- // 43 while (1) //CONNECT(54) 0D 0A
- // 44 {
- // 45 ucRxIndex1 = gucUartRxCnt-3;
- ??FaxRXProcess_1:
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 46 ucRxIndex0 = gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R8
- // 47 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x54 == aucUartRxBuf[ucRxIndex1]))
- AND.W #0xff, R8
- CMP.B #0xd, aucUartRxBuf(R8)
- JNE ??FaxRXProcess_35
- AND.W #0xff, R11
- CMP.B #0x54, aucUartRxBuf(R11)
- JEQ ??FaxRXProcess_36
- // 48 break;
- // 49 //if check time>min. 5S, Receive Fax error, progra should be quit
- // 50 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_35:
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??FaxRXProcess_37
- ADD.B #0x1, &gucTimeOverflowCount
- MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_37:
- CMP.B #0x14, &gucTimeOverflowCount
- JNE ??FaxRXProcess_1
- MOV.B #0x3, &gucFrhErrorStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- // 51 }
- // 52
- // 53 for (ucGeneralCount = 0; ucGeneralCount < 50; ucGeneralCount++)// delay 1.5S minimun 1 second
- ??FaxRXProcess_36:
- MOV.B #0x0, R4
- ??FaxRXProcess_2:
- CMP.B #0x32, R4
- JC ??FaxRXProcess_38
- // 54 {
- // 55 ATcmdDelay(); //50ms
- CALL #ATcmdDelay
- // 56 }
- ADD.B #0x1, R4
- JMP ??FaxRXProcess_2
- // 57
- // 58 SendATdataFTHDIS();//SendATdataFTHTSI(sizeof (FTHDIS)); a bug of Sep.18
- ??FaxRXProcess_38:
- CALL #SendATdataFTHDIS
- // 59
- // 60 while (1) //O K 0D 0A
- // 61 {
- // 62 ucRxIndex1 = gucUartRxCnt-3;
- ??FaxRXProcess_3:
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 63 ucRxIndex0 = gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R8
- // 64 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x4B == aucUartRxBuf[ucRxIndex1])) //K ==0x4b
- AND.W #0xff, R8
- CMP.B #0xd, aucUartRxBuf(R8)
- JNE ??FaxRXProcess_39
- AND.W #0xff, R11
- CMP.B #0x4b, aucUartRxBuf(R11)
- JEQ ??FaxRXProcess_40
- // 65 break;
- // 66 //if check time>min. 5S, Receive Fax error, progra should be quit
- // 67 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_39:
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??FaxRXProcess_41
- ADD.B #0x1, &gucTimeOverflowCount
- MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_41:
- CMP.B #0x14, &gucTimeOverflowCount
- JNE ??FaxRXProcess_3
- MOV.B #0x3, &gucFrhErrorStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- // 68 }
- // 69
- // 70 //*
- // 71 //FRH TSI (transmitting subscriber identification)
- // 72 SendATcmdFRH();
- ??FaxRXProcess_40:
- CALL #SendATcmdFRH
- // 73 while (1) //Connect data.....OK 0D 0A
- // 74 {
- // 75 ucRxIndex1 = gucUartRxCnt-3;
- ??FaxRXProcess_4:
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 76 ucRxIndex0 = gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R8
- // 77 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x54 == aucUartRxBuf[ucRxIndex1])) //Connect
- MOV.B R8, R14
- AND.W #0xff, R14
- CMP.B #0xd, aucUartRxBuf(R14)
- JNE ??FaxRXProcess_42
- MOV.B R11, R14
- AND.W #0xff, R14
- CMP.B #0x54, aucUartRxBuf(R14)
- JEQ ??FaxRXProcess_43
- // 78 break;
- // 79 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x52 == aucUartRxBuf[ucRxIndex1])) //No Carrier
- ??FaxRXProcess_42:
- MOV.B R8, R14
- AND.W #0xff, R14
- CMP.B #0xd, aucUartRxBuf(R14)
- JNE ??FaxRXProcess_44
- MOV.B R11, R14
- AND.W #0xff, R14
- CMP.B #0x52, aucUartRxBuf(R14)
- 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:
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??FaxRXProcess_45
- ADD.B #0x1, &gucTimeOverflowCount
- MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_45:
- CMP.B #0x14, &gucTimeOverflowCount
- JNE ??FaxRXProcess_4
- MOV.B #0x3, &gucFrhErrorStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- // 85 }//while
- // 86
- // 87 for (ucGeneralCnt = 0;ucGeneralCnt < 5;ucGeneralCnt++)
- ??FaxRXProcess_43:
- MOV.B #0x0, R10
- ??FaxRXProcess_7:
- CMP.B #0x5, R10
- JC ??FaxRXProcess_46
- // 88 {
- // 89 if (gucFrhErrorStatus == 0x03 || (0x0d == aucUartRxBuf[ucRxIndex0]) && (0x52 == aucUartRxBuf[ucRxIndex1]))
- CMP.B #0x3, &gucFrhErrorStatus
- JEQ ??FaxRXProcess_47
- MOV.B R8, R14
- AND.W #0xff, R14
- CMP.B #0xd, aucUartRxBuf(R14)
- JNE ??FaxRXProcess_48
- MOV.B R11, R14
- AND.W #0xff, R14
- CMP.B #0x52, aucUartRxBuf(R14)
- JNE ??FaxRXProcess_48
- // 90 {
- // 91 SendATcmdSuffix();
- ??FaxRXProcess_47:
- CALL #SendATcmdSuffix
- // 92 ATcmdDelay();
- CALL #ATcmdDelay
- // 93 ATcmdDelay();
- CALL #ATcmdDelay
- // 94 ATcmdDelay();
- CALL #ATcmdDelay
- // 95 SendATcmdPrefix();
- CALL #SendATcmdPrefix
- // 96 ATcmdDelay();
- CALL #ATcmdDelay
- // 97 SendATcmdSuffix();
- CALL #SendATcmdSuffix
- // 98 ATcmdDelay();
- CALL #ATcmdDelay
- // 99 ATcmdDelay();
- CALL #ATcmdDelay
- // 100 ATcmdDelay();
- CALL #ATcmdDelay
- // 101 Delay2000ms();//add at Jan. 16, 2007
- CALL #Delay2000ms
- // 102 FthCsiDis();
- CALL #FthCsiDis
- // 103 SendATcmdFRH();
- CALL #SendATcmdFRH
- // 104 while (1) //Connect data.....OK 0D 0A
- // 105 {
- // 106 ucRxIndex1 = gucUartRxCnt-3;
- ??FaxRXProcess_5:
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 107 ucRxIndex0 = gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R8
- // 108 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x54 == aucUartRxBuf[ucRxIndex1]))
- MOV.B R8, R14
- AND.W #0xff, R14
- CMP.B #0xd, aucUartRxBuf(R14)
- JNE ??FaxRXProcess_49
- MOV.B R11, R14
- AND.W #0xff, R14
- CMP.B #0x54, aucUartRxBuf(R14)
- JEQ ??FaxRXProcess_48
- // 109 break;
- // 110 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x52 == aucUartRxBuf[ucRxIndex1]))
- ??FaxRXProcess_49:
- MOV.B R8, R14
- AND.W #0xff, R14
- CMP.B #0xd, aucUartRxBuf(R14)
- JNE ??FaxRXProcess_50
- MOV.B R11, R14
- AND.W #0xff, R14
- CMP.B #0x52, aucUartRxBuf(R14)
- JEQ ??FaxRXProcess_48
- // 111 break;
- // 112 //if check time>min. 5S, Receive Fax error, progra should be quit
- // 113 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_50:
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??FaxRXProcess_51
- ADD.B #0x1, &gucTimeOverflowCount
- MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_51:
- CMP.B #0x14, &gucTimeOverflowCount
- JNE ??FaxRXProcess_5
- MOV.B #0x3, &gucFrhErrorStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- // 114 }//while
- // 115 }//if
- // 116 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x54 == aucUartRxBuf[ucRxIndex1]))
- ??FaxRXProcess_48:
- MOV.B R8, R14
- AND.W #0xff, R14
- CMP.B #0xd, aucUartRxBuf(R14)
- JNE ??FaxRXProcess_52
- MOV.B R11, R14
- AND.W #0xff, R14
- CMP.B #0x54, aucUartRxBuf(R14)
- JNE ??FaxRXProcess_52
- // 117 {
- // 118 while (1)
- // 119 {
- // 120 ucRxIndex1 = gucUartRxCnt-3;
- ??FaxRXProcess_6:
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 121 ucRxIndex0 = gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R8
- // 122 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x4B == aucUartRxBuf[ucRxIndex1]))
- MOV.B R8, R14
- AND.W #0xff, R14
- CMP.B #0xd, aucUartRxBuf(R14)
- JNE ??FaxRXProcess_53
- MOV.B R11, R14
- AND.W #0xff, R14
- CMP.B #0x4b, aucUartRxBuf(R14)
- JEQ ??FaxRXProcess_54
- // 123 break;
- // 124 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x52 == aucUartRxBuf[ucRxIndex1]))
- ??FaxRXProcess_53:
- MOV.B R8, R14
- AND.W #0xff, R14
- CMP.B #0xd, aucUartRxBuf(R14)
- JNE ??FaxRXProcess_55
- MOV.B R11, R14
- AND.W #0xff, R14
- CMP.B #0x52, aucUartRxBuf(R14)
- JEQ ??FaxRXProcess_54
- // 125 break;
- // 126 if ((0x13 == aucUartRxBuf[ucRxIndex0]) && (0xff == aucUartRxBuf[ucRxIndex1]))
- ??FaxRXProcess_55:
- MOV.B R8, R14
- AND.W #0xff, R14
- CMP.B #0x13, aucUartRxBuf(R14)
- JNE ??FaxRXProcess_56
- MOV.B R11, R14
- AND.W #0xff, R14
- CMP.B #0xff, aucUartRxBuf(R14)
- JNE ??FaxRXProcess_56
- // 127 {gucFrhErrorStatus=CNGFthOnlySendOneNSF;}
- MOV.B #0x1, &gucFrhErrorStatus
- // 128 //if check time>min. 5S, Receive Fax error, progra should be quit
- // 129 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_56:
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??FaxRXProcess_57
- ADD.B #0x1, &gucTimeOverflowCount
- MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_57:
- CMP.B #0x14, &gucTimeOverflowCount
- JNE ??FaxRXProcess_6
- MOV.B #0x3, &gucFrhErrorStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- // 130 }//while
- // 131 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x52 == aucUartRxBuf[ucRxIndex1]))
- ??FaxRXProcess_54:
- MOV.B R8, R14
- AND.W #0xff, R14
- CMP.B #0xd, aucUartRxBuf(R14)
- JNE ??FaxRXProcess_46
- MOV.B R11, R14
- AND.W #0xff, R14
- CMP.B #0x52, aucUartRxBuf(R14)
- 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:
- ADD.B #0x1, R10
- JMP ??FaxRXProcess_7
- // 137 ucRxIndex0 = gucUartRxCnt-25;
- ??FaxRXProcess_46:
- MOV.B #0xe7, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R8
- // 138 for (ucGeneralCnt = 0;ucGeneralCnt < 25;ucGeneralCnt++)
- MOV.B #0x0, R10
- ??FaxRXProcess_8:
- CMP.B #0x19, R10
- JC ??FaxRXProcess_58
- // 139 {FRHTSI[ucRxIndex1++] = aucUartRxBuf[ucRxIndex0++];}
- MOV.B R11, R15
- AND.W #0xff, R15
- MOV.B R8, R14
- AND.W #0xff, R14
- MOV.B aucUartRxBuf(R14), FRHTSI(R15)
- ADD.B #0x1, R8
- ADD.B #0x1, R11
- ADD.B #0x1, R10
- JMP ??FaxRXProcess_8
- // 140
- // 141 //FRH DCS (digital command signal)
- // 142 if (gucFrhErrorStatus != CNGFthOnlySendOneNSF)
- ??FaxRXProcess_58:
- CMP.B #0x1, &gucFrhErrorStatus
- JEQ ??FaxRXProcess_59
- // 143 {
- // 144 SendATcmdFRH();
- CALL #SendATcmdFRH
- // 145 while (1)
- // 146 {
- // 147 ucRxIndex1 = gucUartRxCnt-3;
- ??FaxRXProcess_9:
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 148 ucRxIndex0 = gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R8
- // 149 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x54 == aucUartRxBuf[ucRxIndex1]))
- AND.W #0xff, R8
- CMP.B #0xd, aucUartRxBuf(R8)
- JNE ??FaxRXProcess_60
- AND.W #0xff, R11
- CMP.B #0x54, aucUartRxBuf(R11)
- JEQ ??FaxRXProcess_61
- // 150 break;
- // 151 //if check time>min. 5S, Receive Fax error, progra should be quit
- // 152 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_60:
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??FaxRXProcess_62
- ADD.B #0x1, &gucTimeOverflowCount
- MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_62:
- CMP.B #0x14, &gucTimeOverflowCount
- JNE ??FaxRXProcess_9
- MOV.B #0x3, &gucFrhErrorStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- // 153 }//while
- // 154 if (gucFrhErrorStatus == 0x03) return; //add at Mar. 16, 2007.
- ??FaxRXProcess_61:
- CMP.B #0x3, &gucFrhErrorStatus
- JNE $+6
- BR #??FaxRXProcess_63
- // 155
- // 156 while (1)
- // 157 {
- // 158 ucRxIndex1 = gucUartRxCnt-3;
- ??FaxRXProcess_10:
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 159 ucRxIndex0 = gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R8
- // 160 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x4B == aucUartRxBuf[ucRxIndex1]))
- AND.W #0xff, R8
- CMP.B #0xd, aucUartRxBuf(R8)
- JNE ??FaxRXProcess_64
- AND.W #0xff, R11
- CMP.B #0x4b, aucUartRxBuf(R11)
- JEQ ??FaxRXProcess_65
- // 161 break;
- // 162 //if check time>min. 5S, Receive Fax error, progra should be quit
- // 163 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_64:
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??FaxRXProcess_66
- ADD.B #0x1, &gucTimeOverflowCount
- MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_66:
- CMP.B #0x14, &gucTimeOverflowCount
- JNE ??FaxRXProcess_10
- MOV.B #0x3, &gucFrhErrorStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- // 164 }//while
- // 165 if (gucFrhErrorStatus == 0x03) return; //add at Mar. 16, 2007.
- ??FaxRXProcess_65:
- CMP.B #0x3, &gucFrhErrorStatus
- JNE $+6
- 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:
- CALL #SendATcmdFRM
- // 175
- // 176 while (1)
- // 177 {
- // 178 ucRxIndex1 = gucUartRxCnt-3;
- ??FaxRXProcess_11:
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 179 ucRxIndex0 = gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R8
- // 180 if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x54 == aucUartRxBuf[ucRxIndex1]))
- AND.W #0xff, R8
- CMP.B #0xd, aucUartRxBuf(R8)
- JNE ??FaxRXProcess_67
- AND.W #0xff, R11
- CMP.B #0x54, aucUartRxBuf(R11)
- JEQ ??FaxRXProcess_68
- // 181 break;
- // 182 //if check time>min. 5S, Receive Fax error, progra should be quit
- // 183 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_67:
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??FaxRXProcess_69
- ADD.B #0x1, &gucTimeOverflowCount
- MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_69:
- CMP.B #0x14, &gucTimeOverflowCount
- JNE ??FaxRXProcess_11
- MOV.B #0x3, &gucFrhErrorStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- // 184 }
- // 185 if (gucFrhErrorStatus == 0x03) return;
- ??FaxRXProcess_68:
- CMP.B #0x3, &gucFrhErrorStatus
- JNE $+6
- 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:
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 191 ucRxIndex0 = gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R8
- // 192 if ((aucUartRxBuf[ucRxIndex0] == 0x0d)&&(aucUartRxBuf[ucRxIndex1] == 0x52))//4B Result code is not OK, but No carrier
- AND.W #0xff, R8
- CMP.B #0xd, aucUartRxBuf(R8)
- JNE ??FaxRXProcess_70
- AND.W #0xff, R11
- CMP.B #0x52, aucUartRxBuf(R11)
- JEQ ??FaxRXProcess_71
- // 193 break;
- // 194 //if check time>min. 5S, Receive Fax error, progra should be quit
- // 195 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_70:
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??FaxRXProcess_72
- ADD.B #0x1, &gucTimeOverflowCount
- MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_72:
- CMP.B #0x14, &gucTimeOverflowCount
- JNE ??FaxRXProcess_12
- MOV.B #0x3, &gucFrhErrorStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- // 196 }
- // 197 if (gucFrhErrorStatus == 0x03) return;
- ??FaxRXProcess_71:
- CMP.B #0x3, &gucFrhErrorStatus
- JNE $+6
- BR #??FaxRXProcess_63
- // 198 //*/
- // 199 //Training check over
- // 200 //FTHCFR (confirmation to receive)
- // 201 SendATcmdFTH();
- CALL #SendATcmdFTH
- // 202 while (1) //Connect
- // 203 {
- // 204 ucRxIndex1=gucUartRxCnt-3;
- ??FaxRXProcess_13:
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 205 ucRxIndex0=gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R8
- // 206 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x54==aucUartRxBuf[ucRxIndex1]))
- AND.W #0xff, R8
- CMP.B #0xd, aucUartRxBuf(R8)
- JNE ??FaxRXProcess_73
- AND.W #0xff, R11
- CMP.B #0x54, aucUartRxBuf(R11)
- JEQ ??FaxRXProcess_74
- // 207 break;
- // 208 //if check time>min. 5S, Receive Fax error, progra should be quit
- // 209 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_73:
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??FaxRXProcess_75
- ADD.B #0x1, &gucTimeOverflowCount
- MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_75:
- CMP.B #0x14, &gucTimeOverflowCount
- JNE ??FaxRXProcess_13
- MOV.B #0x3, &gucFrhErrorStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- // 210 }
- // 211 if (gucFrhErrorStatus==0x03) return;
- ??FaxRXProcess_74:
- CMP.B #0x3, &gucFrhErrorStatus
- JNE $+6
- BR #??FaxRXProcess_63
- // 212
- // 213 for (ucGeneralCount=0; ucGeneralCount<30; ucGeneralCount++)// delay 1.5S minimun 1 second
- MOV.B #0x0, R4
- ??FaxRXProcess_14:
- CMP.B #0x1e, R4
- JC ??FaxRXProcess_76
- // 214 {
- // 215 ATcmdDelay(); //50ms
- CALL #ATcmdDelay
- // 216 }
- ADD.B #0x1, R4
- JMP ??FaxRXProcess_14
- // 217
- // 218 SendATdataFTHCFR();
- ??FaxRXProcess_76:
- CALL #SendATdataFTHCFR
- // 219
- // 220 while (1)
- // 221 {
- // 222 ucRxIndex1=gucUartRxCnt-3;
- ??FaxRXProcess_15:
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 223 ucRxIndex0=gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R8
- // 224 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
- AND.W #0xff, R8
- CMP.B #0xd, aucUartRxBuf(R8)
- JNE ??FaxRXProcess_77
- AND.W #0xff, R11
- CMP.B #0x4b, aucUartRxBuf(R11)
- JEQ ??FaxRXProcess_78
- // 225 break;
- // 226 //if check time>min. 5S, Receive Fax error, progra should be quit
- // 227 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_77:
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??FaxRXProcess_79
- ADD.B #0x1, &gucTimeOverflowCount
- MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_79:
- CMP.B #0x14, &gucTimeOverflowCount
- JNE ??FaxRXProcess_15
- MOV.B #0x3, &gucFrhErrorStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- // 228 }
- // 229 if (gucFrhErrorStatus==0x03) return;
- ??FaxRXProcess_78:
- CMP.B #0x3, &gucFrhErrorStatus
- JNE $+6
- BR #??FaxRXProcess_63
- // 230
- // 231
- // 232
- // 233 //FRM pageimage
- // 234 //SendATcmdFRM146();
- // 235 SendATcmdFRM();
- CALL #SendATcmdFRM
- // 236
- // 237 wGeneralCount=0;//63;
- MOV.W #0x0, R7
- // 238 ucGeneralCnt=0;//28;
- MOV.B #0x0, R10
- // 239 //wPageAddress=0;
- // 240 gucFrhErrorStatus=0;
- MOV.B #0x0, &gucFrhErrorStatus
- // 241 gucUartRxCnt=0;
- MOV.B #0x0, &gucUartRxCnt
- // 242 gpucQueueRear=0;
- MOV.B #0x0, &gpucQueueRear
- // 243 gpucQueueFront=0;
- MOV.B #0x0, &gpucQueueFront
- // 244 gdwRxQueueRearCnt=0;
- MOV.W #0x0, &gdwRxQueueRearCnt
- MOV.W #0x0, &gdwRxQueueRearCnt + 0x2
- // 245 gdwRxQueueFrontCnt=0;
- MOV.W #0x0, &gdwRxQueueFrontCnt
- MOV.W #0x0, &gdwRxQueueFrontCnt + 0x2
- // 246 //ZERO_ADDRESS();
- // 247
- // 248 wPageAddress=cstFaxRxBufStartPage;//+1;//Block 19 Modify at Jan. 6, 2007
- MOV.W #0x4c0, R9
- // 249
- // 250 do{
- // 251 wNextPageAddress=wPageAddress+64;
- ??FaxRXProcess_16:
- MOV.W #0x40, R14
- ADD.W R9, R14
- MOV.W R14, R5
- // 252 wPageAddress=CalNextPageAddress(wPageAddress);
- MOV.W R9, R12
- CALL #CalNextPageAddress
- MOV.W R12, R9
- // 253 }while(wNextPageAddress==wPageAddress);
- CMP.W R9, R5
- JEQ ??FaxRXProcess_16
- // 254 //erase next block
- // 255 if (wPageAddress%64==0)
- MOV.W R9, R12
- MOV.W #0x40, R14
- CALL #?DivMod16u
- CMP.W #0x0, R14
- JNE ??FaxRXProcess_80
- // 256 {
- // 257 ROW_ADDRESS_LOW=wPageAddress & 0XFF;
- MOV.B R9, &ROW_ADDRESS_LOW
- // 258 ROW_ADDRESS_HIGH=(wPageAddress>>8) & 0XFF;
- MOV.W R9, R14
- SWPB R14
- AND.W #0xff, R14
- MOV.B R14, &ROW_ADDRESS_HIGH
- // 259 ERASE_ONE_BLOCK();
- CALL #ERASE_ONE_BLOCK
- // 260 }
- // 261 wPageAddress=cstFaxRxBufStartPage+1;
- ??FaxRXProcess_80:
- MOV.W #0x4c1, R9
- // 262 //COMMAND
- // 263 //Flash_Reset();
- // 264 COMMAND_VAL=0X80;
- MOV.B #0x80, &COMMAND_VAL
- // 265 COMMAND_LATCH_INTO();
- CALL #COMMAND_LATCH_INTO
- // 266
- // 267 //ADDRESS
- // 268 ADDRESS_VALUE=0;//COLUMN_ADDRESS_HIGH; //#0X00
- MOV.B #0x0, &ADDRESS_VALUE
- // 269 ADDRESS_LATCH_INTO();
- CALL #ADDRESS_LATCH_INTO
- // 270
- // 271 ADDRESS_VALUE=0;//COLUMN_ADDRESS_HIGH; //#0X00
- MOV.B #0x0, &ADDRESS_VALUE
- // 272 ADDRESS_LATCH_INTO();
- CALL #ADDRESS_LATCH_INTO
- // 273
- // 274 ADDRESS_VALUE=wPageAddress & 0xff; //#0X00
- MOV.B R9, &ADDRESS_VALUE
- // 275 ADDRESS_LATCH_INTO();
- CALL #ADDRESS_LATCH_INTO
- // 276
- // 277 ADDRESS_VALUE=(wPageAddress>>8) & 0xff; //#0X00
- MOV.W R9, R14
- SWPB R14
- AND.W #0xff, R14
- MOV.B R14, &ADDRESS_VALUE
- // 278 ADDRESS_LATCH_INTO();
- CALL #ADDRESS_LATCH_INTO
- // 279
- // 280 FLASH_CON_PORT_OUT &=~ ALE;
- 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
- 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:
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??FaxRXProcess_81
- ADD.B #0x1, &gucTimeOverflowCount
- MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_81:
- CMP.B #0x14, &gucTimeOverflowCount
- JNE ??FaxRXProcess_82
- MOV.B #0x3, &gucFrhErrorStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- JMP ??FaxRXProcess_83
- // 292 ucRxIndex1=gucUartRxCnt-3;
- ??FaxRXProcess_82:
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 293 ucRxIndex0=gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R8
- // 294 if ((aucUartRxBuf[ucRxIndex0]==0x0d)&&(aucUartRxBuf[ucRxIndex1]==0x52))//4B Result code is not OK, but No carrier
- AND.W #0xff, R8
- CMP.B #0xd, aucUartRxBuf(R8)
- JNE ??FaxRXProcess_84
- AND.W #0xff, R11
- CMP.B #0x52, aucUartRxBuf(R11)
- JNE ??FaxRXProcess_84
- // 295 {
- // 296
- // 297 PageImageEndProcess();
- CALL #PageImageEndProcess
- // 298
- // 299 if (gucFrhErrorStatus==0x03) break; //add at Mar. 16, 2007.
- CMP.B #0x3, &gucFrhErrorStatus
- JEQ ??FaxRXProcess_83
- // 300
- // 301 //More than two pages process //add at Dec.27,2006
- // 302 ucRxIndex3=gucUartRxCnt-38;
- MOV.B #0xda, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, 0x0(SP)
- // 303 ucRxIndex2=gucUartRxCnt-37;
- MOV.B #0xdb, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, 0x1(SP)
- // 304 ucRxIndex1=gucUartRxCnt-36;
- MOV.B #0xdc, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 305 ucRxIndex0=gucUartRxCnt-35;
- MOV.B #0xdd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R8
- // 306 if ((aucUartRxBuf[ucRxIndex0]==0x05)&&(aucUartRxBuf[ucRxIndex1]==0x35)&&
- // 307 (aucUartRxBuf[ucRxIndex2]==0x4f)&&(aucUartRxBuf[ucRxIndex3]==0x13))
- MOV.B R8, R14
- AND.W #0xff, R14
- CMP.B #0x5, aucUartRxBuf(R14)
- JNE ??FaxRXProcess_85
- MOV.B R11, R14
- AND.W #0xff, R14
- CMP.B #0x35, aucUartRxBuf(R14)
- JNE ??FaxRXProcess_85
- MOV.B 0x1(SP), R14
- AND.W #0xff, R14
- CMP.B #0x4f, aucUartRxBuf(R14)
- JNE ??FaxRXProcess_85
- MOV.B 0x0(SP), R14
- AND.W #0xff, R14
- CMP.B #0x13, aucUartRxBuf(R14)
- JNE ??FaxRXProcess_85
- // 308 {
- // 309 SendATcmdFRM();
- 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:
- MOV.B R8, R14
- AND.W #0xff, R14
- CMP.B #0x66, aucUartRxBuf(R14)
- JNE ??FaxRXProcess_86
- MOV.B R11, R14
- AND.W #0xff, R14
- CMP.B #0x33, aucUartRxBuf(R14)
- JNE ??FaxRXProcess_86
- MOV.B 0x1(SP), R14
- AND.W #0xff, R14
- CMP.B #0x2f, aucUartRxBuf(R14)
- JNE ??FaxRXProcess_86
- MOV.B 0x0(SP), R14
- AND.W #0xff, R14
- CMP.B #0x13, aucUartRxBuf(R14)
- JEQ ??FaxRXProcess_83
- // 314 {
- // 315 break;
- // 316 }
- // 317 // one page over flag
- // 318 if ((aucUartRxBuf[ucRxIndex0]==0x2f)&&(aucUartRxBuf[ucRxIndex1]==0x13))
- ??FaxRXProcess_86:
- AND.W #0xff, R8
- CMP.B #0x2f, aucUartRxBuf(R8)
- JNE ??FaxRXProcess_84
- AND.W #0xff, R11
- CMP.B #0x13, aucUartRxBuf(R11)
- JEQ ??FaxRXProcess_83
- // 319 {
- // 320 break;
- // 321 }
- // 322 }
- // 323
- // 324 if (gdwRxQueueRearCnt-gdwRxQueueFrontCnt>32)
- ??FaxRXProcess_84:
- MOV.W &gdwRxQueueRearCnt, R14
- MOV.W &gdwRxQueueRearCnt + 0x2, R15
- SUB.W &gdwRxQueueFrontCnt, R14
- SUBC.W &gdwRxQueueFrontCnt + 0x2, R15
- CMP.W #0x0, R15
- JNC ??FaxRXProcess_17
- JNE ??FaxRXProcess_87
- CMP.W #0x21, R14
- JNC ??FaxRXProcess_17
- // 325 {
- // 326 if (gdwRxQueueRearCnt-gdwRxQueueFrontCnt>254) // if data num is more than the buffer space, error happan.
- ??FaxRXProcess_87:
- MOV.W &gdwRxQueueRearCnt, R14
- MOV.W &gdwRxQueueRearCnt + 0x2, R15
- SUB.W &gdwRxQueueFrontCnt, R14
- SUBC.W &gdwRxQueueFrontCnt + 0x2, R15
- CMP.W #0x0, R15
- JNC ??FaxRXProcess_88
- JNE ??FaxRXProcess_31
- CMP.W #0xff, R14
- JNC ??FaxRXProcess_88
- // 327 {
- // 328 while (1);//gucGeneralStatus |= FAXRXERROR;
- ??FaxRXProcess_31:
- JMP ??FaxRXProcess_31
- // 329 }
- // 330 if (wGeneralCount++<64) // 32*64=2048
- ??FaxRXProcess_88:
- MOV.W R7, R14
- MOV.W #0x1, R7
- ADD.W R14, R7
- CMP.W #0x40, R14
- JC ??FaxRXProcess_89
- // 331 {
- // 332 for (ucGeneralCnt=0;ucGeneralCnt<32;ucGeneralCnt++)
- MOV.B #0x0, R10
- ??FaxRXProcess_19:
- CMP.B #0x20, R10
- JC ??FaxRXProcess_17
- // 333 {
- // 334 FLASH_CON_PORT_OUT&=~WE;
- BIC.B #0x1, &0x29
- // 335 DATA_PORT_OUT=aucUartRxBuf[gpucQueueFront++];
- MOV.B &gpucQueueFront, R14
- AND.W #0xff, R14
- MOV.B aucUartRxBuf(R14), &0x31
- ADD.B #0x1, &gpucQueueFront
- // 336 gdwRxQueueFrontCnt++; //The total num that is writed to flash
- ADD.W #0x1, &gdwRxQueueFrontCnt
- ADDC.W #0x0, &gdwRxQueueFrontCnt + 0x2
- // 337 FLASH_CON_PORT_OUT |= WE;
- BIS.B #0x1, &0x29
- // 338 }
- ADD.B #0x1, R10
- JMP ??FaxRXProcess_19
- // 339 //ucGeneralCnt=0;
- // 340 }
- // 341 else
- // 342 {
- // 343 wGeneralCount=0;
- ??FaxRXProcess_89:
- MOV.W #0x0, R7
- // 344
- // 345 COMMAND_VAL=0X10; //10H INITIATES PROGRAM
- MOV.B #0x10, &COMMAND_VAL
- // 346 COMMAND_LATCH_INTO();
- CALL #COMMAND_LATCH_INTO
- // 347
- // 348 READ_STATUS();
- CALL #READ_STATUS
- // 349 ucFlashSttsOverflowCnt=0;
- MOV.B #0x0, R6
- // 350 while (FLASH_STATUS==1&&(ucFlashSttsOverflowCnt++)<2)
- ??FaxRXProcess_20:
- CMP.B #0x1, &FLASH_STATUS
- JNE ??FaxRXProcess_90
- MOV.B R6, R14
- MOV.B #0x1, R6
- ADD.B R14, R6
- CMP.B #0x2, R14
- 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:
- CMP.W #0x9ff, R9
- JC ??FaxRXProcess_21
- ADD.W #0x1, R9
- // 356 do{
- // 357 wNextPageAddress=wPageAddress+64;
- ??FaxRXProcess_21:
- MOV.W #0x40, R14
- ADD.W R9, R14
- MOV.W R14, R5
- // 358 wPageAddress=CalNextPageAddress(wPageAddress);
- MOV.W R9, R12
- CALL #CalNextPageAddress
- MOV.W R12, R9
- // 359 }while(wNextPageAddress==wPageAddress);
- CMP.W R9, R5
- JEQ ??FaxRXProcess_21
- // 360 if (wPageAddress%64==0)
- MOV.W R9, R12
- MOV.W #0x40, R14
- CALL #?DivMod16u
- CMP.W #0x0, R14
- JNE ??FaxRXProcess_91
- // 361 {
- // 362 ROW_ADDRESS_LOW=wPageAddress & 0XFF;
- MOV.B R9, &ROW_ADDRESS_LOW
- // 363 ROW_ADDRESS_HIGH=(wPageAddress>>8) & 0XFF;
- MOV.W R9, R14
- SWPB R14
- AND.W #0xff, R14
- MOV.B R14, &ROW_ADDRESS_HIGH
- // 364 ERASE_ONE_BLOCK();
- CALL #ERASE_ONE_BLOCK
- // 365 }
- // 366 //Flash_Reset();
- // 367 COMMAND_VAL=0X80;
- ??FaxRXProcess_91:
- MOV.B #0x80, &COMMAND_VAL
- // 368 COMMAND_LATCH_INTO();
- CALL #COMMAND_LATCH_INTO
- // 369
- // 370 //ADDRESS
- // 371 ADDRESS_VALUE=0;//COLUMN_ADDRESS_HIGH; //#0X00
- MOV.B #0x0, &ADDRESS_VALUE
- // 372 ADDRESS_LATCH_INTO();
- CALL #ADDRESS_LATCH_INTO
- // 373
- // 374 ADDRESS_VALUE=0;//COLUMN_ADDRESS_HIGH; //#0X00
- MOV.B #0x0, &ADDRESS_VALUE
- // 375 ADDRESS_LATCH_INTO();
- CALL #ADDRESS_LATCH_INTO
- // 376
- // 377 ADDRESS_VALUE=wPageAddress & 0xff; //#0X00
- MOV.B R9, &ADDRESS_VALUE
- // 378 ADDRESS_LATCH_INTO();
- CALL #ADDRESS_LATCH_INTO
- // 379
- // 380 ADDRESS_VALUE=(wPageAddress>>8) & 0xff; //#0X00
- MOV.W R9, R14
- SWPB R14
- AND.W #0xff, R14
- MOV.B R14, &ADDRESS_VALUE
- // 381 ADDRESS_LATCH_INTO();
- CALL #ADDRESS_LATCH_INTO
- // 382
- // 383 FLASH_CON_PORT_OUT &=~ ALE;
- 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
- MOV.B #0xff, &0x32
- JMP ??FaxRXProcess_17
- // 387
- // 388 }//else
- // 389 }//if
- // 390 }//while
- // 391
- // 392 if (gucFrhErrorStatus==0x03) return; //add at Mar. 16, 2007.
- ??FaxRXProcess_83:
- CMP.B #0x3, &gucFrhErrorStatus
- JEQ ??FaxRXProcess_63
- // 393
- // 394
- // 395 //FRH DNC (disconnect) //Modity at Dec. 28,2006. DNC is the over flag
- // 396 SendATcmdFRH();
- CALL #SendATcmdFRH
- // 397
- // 398 while (1)
- // 399 {
- // 400 ucRxIndex1=gucUartRxCnt-3;
- ??FaxRXProcess_22:
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 401 ucRxIndex0=gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R8
- // 402 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x54==aucUartRxBuf[ucRxIndex1]))
- AND.W #0xff, R8
- CMP.B #0xd, aucUartRxBuf(R8)
- JNE ??FaxRXProcess_92
- AND.W #0xff, R11
- CMP.B #0x54, aucUartRxBuf(R11)
- JEQ ??FaxRXProcess_93
- // 403 break;
- // 404 //if check time>min. 5S, Receive Fax error, progra should be quit
- // 405 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_92:
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??FaxRXProcess_94
- ADD.B #0x1, &gucTimeOverflowCount
- MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_94:
- CMP.B #0x14, &gucTimeOverflowCount
- JNE ??FaxRXProcess_22
- MOV.B #0x3, &gucFrhErrorStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- // 406 }
- // 407
- // 408 if (gucFrhErrorStatus==0x03) return; //add at Mar. 16, 2007.
- ??FaxRXProcess_93:
- CMP.B #0x3, &gucFrhErrorStatus
- JEQ ??FaxRXProcess_63
- // 409
- // 410 while (1)
- // 411 {
- // 412 ucRxIndex1=gucUartRxCnt-3;
- ??FaxRXProcess_23:
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 413 ucRxIndex0=gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R8
- // 414 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
- AND.W #0xff, R8
- CMP.B #0xd, aucUartRxBuf(R8)
- JNE ??FaxRXProcess_95
- AND.W #0xff, R11
- CMP.B #0x4b, aucUartRxBuf(R11)
- JEQ ??FaxRXProcess_96
- // 415 break;
- // 416 //if check time>min. 5S, Receive Fax error, progra should be quit
- // 417 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_95:
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??FaxRXProcess_97
- ADD.B #0x1, &gucTimeOverflowCount
- MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_97:
- CMP.B #0x14, &gucTimeOverflowCount
- JNE ??FaxRXProcess_23
- MOV.B #0x3, &gucFrhErrorStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- // 418 }
- // 419
- // 420 if (gucFrhErrorStatus==0x03) return; //add at Mar. 16, 2007.
- ??FaxRXProcess_96:
- CMP.B #0x3, &gucFrhErrorStatus
- JEQ ??FaxRXProcess_63
- // 421
- // 422 //FaxRearDataProcess
- // 423 while (gdwRxQueueRearCnt-gdwRxQueueFrontCnt>=32)
- ??FaxRXProcess_24:
- MOV.W &gdwRxQueueRearCnt, R14
- MOV.W &gdwRxQueueRearCnt + 0x2, R15
- SUB.W &gdwRxQueueFrontCnt, R14
- SUBC.W &gdwRxQueueFrontCnt + 0x2, R15
- CMP.W #0x0, R15
- JNC ??FaxRXProcess_98
- JNE ??FaxRXProcess_99
- CMP.W #0x20, R14
- JNC ??FaxRXProcess_98
- // 424 {
- // 425 if (gdwRxQueueRearCnt-gdwRxQueueFrontCnt>254) // if data num is more than the buffer space, error happan.
- ??FaxRXProcess_99:
- MOV.W &gdwRxQueueRearCnt, R14
- MOV.W &gdwRxQueueRearCnt + 0x2, R15
- SUB.W &gdwRxQueueFrontCnt, R14
- SUBC.W &gdwRxQueueFrontCnt + 0x2, R15
- CMP.W #0x0, R15
- JNC ??FaxRXProcess_100
- JNE ??FaxRXProcess_101
- CMP.W #0xff, R14
- JNC ??FaxRXProcess_100
- // 426 {
- // 427 gucGeneralStatus |= FAXRXERROR;
- ??FaxRXProcess_101:
- BIS.B #0x1, &gucGeneralStatus
- // 428 }
- // 429 if (wGeneralCount++<64) // 32*64=2048
- ??FaxRXProcess_100:
- MOV.W R7, R14
- MOV.W #0x1, R7
- ADD.W R14, R7
- CMP.W #0x40, R14
- JC ??FaxRXProcess_102
- // 430 {
- // 431 for (ucGeneralCnt=0;ucGeneralCnt<32;ucGeneralCnt++)
- MOV.B #0x0, R10
- ??FaxRXProcess_25:
- CMP.B #0x20, R10
- JC ??FaxRXProcess_24
- // 432 {
- // 433 FLASH_CON_PORT_OUT&=~WE;
- BIC.B #0x1, &0x29
- // 434 DATA_PORT_OUT=aucUartRxBuf[gpucQueueFront++];
- MOV.B &gpucQueueFront, R14
- AND.W #0xff, R14
- MOV.B aucUartRxBuf(R14), &0x31
- ADD.B #0x1, &gpucQueueFront
- // 435 gdwRxQueueFrontCnt++; //The total num that is writed to flash
- ADD.W #0x1, &gdwRxQueueFrontCnt
- ADDC.W #0x0, &gdwRxQueueFrontCnt + 0x2
- // 436 FLASH_CON_PORT_OUT |= WE;
- BIS.B #0x1, &0x29
- // 437 }
- ADD.B #0x1, R10
- JMP ??FaxRXProcess_25
- // 438 }
- // 439 else
- // 440 {
- // 441 wGeneralCount=0;
- ??FaxRXProcess_102:
- MOV.W #0x0, R7
- // 442
- // 443 COMMAND_VAL=0X10; //10H INITIATES PROGRAM
- MOV.B #0x10, &COMMAND_VAL
- // 444 COMMAND_LATCH_INTO();
- CALL #COMMAND_LATCH_INTO
- // 445
- // 446 READ_STATUS();
- CALL #READ_STATUS
- // 447 ucFlashSttsOverflowCnt=0;
- MOV.B #0x0, R6
- // 448 while (FLASH_STATUS==1&&(ucFlashSttsOverflowCnt++)<2)
- ??FaxRXProcess_26:
- CMP.B #0x1, &FLASH_STATUS
- JNE ??FaxRXProcess_103
- MOV.B R6, R14
- MOV.B #0x1, R6
- ADD.B R14, R6
- CMP.B #0x2, R14
- JNC ??FaxRXProcess_26
- // 449 {
- // 450 ;//ERASE_ONE_BLOCK();
- // 451 //PROGRAM_ONE_PAGE();
- // 452 }
- // 453 if (wPageAddress<2559) wPageAddress++;//add at Jan. 18, 2007
- ??FaxRXProcess_103:
- CMP.W #0x9ff, R9
- JC ??FaxRXProcess_27
- ADD.W #0x1, R9
- // 454 do{
- // 455 wNextPageAddress=wPageAddress+64;
- ??FaxRXProcess_27:
- MOV.W #0x40, R14
- ADD.W R9, R14
- MOV.W R14, R5
- // 456 wPageAddress=CalNextPageAddress(wPageAddress);
- MOV.W R9, R12
- CALL #CalNextPageAddress
- MOV.W R12, R9
- // 457 }while(wNextPageAddress==wPageAddress);
- CMP.W R9, R5
- JEQ ??FaxRXProcess_27
- // 458 if (wPageAddress%64==0)
- MOV.W R9, R12
- MOV.W #0x40, R14
- CALL #?DivMod16u
- CMP.W #0x0, R14
- JNE ??FaxRXProcess_104
- // 459 {
- // 460 ROW_ADDRESS_LOW=wPageAddress & 0XFF;
- MOV.B R9, &ROW_ADDRESS_LOW
- // 461 ROW_ADDRESS_HIGH=(wPageAddress>>8) & 0XFF;
- MOV.W R9, R14
- SWPB R14
- AND.W #0xff, R14
- MOV.B R14, &ROW_ADDRESS_HIGH
- // 462 ERASE_ONE_BLOCK();
- CALL #ERASE_ONE_BLOCK
- // 463 }
- // 464 COMMAND_VAL=0X80;
- ??FaxRXProcess_104:
- MOV.B #0x80, &COMMAND_VAL
- // 465 COMMAND_LATCH_INTO();
- CALL #COMMAND_LATCH_INTO
- // 466
- // 467 //ADDRESS
- // 468 ADDRESS_VALUE=0;//COLUMN_ADDRESS_LOW; //#0X00
- MOV.B #0x0, &ADDRESS_VALUE
- // 469 ADDRESS_LATCH_INTO();
- CALL #ADDRESS_LATCH_INTO
- // 470
- // 471 ADDRESS_VALUE=0;//COLUMN_ADDRESS_LOW; //#0X00
- MOV.B #0x0, &ADDRESS_VALUE
- // 472 ADDRESS_LATCH_INTO();
- CALL #ADDRESS_LATCH_INTO
- // 473
- // 474 ADDRESS_VALUE=wPageAddress & 0xff; //#0X00
- MOV.B R9, &ADDRESS_VALUE
- // 475 ADDRESS_LATCH_INTO();
- CALL #ADDRESS_LATCH_INTO
- // 476
- // 477 ADDRESS_VALUE=(wPageAddress>>8) & 0xff; //#0X00
- MOV.W R9, R14
- SWPB R14
- AND.W #0xff, R14
- MOV.B R14, &ADDRESS_VALUE
- // 478 ADDRESS_LATCH_INTO();
- CALL #ADDRESS_LATCH_INTO
- // 479
- // 480 FLASH_CON_PORT_OUT &=~ ALE;
- BIC.B #0x2, &0x29
- // 481 //CALL DELAY_100US
- // 482 //for(i=0;i<0xff;i++);
- // 483 DATA_PORT_OUT_INITIAL; //MCU OUTPUT,MCU WRITE A DATA TO FLASH
- MOV.B #0xff, &0x32
- JMP ??FaxRXProcess_24
- // 484
- // 485 }//else
- // 486 }//while
- // 487 //***************************************
- // 488 wDataRearCount=gdwRxQueueRearCnt-gdwRxQueueFrontCnt;
- ??FaxRXProcess_98:
- MOV.W &gdwRxQueueRearCnt, R14
- SUB.W &gdwRxQueueFrontCnt, R14
- MOV.W R14, 0x2(SP)
- // 489 if (wDataRearCount)//wDataRearCount<2048-wGeneralCount*ucGeneralCnt)
- CMP.W #0x0, 0x2(SP)
- JEQ ??FaxRXProcess_105
- // 490 {
- // 491 //for (ucGeneralCnt=0;ucGeneralCnt<wGeneralCount;ucGeneralCnt++)
- // 492 for (ucGeneralCnt=0;ucGeneralCnt<wDataRearCount;ucGeneralCnt++)
- MOV.B #0x0, R10
- ??FaxRXProcess_28:
- MOV.B R10, R14
- AND.W #0xff, R14
- CMP.W 0x2(SP), R14
- JC ??FaxRXProcess_106
- // 493 {
- // 494 FLASH_CON_PORT_OUT&=~WE;
- BIC.B #0x1, &0x29
- // 495 DATA_PORT_OUT=aucUartRxBuf[gpucQueueFront++];
- MOV.B &gpucQueueFront, R14
- AND.W #0xff, R14
- MOV.B aucUartRxBuf(R14), &0x31
- ADD.B #0x1, &gpucQueueFront
- // 496 gdwRxQueueFrontCnt++;
- ADD.W #0x1, &gdwRxQueueFrontCnt
- ADDC.W #0x0, &gdwRxQueueFrontCnt + 0x2
- // 497 FLASH_CON_PORT_OUT |= WE;
- BIS.B #0x1, &0x29
- // 498 }
- ADD.B #0x1, R10
- JMP ??FaxRXProcess_28
- // 499
- // 500 wGeneralCount=0;
- ??FaxRXProcess_106:
- MOV.W #0x0, R7
- // 501 COMMAND_VAL=0X10; //10H INITIATES PROGRAM
- MOV.B #0x10, &COMMAND_VAL
- // 502 COMMAND_LATCH_INTO();
- CALL #COMMAND_LATCH_INTO
- // 503
- // 504 READ_STATUS();
- CALL #READ_STATUS
- // 505 ucFlashSttsOverflowCnt=0;
- MOV.B #0x0, R6
- // 506 if(FLASH_STATUS==1&&(ucFlashSttsOverflowCnt++)<2)
- CMP.B #0x1, &FLASH_STATUS
- JNE ??FaxRXProcess_105
- ADD.B #0x1, R6
- // 507 {
- // 508 ;//ERASE_ONE_BLOCK();
- // 509 //PROGRAM_ONE_PAGE();
- // 510 }
- // 511 }//if
- // 512
- // 513
- // 514
- // 515
- // 516
- // 517 SendATcmdH0();
- ??FaxRXProcess_105:
- CALL #SendATcmdH0
- // 518
- // 519 while (1)
- // 520 {
- // 521 ucRxIndex1=gucUartRxCnt-3;
- ??FaxRXProcess_29:
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 522 ucRxIndex0=gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R8
- // 523 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
- AND.W #0xff, R8
- CMP.B #0xd, aucUartRxBuf(R8)
- JNE ??FaxRXProcess_107
- AND.W #0xff, R11
- CMP.B #0x4b, aucUartRxBuf(R11)
- JEQ ??FaxRXProcess_108
- // 524 break;
- // 525 //if check time>min. 5S, Receive Fax error, progra should be quit
- // 526 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_107:
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??FaxRXProcess_109
- ADD.B #0x1, &gucTimeOverflowCount
- MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_109:
- CMP.B #0x14, &gucTimeOverflowCount
- JNE ??FaxRXProcess_29
- MOV.B #0x3, &gucFrhErrorStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- // 527 }
- // 528
- // 529 if (gucFrhErrorStatus==0x03) return; //add at Mar. 16, 2007.
- ??FaxRXProcess_108:
- CMP.B #0x3, &gucFrhErrorStatus
- JEQ ??FaxRXProcess_63
- // 530 ATcmdDelay();
- CALL #ATcmdDelay
- // 531 ATcmdDelay();
- CALL #ATcmdDelay
- // 532 ATcmdDelay();
- CALL #ATcmdDelay
- // 533 ATcmdDelay();
- CALL #ATcmdDelay
- // 534
- // 535 SendATcmdH0();
- CALL #SendATcmdH0
- // 536
- // 537 while (1)
- // 538 {
- // 539 ucRxIndex1=gucUartRxCnt-3;
- ??FaxRXProcess_30:
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 540 ucRxIndex0=gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R8
- // 541 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
- AND.W #0xff, R8
- CMP.B #0xd, aucUartRxBuf(R8)
- JNE ??FaxRXProcess_110
- AND.W #0xff, R11
- CMP.B #0x4b, aucUartRxBuf(R11)
- JEQ ??FaxRXProcess_111
- // 542 break;
- // 543 //if check time>min. 5S, Receive Fax error, progra should be quit
- // 544 RxFaxTimeOverflowErrorQuit();
- ??FaxRXProcess_110:
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??FaxRXProcess_112
- ADD.B #0x1, &gucTimeOverflowCount
- MOV.B #0x0, &gucFrhErrorStatus
- ??FaxRXProcess_112:
- CMP.B #0x14, &gucTimeOverflowCount
- JNE ??FaxRXProcess_30
- MOV.B #0x3, &gucFrhErrorStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- // 545 }
- // 546 if (gucFrhErrorStatus==0x03) return; //add at Mar. 16, 2007.
- ??FaxRXProcess_111:
- CMP.B #0x3, &gucFrhErrorStatus
- JEQ ??FaxRXProcess_63
- // 547 ATcmdDelay();
- CALL #ATcmdDelay
- // 548 ATcmdDelay();
- CALL #ATcmdDelay
- // 549 ATcmdDelay();
- CALL #ATcmdDelay
- // 550 ATcmdDelay();
- CALL #ATcmdDelay
- // 551 ATcmdDelay();
- CALL #ATcmdDelay
- // 552 ATcmdDelay();
- CALL #ATcmdDelay
- // 553 ATcmdDelay();
- CALL #ATcmdDelay
- // 554 ATcmdDelay();
- CALL #ATcmdDelay
- // 555 //AT Fclass0
- // 556
- // 557 SendATcmdFCLASS0();
- CALL #SendATcmdFCLASS0
- // 558 ATcmdDelay();
- CALL #ATcmdDelay
- // 559 ATcmdDelay();
- CALL #ATcmdDelay
- // 560 ATcmdDelay();
- CALL #ATcmdDelay
- // 561 ATcmdDelay();
- CALL #ATcmdDelay
- // 562 //AT
- // 563 SendATcmdPrefix();
- CALL #SendATcmdPrefix
- // 564 ATcmdDelay();
- CALL #ATcmdDelay
- // 565 SendATcmdSuffix();
- CALL #SendATcmdSuffix
- // 566 ATcmdDelay();
- CALL #ATcmdDelay
- // 567 ATcmdDelay();
- CALL #ATcmdDelay
- // 568 ATcmdDelay();
- CALL #ATcmdDelay
- // 569 //AT
- // 570 SendATcmdPrefix();
- CALL #SendATcmdPrefix
- // 571 ATcmdDelay();
- CALL #ATcmdDelay
- // 572 SendATcmdSuffix();
- CALL #SendATcmdSuffix
- // 573 ATcmdDelay();
- CALL #ATcmdDelay
- // 574 ATcmdDelay();
- CALL #ATcmdDelay
- // 575 ATcmdDelay();
- CALL #ATcmdDelay
- // 576 //AT
- // 577 SendATcmdPrefix();
- CALL #SendATcmdPrefix
- // 578 ATcmdDelay();
- CALL #ATcmdDelay
- // 579 SendATcmdSuffix();
- CALL #SendATcmdSuffix
- // 580 ATcmdDelay();
- CALL #ATcmdDelay
- // 581 ATcmdDelay();
- CALL #ATcmdDelay
- // 582 ATcmdDelay();
- CALL #ATcmdDelay
- // 583
- // 584 SendATconfigFE0EndofRX();
- CALL #SendATconfigFE0EndofRX
- // 585 ATcmdDelay();
- CALL #ATcmdDelay
- // 586 ATcmdDelay();
- CALL #ATcmdDelay
- // 587 ATcmdDelay();
- CALL #ATcmdDelay
- // 588 ATcmdDelay();
- CALL #ATcmdDelay
- // 589
- // 590
- // 591 SendATconfigS7RX();
- CALL #SendATconfigS7RX
- // 592 ATcmdDelay();
- CALL #ATcmdDelay
- // 593 ATcmdDelay();
- CALL #ATcmdDelay
- // 594 ATcmdDelay();
- CALL #ATcmdDelay
- // 595 ATcmdDelay();
- CALL #ATcmdDelay
- // 596
- // 597 SendATconfigS0RX();
- CALL #SendATconfigS0RX
- // 598 ATcmdDelay();
- CALL #ATcmdDelay
- // 599 ATcmdDelay();
- CALL #ATcmdDelay
- // 600 ATcmdDelay();
- CALL #ATcmdDelay
- // 601 ATcmdDelay();
- CALL #ATcmdDelay
- // 602
- // 603
- // 604
- // 605
- // 606
- // 607
- // 608
- // 609
- // 610 //***************************************/
- // 611 //gucRxTxFlag = DTERX;// set Rx Tx flag
- // 612 _NOP();
- NOP
- // 613 gwPageAddress = wPageAddress;
- MOV.W R9, &gwPageAddress
- // 614 /*
- // 615 while (1)
- // 616 {
- // 617 SendATcmdModemSoftReset();
- // 618 ATcmdDelay();
- // 619 ATcmdDelay();
- // 620
- // 621 ucRxIndex1=gucUartRxCnt-3;
- // 622 ucRxIndex0=gucUartRxCnt-2;
- // 623 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
- // 624 {break;}
- // 625 }//while
- // 626 */
- // 627
- // 628 }//FaxRXProcess
- ??FaxRXProcess_63:
- ADD.W #0x4, SP
- CFI CFA SP+18
- BR #?Epilogue8
- CFI EndBlock cfiBlock0
- // 629
- RSEG CODE:CODE:SORT:NOROOT(1)
- // 630 void FaxRxInit(void)
- FaxRxInit:
- CFI Block cfiBlock1 Using cfiCommon0
- CFI Function FaxRxInit
- // 631 {
- // 632
- // 633 SendATconfigFS0();
- FUNCALL FaxRxInit, SendATconfigFS0
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, SendATcmdPrefix
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, SendATcmdSuffix
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, SendATconfigS7
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, SendATconfigX4M1
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, SendATcmdFCLASS
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, SendATcmdPrefix
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, SendATcmdSuffix
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, SendATcmdFCLASS
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, SendATcmdPrefix
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, SendATcmdSuffix
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- FUNCALL FaxRxInit, ATcmdDelay
- LOCFRAME CSTACK, 2, STACK
- CALL #SendATconfigFS0
- // 634 ATcmdDelay();
- CALL #ATcmdDelay
- // 635 ATcmdDelay();
- CALL #ATcmdDelay
- // 636 ATcmdDelay();
- CALL #ATcmdDelay
- // 637 //AT
- // 638 SendATcmdPrefix();
- CALL #SendATcmdPrefix
- // 639 ATcmdDelay();
- CALL #ATcmdDelay
- // 640 SendATcmdSuffix();
- CALL #SendATcmdSuffix
- // 641 ATcmdDelay();
- CALL #ATcmdDelay
- // 642 ATcmdDelay();
- CALL #ATcmdDelay
- // 643 ATcmdDelay();
- CALL #ATcmdDelay
- // 644
- // 645 SendATconfigS7();
- CALL #SendATconfigS7
- // 646 ATcmdDelay();
- CALL #ATcmdDelay
- // 647 ATcmdDelay();
- CALL #ATcmdDelay
- // 648 ATcmdDelay();
- CALL #ATcmdDelay
- // 649
- // 650 SendATconfigX4M1();
- CALL #SendATconfigX4M1
- // 651 ATcmdDelay();
- CALL #ATcmdDelay
- // 652 ATcmdDelay();
- CALL #ATcmdDelay
- // 653 ATcmdDelay();
- CALL #ATcmdDelay
- // 654
- // 655 SendATcmdFCLASS();
- CALL #SendATcmdFCLASS
- // 656 ATcmdDelay();
- CALL #ATcmdDelay
- // 657 ATcmdDelay();
- CALL #ATcmdDelay
- // 658 ATcmdDelay();
- CALL #ATcmdDelay
- // 659 //AT
- // 660 SendATcmdPrefix();
- CALL #SendATcmdPrefix
- // 661 ATcmdDelay();
- CALL #ATcmdDelay
- // 662 SendATcmdSuffix();
- CALL #SendATcmdSuffix
- // 663 ATcmdDelay();
- CALL #ATcmdDelay
- // 664 ATcmdDelay();
- CALL #ATcmdDelay
- // 665 ATcmdDelay();
- CALL #ATcmdDelay
- // 666
- // 667 SendATcmdFCLASS();
- CALL #SendATcmdFCLASS
- // 668 ATcmdDelay();
- CALL #ATcmdDelay
- // 669 ATcmdDelay();
- CALL #ATcmdDelay
- // 670 ATcmdDelay();
- CALL #ATcmdDelay
- // 671 //AT
- // 672 SendATcmdPrefix();
- CALL #SendATcmdPrefix
- // 673 ATcmdDelay();
- CALL #ATcmdDelay
- // 674 SendATcmdSuffix();
- CALL #SendATcmdSuffix
- // 675 ATcmdDelay();
- CALL #ATcmdDelay
- // 676 ATcmdDelay();
- CALL #ATcmdDelay
- // 677 ATcmdDelay();
- BR #ATcmdDelay
- CFI EndBlock cfiBlock1
- // 678 }
- // 679
- RSEG CODE:CODE:NOROOT(1)
- // 680 void PageImageEndProcess(void)
- PageImageEndProcess:
- CFI Block cfiBlock2 Using cfiCommon0
- CFI Function PageImageEndProcess
- // 681 {
- FUNCALL PageImageEndProcess, SendATcmdFRH
- LOCFRAME CSTACK, 6, STACK
- FUNCALL PageImageEndProcess, SendATcmdFTH
- LOCFRAME CSTACK, 6, STACK
- FUNCALL PageImageEndProcess, Delay1500ms
- LOCFRAME CSTACK, 6, STACK
- FUNCALL PageImageEndProcess, SendATdataFTHMCF
- LOCFRAME CSTACK, 6, STACK
- PUSH.W R10
- CFI R10 Frame(CFA, -4)
- CFI CFA SP+4
- PUSH.W R11
- CFI R11 Frame(CFA, -6)
- CFI CFA SP+6
- // 682 unsigned char ucRxIndex1=0,ucRxIndex0=0;
- MOV.B #0x0, R11
- MOV.B #0x0, R10
- // 683 //FRHEOP (end of procedure)
- // 684 SendATcmdFRH();
- CALL #SendATcmdFRH
- // 685 //ATcmdDelay();
- // 686
- // 687 while (1)
- // 688 {
- // 689 ucRxIndex1=gucUartRxCnt-3;
- ??PageImageEndProcess_0:
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 690 ucRxIndex0=gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R10
- // 691 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x54==aucUartRxBuf[ucRxIndex1]))
- AND.W #0xff, R10
- CMP.B #0xd, aucUartRxBuf(R10)
- JNE ??PageImageEndProcess_4
- AND.W #0xff, R11
- CMP.B #0x54, aucUartRxBuf(R11)
- JEQ ??PageImageEndProcess_5
- // 692 break;
- // 693 //if check time>min. 5S, Receive Fax error, progra should be quit
- // 694 RxFaxTimeOverflowErrorQuit();
- ??PageImageEndProcess_4:
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??PageImageEndProcess_6
- ADD.B #0x1, &gucTimeOverflowCount
- MOV.B #0x0, &gucFrhErrorStatus
- ??PageImageEndProcess_6:
- CMP.B #0x14, &gucTimeOverflowCount
- JNE ??PageImageEndProcess_0
- MOV.B #0x3, &gucFrhErrorStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- // 695 }//while
- // 696
- // 697 if (gucFrhErrorStatus==0x03) return; //add at Mar. 16, 2007.
- ??PageImageEndProcess_5:
- CMP.B #0x3, &gucFrhErrorStatus
- JEQ ??PageImageEndProcess_7
- // 698
- // 699 while (1)
- // 700 {
- // 701 ucRxIndex1=gucUartRxCnt-3;
- ??PageImageEndProcess_1:
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 702 ucRxIndex0=gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R10
- // 703 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
- AND.W #0xff, R10
- CMP.B #0xd, aucUartRxBuf(R10)
- JNE ??PageImageEndProcess_8
- AND.W #0xff, R11
- CMP.B #0x4b, aucUartRxBuf(R11)
- JEQ ??PageImageEndProcess_9
- // 704 break;
- // 705 //if check time>min. 5S, Receive Fax error, progra should be quit
- // 706 RxFaxTimeOverflowErrorQuit();
- ??PageImageEndProcess_8:
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??PageImageEndProcess_10
- ADD.B #0x1, &gucTimeOverflowCount
- MOV.B #0x0, &gucFrhErrorStatus
- ??PageImageEndProcess_10:
- CMP.B #0x14, &gucTimeOverflowCount
- JNE ??PageImageEndProcess_1
- MOV.B #0x3, &gucFrhErrorStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- // 707 }
- // 708
- // 709 if (gucFrhErrorStatus==0x03) return; //add at Mar. 16, 2007.
- ??PageImageEndProcess_9:
- CMP.B #0x3, &gucFrhErrorStatus
- JEQ ??PageImageEndProcess_7
- // 710
- // 711 //FTHMCF (message confirmation)
- // 712 SendATcmdFTH();
- CALL #SendATcmdFTH
- // 713 while (1)
- // 714 {
- // 715 ucRxIndex1=gucUartRxCnt-3;
- ??PageImageEndProcess_2:
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 716 ucRxIndex0=gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R10
- // 717 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x54==aucUartRxBuf[ucRxIndex1]))
- AND.W #0xff, R10
- CMP.B #0xd, aucUartRxBuf(R10)
- JNE ??PageImageEndProcess_11
- AND.W #0xff, R11
- CMP.B #0x54, aucUartRxBuf(R11)
- JEQ ??PageImageEndProcess_12
- // 718 break;
- // 719 //if check time>min. 5S, Receive Fax error, progra should be quit
- // 720 RxFaxTimeOverflowErrorQuit();
- ??PageImageEndProcess_11:
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??PageImageEndProcess_13
- ADD.B #0x1, &gucTimeOverflowCount
- MOV.B #0x0, &gucFrhErrorStatus
- ??PageImageEndProcess_13:
- CMP.B #0x14, &gucTimeOverflowCount
- JNE ??PageImageEndProcess_2
- MOV.B #0x3, &gucFrhErrorStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- // 721 }
- // 722
- // 723 if (gucFrhErrorStatus == 0x03) return; //add at Mar. 16, 2007.
- ??PageImageEndProcess_12:
- CMP.B #0x3, &gucFrhErrorStatus
- JEQ ??PageImageEndProcess_7
- // 724
- // 725 Delay1500ms(); // delay 1.5S minimun 1 second
- CALL #Delay1500ms
- // 726 SendATdataFTHMCF();
- CALL #SendATdataFTHMCF
- // 727 while (1)
- // 728 {
- // 729 ucRxIndex1=gucUartRxCnt-3;
- ??PageImageEndProcess_3:
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 730 ucRxIndex0=gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R10
- // 731 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
- AND.W #0xff, R10
- CMP.B #0xd, aucUartRxBuf(R10)
- JNE ??PageImageEndProcess_14
- AND.W #0xff, R11
- CMP.B #0x4b, aucUartRxBuf(R11)
- JEQ ??PageImageEndProcess_7
- // 732 break;
- // 733 //if check time>min. 5S, Receive Fax error, progra should be quit
- // 734 RxFaxTimeOverflowErrorQuit();
- ??PageImageEndProcess_14:
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??PageImageEndProcess_15
- ADD.B #0x1, &gucTimeOverflowCount
- MOV.B #0x0, &gucFrhErrorStatus
- ??PageImageEndProcess_15:
- CMP.B #0x14, &gucTimeOverflowCount
- JNE ??PageImageEndProcess_3
- MOV.B #0x3, &gucFrhErrorStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- ??PageImageEndProcess_7:
- POP.W R11
- CFI R11 SameValue
- CFI CFA SP+4
- POP.W R10
- CFI R10 SameValue
- CFI CFA SP+2
- RET
- CFI EndBlock cfiBlock2
- // 735 }
- // 736
- // 737 if (gucFrhErrorStatus==0x03) return; //add at Mar. 16, 2007.
- // 738 }
- // 739
- // 740
- RSEG CODE:CODE:SORT:NOROOT(1)
- // 741 void FRHDncProcess(void)
- FRHDncProcess:
- CFI Block cfiBlock3 Using cfiCommon0
- CFI Function FRHDncProcess
- // 742 {
- // 743 ;
- // 744 }
- RET
- CFI EndBlock cfiBlock3
- // 745
- RSEG CODE:CODE:NOROOT(1)
- // 746 void FthCsiDis(void)
- FthCsiDis:
- CFI Block cfiBlock4 Using cfiCommon0
- CFI Function FthCsiDis
- // 747 {
- FUNCALL FthCsiDis, SendATcmdFTH
- LOCFRAME CSTACK, 8, STACK
- FUNCALL FthCsiDis, Delay1500ms
- LOCFRAME CSTACK, 8, STACK
- FUNCALL FthCsiDis, SendATdataFTHCSI
- LOCFRAME CSTACK, 8, STACK
- FUNCALL FthCsiDis, ATcmdDelay
- LOCFRAME CSTACK, 8, STACK
- FUNCALL FthCsiDis, SendATdataFTHDIS
- LOCFRAME CSTACK, 8, STACK
- PUSH.W R10
- CFI R10 Frame(CFA, -4)
- CFI CFA SP+4
- PUSH.W R11
- CFI R11 Frame(CFA, -6)
- CFI CFA SP+6
- PUSH.W R8
- CFI R8 Frame(CFA, -8)
- CFI CFA SP+8
- // 748 unsigned char ucRxIndex1=0,ucRxIndex0=0,
- MOV.B #0x0, R11
- MOV.B #0x0, R10
- // 749 ucGeneralCount=0;
- MOV.B #0x0, R8
- // 750 //FTH
- // 751 SendATcmdFTH();
- CALL #SendATcmdFTH
- // 752 while (1) //CONNECT(54) 0D 0A
- // 753 {
- // 754 ucRxIndex1=gucUartRxCnt-3;
- ??FthCsiDis_0:
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 755 ucRxIndex0=gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R10
- // 756 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x54==aucUartRxBuf[ucRxIndex1]))
- AND.W #0xff, R10
- CMP.B #0xd, aucUartRxBuf(R10)
- JNE ??FthCsiDis_4
- AND.W #0xff, R11
- CMP.B #0x54, aucUartRxBuf(R11)
- JEQ ??FthCsiDis_5
- // 757 break;
- // 758 //if check time>min. 5S, Receive Fax error, progra should be quit
- // 759 RxFaxTimeOverflowErrorQuit();
- ??FthCsiDis_4:
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??FthCsiDis_6
- ADD.B #0x1, &gucTimeOverflowCount
- MOV.B #0x0, &gucFrhErrorStatus
- ??FthCsiDis_6:
- CMP.B #0x14, &gucTimeOverflowCount
- JNE ??FthCsiDis_0
- MOV.B #0x3, &gucFrhErrorStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- // 760
- // 761 }
- // 762 if (gucFrhErrorStatus==0x03) return; //add at Mar. 16, 2007.
- ??FthCsiDis_5:
- CMP.B #0x3, &gucFrhErrorStatus
- JEQ ??FthCsiDis_7
- // 763
- // 764 Delay1500ms(); // delay 1.5S minimun 1 second
- CALL #Delay1500ms
- // 765
- // 766 SendATdataFTHCSI(); //The final bit is 0. The modem will generates CONNECT message.
- CALL #SendATdataFTHCSI
- // 767 while (1) //CONNECT(54) 0D 0A
- // 768 {
- // 769 ucRxIndex1=gucUartRxCnt-3;
- ??FthCsiDis_1:
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 770 ucRxIndex0=gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R10
- // 771 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x54==aucUartRxBuf[ucRxIndex1]))
- AND.W #0xff, R10
- CMP.B #0xd, aucUartRxBuf(R10)
- JNE ??FthCsiDis_8
- AND.W #0xff, R11
- CMP.B #0x54, aucUartRxBuf(R11)
- JEQ ??FthCsiDis_9
- // 772 break;
- // 773 //if check time>min. 5S, Receive Fax error, progra should be quit
- // 774 RxFaxTimeOverflowErrorQuit();
- ??FthCsiDis_8:
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??FthCsiDis_10
- ADD.B #0x1, &gucTimeOverflowCount
- MOV.B #0x0, &gucFrhErrorStatus
- ??FthCsiDis_10:
- CMP.B #0x14, &gucTimeOverflowCount
- JNE ??FthCsiDis_1
- MOV.B #0x3, &gucFrhErrorStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- // 775 }
- // 776 if (gucFrhErrorStatus==0x03) return; //add at Mar. 16, 2007.
- ??FthCsiDis_9:
- CMP.B #0x3, &gucFrhErrorStatus
- JEQ ??FthCsiDis_7
- // 777
- // 778 for (ucGeneralCount=0; ucGeneralCount<50; ucGeneralCount++)// delay 1.5S minimun 1 second
- MOV.B #0x0, R8
- ??FthCsiDis_2:
- CMP.B #0x32, R8
- JC ??FthCsiDis_11
- // 779 {
- // 780 ATcmdDelay(); //50ms
- CALL #ATcmdDelay
- // 781 }
- ADD.B #0x1, R8
- JMP ??FthCsiDis_2
- // 782
- // 783 SendATdataFTHDIS();//SendATdataFTHTSI(sizeof (FTHDIS)); a bug of Sep.18
- ??FthCsiDis_11:
- CALL #SendATdataFTHDIS
- // 784
- // 785 while (1) //O K 0D 0A
- // 786 {
- // 787 ucRxIndex1=gucUartRxCnt-3;
- ??FthCsiDis_3:
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 788 ucRxIndex0=gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R10
- // 789 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1])) //K ==0x4b
- AND.W #0xff, R10
- CMP.B #0xd, aucUartRxBuf(R10)
- JNE ??FthCsiDis_12
- AND.W #0xff, R11
- CMP.B #0x4b, aucUartRxBuf(R11)
- JEQ ??FthCsiDis_7
- // 790 break;
- // 791 //if check time>min. 5S, Receive Fax error, progra should be quit
- // 792 RxFaxTimeOverflowErrorQuit();
- ??FthCsiDis_12:
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??FthCsiDis_13
- ADD.B #0x1, &gucTimeOverflowCount
- MOV.B #0x0, &gucFrhErrorStatus
- ??FthCsiDis_13:
- CMP.B #0x14, &gucTimeOverflowCount
- JNE ??FthCsiDis_3
- MOV.B #0x3, &gucFrhErrorStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- ??FthCsiDis_7:
- POP.W R8
- CFI R8 SameValue
- CFI CFA SP+6
- POP.W R11
- CFI R11 SameValue
- CFI CFA SP+4
- POP.W R10
- CFI R10 SameValue
- CFI CFA SP+2
- RET
- CFI EndBlock cfiBlock4
- // 793 }
- // 794
- // 795 if (gucFrhErrorStatus==0x03) return; //add at Mar. 16, 2007.
- // 796 }
- RSEG CODE:CODE:NOROOT(1)
- ?setjmp_save_r4:
- REQUIRE ?setjmp_r4
- REQUIRE ?longjmp_r4
- RSEG CODE:CODE:NOROOT(1)
- ?setjmp_save_r5:
- REQUIRE ?setjmp_r5
- REQUIRE ?longjmp_r5
- END
- //
- // 4 226 bytes in segment CODE
- // 3 bytes in segment DATA16_AN
- //
- // 4 226 bytes of CODE memory
- // 0 bytes of DATA memory (+ 3 bytes shared)
- //
- //Errors: none
- //Warnings: none