DTEcmdProcess.s43
上传用户:xhjmsc
上传日期:2019-09-13
资源大小:389k
文件大小:28k
- NAME DTEcmdProcess
- 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 aucViewData
- EXTERN ViewCommunicationTX
- FUNCTION ViewCommunicationTX,0202H
- EXTERN ?Epilogue5
- EXTERN ATcmdDelay
- FUNCTION ATcmdDelay,0202H
- EXTERN SendATcmd
- FUNCTION SendATcmd,0202H
- EXTERN gucUartRxCnt
- EXTERN aucUartRxBuf
- EXTERN SendATcmdModemSoftReset
- FUNCTION SendATcmdModemSoftReset,0202H
- EXTERN ?Epilogue8
- EXTERN ?ShiftLeft16_6
- EXTERN CalNextPageAddress
- FUNCTION CalNextPageAddress,0202H
- EXTERN ROW_ADDRESS_LOW
- EXTERN ROW_ADDRESS_HIGH
- 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 SoftUartTxOneFrame
- FUNCTION SoftUartTxOneFrame,0202H
- EXTERN gwGeneralPageAddress
- EXTERN gwColumnAddress
- EXTERN ?Epilogue6
- EXTERN COLUMN_ADDRESS_HIGH
- EXTERN READ_256_BYTE
- FUNCTION READ_256_BYTE,0202H
- EXTERN ?longjmp_r4
- EXTERN ?longjmp_r5
- EXTERN ?setjmp_r4
- EXTERN ?setjmp_r5
- PUBWEAK ?setjmp_save_r4
- PUBWEAK ?setjmp_save_r5
- PUBLIC DceResponsePc
- FUNCTION DceResponsePc,021203H
- LOCFRAME CSTACK, 4, STACK
- PUBLIC DteGetFaxList
- FUNCTION DteGetFaxList,021203H
- LOCFRAME CSTACK, 24, STACK
- PUBLIC DteGetModemBus
- FUNCTION DteGetModemBus,021203H
- LOCFRAME CSTACK, 2, STACK
- PUBLIC DteGetOneFax
- FUNCTION DteGetOneFax,021203H
- LOCFRAME CSTACK, 14, STACK
- PUBLIC DteReturnModemBus
- FUNCTION DteReturnModemBus,021203H
- LOCFRAME CSTACK, 12, STACK
- PUBWEAK P2IN
- PUBWEAK P2OUT
- PUBWEAK P5DIR
- PUBWEAK P5IN
- PUBWEAK P6DIR
- PUBWEAK P6OUT
-
- 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_070423filesDTEcmdProcess.c
- // 1 /************************************************
- // 2 Description:
- // 3 process Dte Command
- // 4 Input:
- // 5 none
- // 6 Output:
- // 7 none
- // 8 Update:
- // 9 2007.03.20 Bryan add some function
- // 10 2007.1.25 Bryan function header create
- // 11 ************************************************/
- // 12
- // 13 #include "includeH.h"
- ASEGN DATA16_AN:DATA:NOROOT,028H
- // unsigned char const volatile __data P2IN
- P2IN:
- DS8 1
- ASEGN DATA16_AN:DATA:NOROOT,029H
- // unsigned char volatile __data P2OUT
- P2OUT:
- DS8 1
- ASEGN DATA16_AN:DATA:NOROOT,030H
- // unsigned char const volatile __data P5IN
- P5IN:
- DS8 1
- ASEGN DATA16_AN:DATA:NOROOT,032H
- // unsigned char volatile __data P5DIR
- P5DIR:
- DS8 1
- ASEGN DATA16_AN:DATA:NOROOT,035H
- // unsigned char volatile __data P6OUT
- P6OUT:
- DS8 1
- ASEGN DATA16_AN:DATA:NOROOT,036H
- // unsigned char volatile __data P6DIR
- P6DIR:
- DS8 1
- // 14
- RSEG CODE:CODE:SORT:NOROOT(1)
- // 15 void DteGetModemBus(void)
- DteGetModemBus:
- CFI Block cfiBlock0 Using cfiCommon0
- CFI Function DteGetModemBus
- // 16 {
- // 17 MODEM_BUS_CON_PORT |= MODEM_BUS_2_MCU;
- FUNCALL DteGetModemBus, ViewCommunicationTX
- LOCFRAME CSTACK, 2, STACK
- BIS.B #0x10, &0x35
- // 18 MODEM_BUS_CON_PORT &= ~MODEM_BUS_2_PC;
- BIC.B #0x8, &0x35
- // 19 gucViewStaticStatus &= ~bitViewReceiving;
- BIC.B #0x1, &aucViewData + 0x7
- // 20 gucViewStaticStatus |= bitViewSending;
- BIS.B #0x2, &aucViewData + 0x7
- // 21 ViewCommunicationTX(0x01);
- MOV.B #0x1, R12
- BR #ViewCommunicationTX
- CFI EndBlock cfiBlock0
- // 22
- // 23 }
- // 24
- // 25 //*************************************************************************
- RSEG CODE:CODE:NOROOT(1)
- // 26 void DteReturnModemBus(void)
- DteReturnModemBus:
- CFI Block cfiBlock1 Using cfiCommon0
- CFI Function DteReturnModemBus
- // 27 {
- FUNCALL DteReturnModemBus, ATcmdDelay
- LOCFRAME CSTACK, 12, STACK
- FUNCALL DteReturnModemBus, SendATcmd
- LOCFRAME CSTACK, 12, STACK
- FUNCALL DteReturnModemBus, ATcmdDelay
- LOCFRAME CSTACK, 12, STACK
- FUNCALL DteReturnModemBus, ATcmdDelay
- LOCFRAME CSTACK, 12, STACK
- FUNCALL DteReturnModemBus, SendATcmdModemSoftReset
- LOCFRAME CSTACK, 12, STACK
- FUNCALL DteReturnModemBus, ATcmdDelay
- LOCFRAME CSTACK, 12, STACK
- FUNCALL DteReturnModemBus, ATcmdDelay
- LOCFRAME CSTACK, 12, STACK
- FUNCALL DteReturnModemBus, ViewCommunicationTX
- LOCFRAME CSTACK, 12, 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
- // 28 unsigned int wGeneralCount = 0;
- MOV.W #0x0, R6
- // 29 unsigned int wOKcount=0;
- MOV.W #0x0, R11
- // 30 unsigned int wNotOKcount=0;
- MOV.W #0x0, R8
- // 31 unsigned char ucRxIndex1=0;
- MOV.B #0x0, R9
- // 32 unsigned char ucRxIndex0=0;
- MOV.B #0x0, R10
- // 33
- // 34 MODEM_BUS_CON_PORT |= MODEM_BUS_2_PC;
- BIS.B #0x8, &0x35
- // 35 MODEM_BUS_CON_PORT &= ~MODEM_BUS_2_MCU;
- BIC.B #0x10, &0x35
- // 36 while (1)
- // 37 {
- // 38 ATcmdDelay();
- ??DteReturnModemBus_1:
- CALL #ATcmdDelay
- // 39 SendATcmd();
- CALL #SendATcmd
- // 40 ATcmdDelay();
- CALL #ATcmdDelay
- // 41 ATcmdDelay();
- CALL #ATcmdDelay
- // 42
- // 43 while (wGeneralCount++<0xffff)
- ??DteReturnModemBus_0:
- MOV.W R6, R14
- MOV.W #0x1, R6
- ADD.W R14, R6
- CMP.W #0xffff, R14
- JEQ ??DteReturnModemBus_2
- // 44 {
- // 45 ucRxIndex1=gucUartRxCnt-3;
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R9
- // 46 ucRxIndex0=gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R10
- // 47 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
- AND.W #0xff, R10
- CMP.B #0xd, aucUartRxBuf(R10)
- JNE ??DteReturnModemBus_3
- AND.W #0xff, R9
- CMP.B #0x4b, aucUartRxBuf(R9)
- JNE ??DteReturnModemBus_3
- // 48 {wOKcount++;break;}
- ADD.W #0x1, R11
- JMP ??DteReturnModemBus_2
- // 49 if (wGeneralCount==0xffff)
- ??DteReturnModemBus_3:
- CMP.W #0xffff, R6
- JNE ??DteReturnModemBus_0
- // 50 {
- // 51 //wGeneralCount=0;
- // 52 wNotOKcount++;
- ADD.W #0x1, R8
- // 53 SendATcmdModemSoftReset();
- CALL #SendATcmdModemSoftReset
- // 54 ATcmdDelay();
- CALL #ATcmdDelay
- // 55 ATcmdDelay();
- CALL #ATcmdDelay
- JMP ??DteReturnModemBus_0
- // 56 }//if
- // 57 }//while
- // 58 ucRxIndex1=gucUartRxCnt-3;
- ??DteReturnModemBus_2:
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R9
- // 59 ucRxIndex0=gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R10
- // 60 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
- AND.W #0xff, R10
- CMP.B #0xd, aucUartRxBuf(R10)
- JNE ??DteReturnModemBus_1
- AND.W #0xff, R9
- CMP.B #0x4b, aucUartRxBuf(R9)
- JNE ??DteReturnModemBus_1
- // 61 {wOKcount++;break;}
- ADD.W #0x1, R11
- // 62 }//while
- // 63
- // 64 _NOP();
- NOP
- // 65 gucViewStaticStatus |= bitViewReceiving;
- BIS.B #0x1, &aucViewData + 0x7
- // 66 gucViewStaticStatus &= ~bitViewSending;
- BIC.B #0x2, &aucViewData + 0x7
- // 67 ViewCommunicationTX(0x01);
- MOV.B #0x1, R12
- CALL #ViewCommunicationTX
- // 68 }
- BR #?Epilogue5
- CFI EndBlock cfiBlock1
- // 69
- // 70
- // 71 //*************************************************************************
- RSEG CODE:CODE:NOROOT(1)
- // 72 void DteGetFaxList(void)
- DteGetFaxList:
- CFI Block cfiBlock2 Using cfiCommon0
- CFI Function DteGetFaxList
- // 73 {
- FUNCALL DteGetFaxList, CalNextPageAddress
- LOCFRAME CSTACK, 24, STACK
- FUNCALL DteGetFaxList, COMMAND_LATCH_INTO
- LOCFRAME CSTACK, 24, STACK
- FUNCALL DteGetFaxList, ADDRESS_LATCH_INTO
- LOCFRAME CSTACK, 24, STACK
- FUNCALL DteGetFaxList, ADDRESS_LATCH_INTO
- LOCFRAME CSTACK, 24, STACK
- FUNCALL DteGetFaxList, ADDRESS_LATCH_INTO
- LOCFRAME CSTACK, 24, STACK
- FUNCALL DteGetFaxList, ADDRESS_LATCH_INTO
- LOCFRAME CSTACK, 24, STACK
- FUNCALL DteGetFaxList, COMMAND_LATCH_INTO
- LOCFRAME CSTACK, 24, STACK
- FUNCALL DteGetFaxList, SoftUartTxOneFrame
- LOCFRAME CSTACK, 24, 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 #0x6, SP
- CFI CFA SP+24
- // 74 unsigned int wPageAddress=0, wBlockAddress=0,
- MOV.W #0x0, R7
- MOV.W #0x0, R5
- // 75 wColumnAddress=0,wNextPageAddress=0,
- MOV.W #0x0, R10
- MOV.W #0x0, 0x2(SP)
- // 76 wRearPntCnt=0;
- MOV.W #0x0, 0x4(SP)
- // 77 unsigned char ucRxIndex=0,
- MOV.B #0x0, R11
- // 78 ucGeneralCnt=0,ucFaxPropertyLenCnt,
- MOV.B #0x0, 0x0(SP)
- // 79 ucRxIndex3=0,ucRxIndex2=0,
- MOV.B #0x0, R4
- MOV.B #0x0, R8
- // 80 ucRxIndex0=0,ucRxIndex1=0;
- MOV.B #0x0, R9
- MOV.B #0x0, R6
- // 81
- // 82 SOFTUART_PORT_DIRECTION |= bitSOFTUARTTX;//set SOFTUARTTX open SoftUart TX
- BIS.B #0x1, &0x36
- // 83 for (wBlockAddress=cstFaxPropertyTableStartBlockNum;
- MOV.W #0x1, R5
- // 84 wBlockAddress<=cstFaxPropertyTableOverBlockNum;wBlockAddress++)
- ??DteGetFaxList_5:
- CMP.W #0xb, R5
- JC ??DteGetFaxList_6
- // 85 {
- // 86 //1 block==64pages
- // 87 for (wPageAddress=(wBlockAddress<<6);wPageAddress<((wBlockAddress<<6)+64);wPageAddress++)
- MOV.W R5, R12
- CALL #?ShiftLeft16_6
- MOV.W R12, R7
- ??DteGetFaxList_4:
- MOV.W R5, R12
- CALL #?ShiftLeft16_6
- ADD.W #0x40, R12
- CMP.W R12, R7
- JC ??DteGetFaxList_7
- // 88 {
- // 89 do{
- // 90 wNextPageAddress=wPageAddress+64;
- ??DteGetFaxList_0:
- MOV.W #0x40, R14
- ADD.W R7, R14
- MOV.W R14, 0x2(SP)
- // 91 wPageAddress=CalNextPageAddress(wPageAddress);
- MOV.W R7, R12
- CALL #CalNextPageAddress
- MOV.W R12, R7
- // 92 }while(wNextPageAddress==wPageAddress);
- CMP.W R7, 0x2(SP)
- JEQ ??DteGetFaxList_0
- // 93
- // 94 wColumnAddress=0;
- MOV.W #0x0, R10
- // 95 ROW_ADDRESS_LOW=wPageAddress & 0XFF;
- MOV.B R7, &ROW_ADDRESS_LOW
- // 96 ROW_ADDRESS_HIGH=(wPageAddress>>8) & 0XFF;
- MOV.W R7, R14
- SWPB R14
- AND.W #0xff, R14
- MOV.B R14, &ROW_ADDRESS_HIGH
- // 97
- // 98 //if a block no erase, one page can write 8 tiems(00 512 1024 1536 2048 2064 2080 2096)
- // 99 //So 8 times shall be readed within one page.
- // 100 for (ucGeneralCnt=0;ucGeneralCnt<8;ucGeneralCnt++)
- MOV.B #0x0, 0x0(SP)
- ??DteGetFaxList_3:
- CMP.B #0x8, 0x0(SP)
- JC ??DteGetFaxList_8
- // 101 {
- // 102 //COMMAND
- // 103 COMMAND_VAL=0x00; //#0X00 //00H READ1 0-2111BYTE
- MOV.B #0x0, &COMMAND_VAL
- // 104 COMMAND_LATCH_INTO();
- CALL #COMMAND_LATCH_INTO
- // 105 //ADDRESS
- // 106
- // 107 ADDRESS_VALUE=wColumnAddress & 0xff;//COLUMN_ADDRESS_LOW;
- MOV.B R10, &ADDRESS_VALUE
- // 108 ADDRESS_LATCH_INTO();
- CALL #ADDRESS_LATCH_INTO
- // 109
- // 110 ADDRESS_VALUE=(wColumnAddress>>8) & 0XFF;//COLUMN_ADDRESS_HIGH;
- MOV.W R10, R14
- SWPB R14
- AND.W #0xff, R14
- MOV.B R14, &ADDRESS_VALUE
- // 111 ADDRESS_LATCH_INTO();
- CALL #ADDRESS_LATCH_INTO
- // 112
- // 113 ADDRESS_VALUE=ROW_ADDRESS_LOW;
- MOV.B &ROW_ADDRESS_LOW, &ADDRESS_VALUE
- // 114 ADDRESS_LATCH_INTO();
- CALL #ADDRESS_LATCH_INTO
- // 115
- // 116 ADDRESS_VALUE=ROW_ADDRESS_HIGH;
- MOV.B &ROW_ADDRESS_HIGH, &ADDRESS_VALUE
- // 117 ADDRESS_LATCH_INTO();
- CALL #ADDRESS_LATCH_INTO
- // 118 FLASH_CON_PORT_OUT &=~ ALE;
- BIC.B #0x2, &0x29
- // 119
- // 120 COMMAND_VAL=0X30;
- MOV.B #0x30, &COMMAND_VAL
- // 121 COMMAND_LATCH_INTO();
- CALL #COMMAND_LATCH_INTO
- // 122 //ATcmdDelay();
- // 123 while((FLASH_CON_PORT_IN & RB)==0);
- ??DteGetFaxList_1:
- BIT.B #0x20, &0x28
- JNC ??DteGetFaxList_1
- // 124 DATA_PORT_IN_INITIAL;
- MOV.B #0x0, &0x32
- // 125 for (ucFaxPropertyLenCnt=0;ucFaxPropertyLenCnt<16;ucFaxPropertyLenCnt++)
- MOV.B #0x0, 0x1(SP)
- ??DteGetFaxList_2:
- CMP.B #0x10, 0x1(SP)
- JC ??DteGetFaxList_9
- // 126 {
- // 127 FLASH_CON_PORT_OUT &=~ RE; //RE IS LOW,ENABLE READ DATA
- BIC.B #0x10, &0x29
- // 128 SoftUartTxOneFrame(DATA_PORT_IN);//add at Jan. 25, 2007
- MOV.B &0x30, R12
- CALL #SoftUartTxOneFrame
- // 129 aucUartRxBuf[ucRxIndex++]=DATA_PORT_IN;
- MOV.B R11, R14
- AND.W #0xff, R14
- MOV.B &0x30, aucUartRxBuf(R14)
- ADD.B #0x1, R11
- // 130 FLASH_CON_PORT_OUT |= RE;
- BIS.B #0x10, &0x29
- // 131 }
- ADD.B #0x1, 0x1(SP)
- JMP ??DteGetFaxList_2
- // 132 wRearPntCnt++;
- ??DteGetFaxList_9:
- ADD.W #0x1, 0x4(SP)
- // 133 ucRxIndex3=ucRxIndex-4;
- MOV.B #0xfc, R14
- ADD.B R11, R14
- MOV.B R14, R4
- // 134 ucRxIndex2=ucRxIndex-3;
- MOV.B #0xfd, R14
- ADD.B R11, R14
- MOV.B R14, R8
- // 135 ucRxIndex1=ucRxIndex-2;
- MOV.B #0xfe, R14
- ADD.B R11, R14
- MOV.B R14, R6
- // 136 ucRxIndex0=ucRxIndex-1;
- MOV.B #0xff, R14
- ADD.B R11, R14
- MOV.B R14, R9
- // 137 if (0xff == aucUartRxBuf[ucRxIndex0] && 0xff == aucUartRxBuf[ucRxIndex1] &&
- // 138 0xff == aucUartRxBuf[ucRxIndex2] && 0xff == aucUartRxBuf[ucRxIndex3])
- MOV.B R9, R14
- AND.W #0xff, R14
- CMP.B #0xff, aucUartRxBuf(R14)
- JNE ??DteGetFaxList_10
- MOV.B R6, R14
- AND.W #0xff, R14
- CMP.B #0xff, aucUartRxBuf(R14)
- JNE ??DteGetFaxList_10
- MOV.B R8, R14
- AND.W #0xff, R14
- CMP.B #0xff, aucUartRxBuf(R14)
- JNE ??DteGetFaxList_10
- MOV.B R4, R14
- AND.W #0xff, R14
- CMP.B #0xff, aucUartRxBuf(R14)
- JEQ ??DteGetFaxList_8
- // 139 {
- // 140 break; //next rear
- // 141 }//if
- // 142 if (ucGeneralCnt<4)
- ??DteGetFaxList_10:
- CMP.B #0x4, 0x0(SP)
- JC ??DteGetFaxList_11
- // 143 wColumnAddress+=512;
- ADD.W #0x200, R10
- JMP ??DteGetFaxList_12
- // 144 else
- // 145 wColumnAddress+=16;
- ??DteGetFaxList_11:
- ADD.W #0x10, R10
- // 146 }//for read next property pointer
- ??DteGetFaxList_12:
- ADD.B #0x1, 0x0(SP)
- JMP ??DteGetFaxList_3
- // 147
- // 148 //ucRxIndex3=gucUartRxCnt-4;
- // 149 //ucRxIndex2=gucUartRxCnt-3;
- // 150 //ucRxIndex1=gucUartRxCnt-2;
- // 151 //ucRxIndex0=gucUartRxCnt-1;
- // 152 if (0xff == aucUartRxBuf[ucRxIndex0] && 0xff == aucUartRxBuf[ucRxIndex1] &&
- // 153 0xff == aucUartRxBuf[ucRxIndex2] && 0xff == aucUartRxBuf[ucRxIndex3])
- ??DteGetFaxList_8:
- MOV.B R9, R14
- AND.W #0xff, R14
- CMP.B #0xff, aucUartRxBuf(R14)
- JNE ??DteGetFaxList_13
- MOV.B R6, R14
- AND.W #0xff, R14
- CMP.B #0xff, aucUartRxBuf(R14)
- JNE ??DteGetFaxList_13
- MOV.B R8, R14
- AND.W #0xff, R14
- CMP.B #0xff, aucUartRxBuf(R14)
- JNE ??DteGetFaxList_13
- MOV.B R4, R14
- AND.W #0xff, R14
- CMP.B #0xff, aucUartRxBuf(R14)
- JEQ ??DteGetFaxList_7
- // 154 {break;}
- // 155 }//for next page
- ??DteGetFaxList_13:
- ADD.W #0x1, R7
- JMP ??DteGetFaxList_4
- // 156 /*
- // 157 //send the 16 FaxProperty to PC (16*16=256bytes)
- // 158 ucRxIndex=0;
- // 159 for (wGeneralCnt=0;wGeneralCnt<256;wGeneralCnt++)//
- // 160 {
- // 161 SoftUartTxOneFrame(aucUartRxBuf[ucRxIndex++]);
- // 162 ucRxIndex3=ucRxIndex+3;
- // 163 ucRxIndex2=ucRxIndex+2;
- // 164 ucRxIndex1=ucRxIndex+1;
- // 165 ucRxIndex0=ucRxIndex+0;
- // 166 if (0xff == aucUartRxBuf[ucRxIndex0] && 0xff == aucUartRxBuf[ucRxIndex1] &&
- // 167 0xff == aucUartRxBuf[ucRxIndex2] && 0xff == aucUartRxBuf[ucRxIndex3])
- // 168 break;
- // 169 }
- // 170 */
- // 171 //ucRxIndex3=gucUartRxCnt-4;
- // 172 //ucRxIndex2=gucUartRxCnt-3;
- // 173 //ucRxIndex1=gucUartRxCnt-2;
- // 174 //ucRxIndex0=gucUartRxCnt-1;
- // 175 if (0xff == aucUartRxBuf[ucRxIndex0] && 0xff == aucUartRxBuf[ucRxIndex1] &&
- // 176 0xff == aucUartRxBuf[ucRxIndex2] && 0xff == aucUartRxBuf[ucRxIndex3])
- ??DteGetFaxList_7:
- MOV.B R9, R14
- AND.W #0xff, R14
- CMP.B #0xff, aucUartRxBuf(R14)
- JNE ??DteGetFaxList_14
- MOV.B R6, R14
- AND.W #0xff, R14
- CMP.B #0xff, aucUartRxBuf(R14)
- JNE ??DteGetFaxList_14
- MOV.B R8, R14
- AND.W #0xff, R14
- CMP.B #0xff, aucUartRxBuf(R14)
- JNE ??DteGetFaxList_14
- MOV.B R4, R14
- AND.W #0xff, R14
- CMP.B #0xff, aucUartRxBuf(R14)
- JEQ ??DteGetFaxList_6
- // 177 {break;}
- // 178 }//for next block
- ??DteGetFaxList_14:
- ADD.W #0x1, R5
- JMP ??DteGetFaxList_5
- // 179 gwGeneralPageAddress=wPageAddress; //for write Fax property record
- ??DteGetFaxList_6:
- MOV.W R7, &gwGeneralPageAddress
- // 180 gwColumnAddress=wColumnAddress; //for write Fax property record
- MOV.W R10, &gwColumnAddress
- // 181 SOFTUART_PORT_DIRECTION &= ~bitSOFTUARTTX;//off the SoftUart
- BIC.B #0x1, &0x36
- // 182 }
- ADD.W #0x6, SP
- CFI CFA SP+18
- BR #?Epilogue8
- CFI EndBlock cfiBlock2
- // 183
- // 184 //*************************************************************************
- RSEG CODE:CODE:NOROOT(1)
- // 185 void DteGetOneFax(unsigned int wEveryFaxHead, unsigned int wEveryFaxRear)
- DteGetOneFax:
- CFI Block cfiBlock3 Using cfiCommon0
- CFI Function DteGetOneFax
- // 186 {
- FUNCALL DteGetOneFax, READ_256_BYTE
- LOCFRAME CSTACK, 14, STACK
- FUNCALL DteGetOneFax, SoftUartTxOneFrame
- LOCFRAME CSTACK, 14, STACK
- FUNCALL DteGetOneFax, CalNextPageAddress
- LOCFRAME CSTACK, 14, STACK
- FUNCALL DteGetOneFax, CalNextPageAddress
- LOCFRAME CSTACK, 14, 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
- MOV.W R12, R6
- MOV.W R14, R10
- // 187 unsigned char ucFlashColumnAddCnt=0;
- MOV.B #0x0, R7
- // 188
- // 189 //unsigned char ucRxIndex=0;
- // 190 //unsigned char ucBlockCnt=0;
- // 191 unsigned int
- // 192 wNextPageAddress=0,wPageAddress=0,
- MOV.W #0x0, R11
- MOV.W #0x0, R8
- // 193 wGeneralCnt=0;
- MOV.W #0x0, R9
- // 194 //MODEM_BUS_CON_PORT |= SOFT_UART_2_PC;
- // 195 //SOFTUART_PORT_DIRECTION |= SOFT_UART_2_PC;
- // 196 SOFTUART_PORT_DIRECTION |= bitSOFTUARTTX;
- BIS.B #0x1, &0x36
- // 197 if (wEveryFaxHead<wEveryFaxRear)//(wEveryFaxHead!=wEveryFaxRear)//
- CMP.W R10, R6
- JC ??DteGetOneFax_5
- // 198 {
- // 199
- // 200 for (wPageAddress=wEveryFaxHead;wPageAddress<=wEveryFaxRear;)//
- MOV.W R6, R8
- ??DteGetOneFax_3:
- CMP.W R8, R10
- JNC ??DteGetOneFax_5
- // 201 {
- // 202
- // 203 ROW_ADDRESS_LOW = wPageAddress & 0xff;
- MOV.B R8, &ROW_ADDRESS_LOW
- // 204 ROW_ADDRESS_HIGH = (wPageAddress>>8) & 0xff;
- MOV.W R8, R14
- SWPB R14
- AND.W #0xff, R14
- MOV.B R14, &ROW_ADDRESS_HIGH
- // 205 for (ucFlashColumnAddCnt = 0;ucFlashColumnAddCnt < 8;ucFlashColumnAddCnt++)//8*256=2048
- MOV.B #0x0, R7
- ??DteGetOneFax_1:
- CMP.B #0x8, R7
- JC ??DteGetOneFax_6
- // 206 {
- // 207 //8 * 256 == 2048 Bytes 2^4*2^8 12bit column address HighColumnAddr:0~8
- // 208 //total 8*256B+64B=2K+64B
- // 209 COLUMN_ADDRESS_HIGH=ucFlashColumnAddCnt;
- MOV.B R7, &COLUMN_ADDRESS_HIGH
- // 210 READ_256_BYTE();//read 256 Byte to aucUartRxBuf[256]
- CALL #READ_256_BYTE
- // 211 for (wGeneralCnt=0;wGeneralCnt<256;wGeneralCnt++)//
- MOV.W #0x0, R9
- ??DteGetOneFax_0:
- CMP.W #0x100, R9
- JC ??DteGetOneFax_7
- // 212 {
- // 213 SoftUartTxOneFrame(aucUartRxBuf[wGeneralCnt]);
- MOV.B aucUartRxBuf(R9), R12
- CALL #SoftUartTxOneFrame
- // 214 if (aucUartRxBuf[wGeneralCnt-1] == 0xfb && aucUartRxBuf[wGeneralCnt-2] == 0x13 && aucUartRxBuf[wGeneralCnt-3] == 0xff)
- MOV.W #aucUartRxBuf, R14
- ADD.W R9, R14
- CMP.B #0xfb, 0xffff(R14)
- JNE ??DteGetOneFax_8
- MOV.W #aucUartRxBuf, R14
- ADD.W R9, R14
- CMP.B #0x13, 0xfffe(R14)
- JNE ??DteGetOneFax_8
- MOV.W #aucUartRxBuf, R14
- ADD.W R9, R14
- CMP.B #0xff, 0xfffd(R14)
- JNE ??DteGetOneFax_8
- // 215 {_NOP();break;}
- NOP
- JMP ??DteGetOneFax_7
- // 216 }//third for
- ??DteGetOneFax_8:
- ADD.W #0x1, R9
- JMP ??DteGetOneFax_0
- // 217 if (aucUartRxBuf[wGeneralCnt-1] == 0xfb && aucUartRxBuf[wGeneralCnt-2] == 0x13 && aucUartRxBuf[wGeneralCnt-3] == 0xff)
- ??DteGetOneFax_7:
- MOV.W #aucUartRxBuf, R14
- ADD.W R9, R14
- CMP.B #0xfb, 0xffff(R14)
- JNE ??DteGetOneFax_9
- MOV.W #aucUartRxBuf, R14
- ADD.W R9, R14
- CMP.B #0x13, 0xfffe(R14)
- JNE ??DteGetOneFax_9
- MOV.W #aucUartRxBuf, R14
- ADD.W R9, R14
- CMP.B #0xff, 0xfffd(R14)
- JEQ ??DteGetOneFax_6
- // 218 break;
- // 219 }//second for
- ??DteGetOneFax_9:
- ADD.B #0x1, R7
- JMP ??DteGetOneFax_1
- // 220
- // 221 if (aucUartRxBuf[wGeneralCnt-1] == 0xfb && aucUartRxBuf[wGeneralCnt-2] == 0x13 && aucUartRxBuf[wGeneralCnt-3] == 0xff)//pageimage over
- ??DteGetOneFax_6:
- MOV.W #aucUartRxBuf, R14
- ADD.W R9, R14
- CMP.B #0xfb, 0xffff(R14)
- JNE ??DteGetOneFax_10
- MOV.W #aucUartRxBuf, R14
- ADD.W R9, R14
- CMP.B #0x13, 0xfffe(R14)
- JNE ??DteGetOneFax_10
- MOV.W #aucUartRxBuf, R14
- ADD.W R9, R14
- CMP.B #0xff, 0xfffd(R14)
- JNE ??DteGetOneFax_10
- // 222 {
- // 223 /*//Record the front pointer for Check new in DCE
- // 224 ATcmdDelay();// a bug of Dec.23,2006 FF 10 00 0E // receive data delay(if not, can't receive 0x10 0x03)
- // 225 if ((gwGeneralPageAddress>>6) > cstFaxFrontPointerTableOverBlockNum)
- // 226 {
- // 227 for (ucBlockCnt=0;ucBlockCnt<4;ucBlockCnt++)
- // 228 {
- // 229 wPageAddress=(cstFaxFrontPointerTableStartBlockNum+ucBlockCnt)<<6;
- // 230 ROW_ADDRESS_LOW=wPageAddress & 0XFF;
- // 231 ROW_ADDRESS_HIGH=(wPageAddress>>8) & 0XFF;
- // 232 ERASE_ONE_BLOCK();
- // 233 }
- // 234 gwGeneralPageAddress = cstFaxFrontPointerTableStartPage;
- // 235 gwColumnAddress=0;
- // 236 }
- // 237
- // 238 //Record the front pointer for Check new in DCE
- // 239
- // 240 ReadLastFaxFrontPointer();
- // 241 ucRxIndex=0; //write Fax Front Pointer
- // 242 aucUartRxBuf[ucRxIndex++]=wPageAddress & 0xff;
- // 243 aucUartRxBuf[ucRxIndex++]=(wPageAddress>>8) & 0xff;
- // 244 for (ucBlockCnt=0; ucBlockCnt<12; ucBlockCnt++)
- // 245 {
- // 246 aucUartRxBuf[ucRxIndex++]=0x55;
- // 247 }
- // 248 //WriteFaxFrontPointerTable();
- // 249 Write16Bytes2FlashMemoryArea();
- // 250 */
- // 251 wPageAddress++;
- ADD.W #0x1, R8
- // 252 if(wPageAddress==0)
- CMP.W #0x0, R8
- JNE ??DteGetOneFax_2
- // 253 wPageAddress += cstFaxContentStartPage;//2560;//Mar. 1, 20007
- ADD.W #0x1400, R8
- // 254 do{
- // 255 wNextPageAddress=wPageAddress+64;
- ??DteGetOneFax_2:
- MOV.W #0x40, R14
- ADD.W R8, R14
- MOV.W R14, R11
- // 256 wPageAddress=CalNextPageAddress(wPageAddress);
- MOV.W R8, R12
- CALL #CalNextPageAddress
- MOV.W R12, R8
- // 257 }while(wNextPageAddress==wPageAddress);
- CMP.W R8, R11
- JEQ ??DteGetOneFax_2
- JMP ??DteGetOneFax_3
- // 258 //ReadLastFaxFrontPointer();//read next write fax front pointer addr //delete at Jan. 19, 2007
- // 259 continue;//break; a bug of Dec. 12,2006
- // 260 }
- // 261 wPageAddress++;
- ??DteGetOneFax_10:
- ADD.W #0x1, R8
- // 262 if(wPageAddress==0)
- CMP.W #0x0, R8
- JNE ??DteGetOneFax_4
- // 263 wPageAddress += cstFaxContentStartPage;//2560;//Mar. 1, 20007
- ADD.W #0x1400, R8
- // 264 do{
- // 265 wNextPageAddress=wPageAddress+64;//wNextPageAddress=gwPageAddress+64;
- ??DteGetOneFax_4:
- MOV.W #0x40, R14
- ADD.W R8, R14
- MOV.W R14, R11
- // 266 wPageAddress=CalNextPageAddress(wPageAddress);
- MOV.W R8, R12
- CALL #CalNextPageAddress
- MOV.W R12, R8
- // 267 }while(wNextPageAddress==wPageAddress);
- CMP.W R8, R11
- JEQ ??DteGetOneFax_4
- JMP ??DteGetOneFax_3
- // 268 }//third for ----> next page
- // 269
- // 270 }//if wNewFaxHead<wNewFaxRear
- // 271 //MODEM_BUS_CON_PORT &= ~SOFT_UART_2_PC;
- // 272 //SOFTUART_PORT_DIRECTION &= ~SOFT_UART_2_PC;
- // 273 SOFTUART_PORT_DIRECTION &= ~bitSOFTUARTTX;
- ??DteGetOneFax_5:
- BIC.B #0x1, &0x36
- // 274 }//DteGetOneFax function over
- BR #?Epilogue6
- CFI EndBlock cfiBlock3
- // 275
- // 276 /*
- // 277 void SetSystemTime(unsigned char ucYear, unsigned char ucMonth, unsigned char ucDate,
- // 278 unsigned char ucHour, unsigned char ucMinute, unsigned char ucSecond)
- // 279 {
- // 280
- // 281 ;
- // 282 }
- // 283 */
- // 284
- RSEG CODE:CODE:NOROOT(1)
- // 285 void DceResponsePc(void)
- DceResponsePc:
- CFI Block cfiBlock4 Using cfiCommon0
- CFI Function DceResponsePc
- // 286 {
- FUNCALL DceResponsePc, SoftUartTxOneFrame
- LOCFRAME CSTACK, 4, STACK
- PUSH.W R10
- CFI R10 Frame(CFA, -4)
- CFI CFA SP+4
- // 287 unsigned char ucRxIndex=0;
- MOV.B #0x0, R10
- // 288 for (ucRxIndex=0; ucRxIndex<8; ucRxIndex++)
- MOV.B #0x0, R10
- ??DceResponsePc_0:
- CMP.B #0x8, R10
- JC ??DceResponsePc_1
- // 289 SoftUartTxOneFrame(aucUartRxBuf[ucRxIndex]);
- MOV.B R10, R14
- AND.W #0xff, R14
- MOV.B aucUartRxBuf(R14), R12
- CALL #SoftUartTxOneFrame
- ADD.B #0x1, R10
- JMP ??DceResponsePc_0
- // 290 }
- ??DceResponsePc_1:
- POP.W R10
- CFI R10 SameValue
- CFI CFA SP+2
- RET
- CFI EndBlock cfiBlock4
- 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
- //
- // 1 026 bytes in segment CODE
- // 6 bytes in segment DATA16_AN
- //
- // 1 026 bytes of CODE memory
- // 0 bytes of DATA memory (+ 6 bytes shared)
- //
- //Errors: none
- //Warnings: none