DTEcmdProcess.lst
上传用户:xhjmsc
上传日期:2019-09-13
资源大小:389k
文件大小:42k
- ##############################################################################
- # #
- # IAR MSP430 C/EC++ Compiler V2.10A/W32 23/Apr/2007 18:04:07 #
- # Copyright 1996-2003 IAR Systems. All rights reserved. #
- # #
- # __rt_version = 1 #
- # __double_size = 32 #
- # __reg_r4 = free #
- # __reg_r5 = free #
- # __pic = no #
- # Source file = E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
- # filesDTEcmdProcess.c #
- # Command line = -I "C:Program FilesIAR SystemsEmbedded Workbench #
- # 3.2430INC" -I "C:Program FilesIAR #
- # SystemsEmbedded Workbench 3.2430INCCLIB" -lCN #
- # E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
- # DebugList -lA E:projectFaxProgramVson_Bryan_Fax_ #
- # Conexant_070423DebugList -o #
- # E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
- # DebugObj -z2 --no_cse --no_unroll --no_inline #
- # --no_code_motion --debug -e #
- # E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
- # filesDTEcmdProcess.c #
- # List file = E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
- # DebugListDTEcmdProcess.lst #
- # Object file = E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
- # DebugObjDTEcmdProcess.r43 #
- # #
- # #
- ##############################################################################
- 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"
- In segment DATA16_AN, at 0x28
- unsigned char const volatile __data P2IN
- P2IN:
- 000000 DS8 1
- In segment DATA16_AN, at 0x29
- unsigned char volatile __data P2OUT
- P2OUT:
- 000000 DS8 1
- In segment DATA16_AN, at 0x30
- unsigned char const volatile __data P5IN
- P5IN:
- 000000 DS8 1
- In segment DATA16_AN, at 0x32
- unsigned char volatile __data P5DIR
- P5DIR:
- 000000 DS8 1
- In segment DATA16_AN, at 0x35
- unsigned char volatile __data P6OUT
- P6OUT:
- 000000 DS8 1
- In segment DATA16_AN, at 0x36
- unsigned char volatile __data P6DIR
- P6DIR:
- 000000 DS8 1
- 14
- In segment CODE, align 2, align-sorted
- 15 void DteGetModemBus(void)
- DteGetModemBus:
- 16 {
- 17 MODEM_BUS_CON_PORT |= MODEM_BUS_2_MCU;
- 000000 F2D010003500 BIS.B #0x10, &0x35
- 18 MODEM_BUS_CON_PORT &= ~MODEM_BUS_2_PC;
- 000006 F2C23500 BIC.B #0x8, &0x35
- 19 gucViewStaticStatus &= ~bitViewReceiving;
- 00000A D2C3.... BIC.B #0x1, &aucViewData + 0x7
- 20 gucViewStaticStatus |= bitViewSending;
- 00000E E2D3.... BIS.B #0x2, &aucViewData + 0x7
- 21 ViewCommunicationTX(0x01);
- 000012 5C43 MOV.B #0x1, R12
- 000014 3040.... BR #ViewCommunicationTX
- 22
- 23 }
- 24
- 25 //*************************************************************************
- In segment CODE, align 2, keep-with-next
- 26 void DteReturnModemBus(void)
- DteReturnModemBus:
- 27 {
- 000000 0A12 PUSH.W R10
- 000002 0B12 PUSH.W R11
- 000004 0812 PUSH.W R8
- 000006 0912 PUSH.W R9
- 000008 0612 PUSH.W R6
- 28 unsigned int wGeneralCount = 0;
- 00000A 0643 MOV.W #0x0, R6
- 29 unsigned int wOKcount=0;
- 00000C 0B43 MOV.W #0x0, R11
- 30 unsigned int wNotOKcount=0;
- 00000E 0843 MOV.W #0x0, R8
- 31 unsigned char ucRxIndex1=0;
- 000010 4943 MOV.B #0x0, R9
- 32 unsigned char ucRxIndex0=0;
- 000012 4A43 MOV.B #0x0, R10
- 33
- 34 MODEM_BUS_CON_PORT |= MODEM_BUS_2_PC;
- 000014 F2D23500 BIS.B #0x8, &0x35
- 35 MODEM_BUS_CON_PORT &= ~MODEM_BUS_2_MCU;
- 000018 F2C010003500 BIC.B #0x10, &0x35
- 36 while (1)
- 37 {
- 38 ATcmdDelay();
- ??DteReturnModemBus_1:
- 00001E B012.... CALL #ATcmdDelay
- 39 SendATcmd();
- 000022 B012.... CALL #SendATcmd
- 40 ATcmdDelay();
- 000026 B012.... CALL #ATcmdDelay
- 41 ATcmdDelay();
- 00002A B012.... CALL #ATcmdDelay
- 42
- 43 while (wGeneralCount++<0xffff)
- ??DteReturnModemBus_0:
- 00002E 0E46 MOV.W R6, R14
- 000030 1643 MOV.W #0x1, R6
- 000032 065E ADD.W R14, R6
- 000034 3E93 CMP.W #0xffff, R14
- 000036 2224 JEQ ??DteReturnModemBus_2
- 44 {
- 45 ucRxIndex1=gucUartRxCnt-3;
- 000038 7E40FD00 MOV.B #0xfd, R14
- 00003C 5E52.... ADD.B &gucUartRxCnt, R14
- 000040 494E MOV.B R14, R9
- 46 ucRxIndex0=gucUartRxCnt-2;
- 000042 7E40FE00 MOV.B #0xfe, R14
- 000046 5E52.... ADD.B &gucUartRxCnt, R14
- 00004A 4A4E MOV.B R14, R10
- 47 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
- 00004C 3AF0FF00 AND.W #0xff, R10
- 000050 FA900D00.... CMP.B #0xd, aucUartRxBuf(R10)
- 000056 0820 JNE ??DteReturnModemBus_3
- 000058 39F0FF00 AND.W #0xff, R9
- 00005C F9904B00.... CMP.B #0x4b, aucUartRxBuf(R9)
- 000062 0220 JNE ??DteReturnModemBus_3
- 48 {wOKcount++;break;}
- 000064 1B53 ADD.W #0x1, R11
- 000066 0A3C JMP ??DteReturnModemBus_2
- 49 if (wGeneralCount==0xffff)
- ??DteReturnModemBus_3:
- 000068 3693 CMP.W #0xffff, R6
- 00006A E123 JNE ??DteReturnModemBus_0
- 50 {
- 51 //wGeneralCount=0;
- 52 wNotOKcount++;
- 00006C 1853 ADD.W #0x1, R8
- 53 SendATcmdModemSoftReset();
- 00006E B012.... CALL #SendATcmdModemSoftReset
- 54 ATcmdDelay();
- 000072 B012.... CALL #ATcmdDelay
- 55 ATcmdDelay();
- 000076 B012.... CALL #ATcmdDelay
- 00007A D93F JMP ??DteReturnModemBus_0
- 56 }//if
- 57 }//while
- 58 ucRxIndex1=gucUartRxCnt-3;
- ??DteReturnModemBus_2:
- 00007C 7E40FD00 MOV.B #0xfd, R14
- 000080 5E52.... ADD.B &gucUartRxCnt, R14
- 000084 494E MOV.B R14, R9
- 59 ucRxIndex0=gucUartRxCnt-2;
- 000086 7E40FE00 MOV.B #0xfe, R14
- 00008A 5E52.... ADD.B &gucUartRxCnt, R14
- 00008E 4A4E MOV.B R14, R10
- 60 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
- 000090 3AF0FF00 AND.W #0xff, R10
- 000094 FA900D00.... CMP.B #0xd, aucUartRxBuf(R10)
- 00009A C123 JNE ??DteReturnModemBus_1
- 00009C 39F0FF00 AND.W #0xff, R9
- 0000A0 F9904B00.... CMP.B #0x4b, aucUartRxBuf(R9)
- 0000A6 BB23 JNE ??DteReturnModemBus_1
- 61 {wOKcount++;break;}
- 0000A8 1B53 ADD.W #0x1, R11
- 62 }//while
- 63
- 64 _NOP();
- 0000AA 0343 NOP
- 65 gucViewStaticStatus |= bitViewReceiving;
- 0000AC D2D3.... BIS.B #0x1, &aucViewData + 0x7
- 66 gucViewStaticStatus &= ~bitViewSending;
- 0000B0 E2C3.... BIC.B #0x2, &aucViewData + 0x7
- 67 ViewCommunicationTX(0x01);
- 0000B4 5C43 MOV.B #0x1, R12
- 0000B6 B012.... CALL #ViewCommunicationTX
- 68 }
- 0000BA 3040.... BR #?Epilogue5
- 69
- 70
- 71 //*************************************************************************
- In segment CODE, align 2, keep-with-next
- 72 void DteGetFaxList(void)
- DteGetFaxList:
- 73 {
- 000000 0A12 PUSH.W R10
- 000002 0B12 PUSH.W R11
- 000004 0812 PUSH.W R8
- 000006 0912 PUSH.W R9
- 000008 0612 PUSH.W R6
- 00000A 0712 PUSH.W R7
- 00000C 0412 PUSH.W R4
- 00000E 0512 PUSH.W R5
- 000010 31800600 SUB.W #0x6, SP
- 74 unsigned int wPageAddress=0, wBlockAddress=0,
- 000014 0743 MOV.W #0x0, R7
- 000016 0543 MOV.W #0x0, R5
- 75 wColumnAddress=0,wNextPageAddress=0,
- 000018 0A43 MOV.W #0x0, R10
- 00001A 81430200 MOV.W #0x0, 0x2(SP)
- 76 wRearPntCnt=0;
- 00001E 81430400 MOV.W #0x0, 0x4(SP)
- 77 unsigned char ucRxIndex=0,
- 000022 4B43 MOV.B #0x0, R11
- 78 ucGeneralCnt=0,ucFaxPropertyLenCnt,
- 000024 C1430000 MOV.B #0x0, 0x0(SP)
- 79 ucRxIndex3=0,ucRxIndex2=0,
- 000028 4443 MOV.B #0x0, R4
- 00002A 4843 MOV.B #0x0, R8
- 80 ucRxIndex0=0,ucRxIndex1=0;
- 00002C 4943 MOV.B #0x0, R9
- 00002E 4643 MOV.B #0x0, R6
- 81
- 82 SOFTUART_PORT_DIRECTION |= bitSOFTUARTTX;//set SOFTUARTTX open SoftUart TX
- 000030 D2D33600 BIS.B #0x1, &0x36
- 83 for (wBlockAddress=cstFaxPropertyTableStartBlockNum;
- 000034 1543 MOV.W #0x1, R5
- 84 wBlockAddress<=cstFaxPropertyTableOverBlockNum;wBlockAddress++)
- ??DteGetFaxList_5:
- 000036 35900B00 CMP.W #0xb, R5
- 00003A CE2C JC ??DteGetFaxList_6
- 85 {
- 86 //1 block==64pages
- 87 for (wPageAddress=(wBlockAddress<<6);wPageAddress<((wBlockAddress<<6)+64);wPageAddress++)
- 00003C 0C45 MOV.W R5, R12
- 00003E B012.... CALL #?ShiftLeft16_6
- 000042 074C MOV.W R12, R7
- ??DteGetFaxList_4:
- 000044 0C45 MOV.W R5, R12
- 000046 B012.... CALL #?ShiftLeft16_6
- 00004A 3C504000 ADD.W #0x40, R12
- 00004E 079C CMP.W R12, R7
- 000050 A92C JC ??DteGetFaxList_7
- 88 {
- 89 do{
- 90 wNextPageAddress=wPageAddress+64;
- ??DteGetFaxList_0:
- 000052 3E404000 MOV.W #0x40, R14
- 000056 0E57 ADD.W R7, R14
- 000058 814E0200 MOV.W R14, 0x2(SP)
- 91 wPageAddress=CalNextPageAddress(wPageAddress);
- 00005C 0C47 MOV.W R7, R12
- 00005E B012.... CALL #CalNextPageAddress
- 000062 074C MOV.W R12, R7
- 92 }while(wNextPageAddress==wPageAddress);
- 000064 81970200 CMP.W R7, 0x2(SP)
- 000068 F427 JEQ ??DteGetFaxList_0
- 93
- 94 wColumnAddress=0;
- 00006A 0A43 MOV.W #0x0, R10
- 95 ROW_ADDRESS_LOW=wPageAddress & 0XFF;
- 00006C C247.... MOV.B R7, &ROW_ADDRESS_LOW
- 96 ROW_ADDRESS_HIGH=(wPageAddress>>8) & 0XFF;
- 000070 0E47 MOV.W R7, R14
- 000072 8E10 SWPB R14
- 000074 3EF0FF00 AND.W #0xff, R14
- 000078 C24E.... 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++)
- 00007C C1430000 MOV.B #0x0, 0x0(SP)
- ??DteGetFaxList_3:
- 000080 F1920000 CMP.B #0x8, 0x0(SP)
- 000084 752C JC ??DteGetFaxList_8
- 101 {
- 102 //COMMAND
- 103 COMMAND_VAL=0x00; //#0X00 //00H READ1 0-2111BYTE
- 000086 C243.... MOV.B #0x0, &COMMAND_VAL
- 104 COMMAND_LATCH_INTO();
- 00008A B012.... CALL #COMMAND_LATCH_INTO
- 105 //ADDRESS
- 106
- 107 ADDRESS_VALUE=wColumnAddress & 0xff;//COLUMN_ADDRESS_LOW;
- 00008E C24A.... MOV.B R10, &ADDRESS_VALUE
- 108 ADDRESS_LATCH_INTO();
- 000092 B012.... CALL #ADDRESS_LATCH_INTO
- 109
- 110 ADDRESS_VALUE=(wColumnAddress>>8) & 0XFF;//COLUMN_ADDRESS_HIGH;
- 000096 0E4A MOV.W R10, R14
- 000098 8E10 SWPB R14
- 00009A 3EF0FF00 AND.W #0xff, R14
- 00009E C24E.... MOV.B R14, &ADDRESS_VALUE
- 111 ADDRESS_LATCH_INTO();
- 0000A2 B012.... CALL #ADDRESS_LATCH_INTO
- 112
- 113 ADDRESS_VALUE=ROW_ADDRESS_LOW;
- 0000A6 D242........ MOV.B &ROW_ADDRESS_LOW, &ADDRESS_VALUE
- 114 ADDRESS_LATCH_INTO();
- 0000AC B012.... CALL #ADDRESS_LATCH_INTO
- 115
- 116 ADDRESS_VALUE=ROW_ADDRESS_HIGH;
- 0000B0 D242........ MOV.B &ROW_ADDRESS_HIGH, &ADDRESS_VALUE
- 117 ADDRESS_LATCH_INTO();
- 0000B6 B012.... CALL #ADDRESS_LATCH_INTO
- 118 FLASH_CON_PORT_OUT &=~ ALE;
- 0000BA E2C32900 BIC.B #0x2, &0x29
- 119
- 120 COMMAND_VAL=0X30;
- 0000BE F2403000.... MOV.B #0x30, &COMMAND_VAL
- 121 COMMAND_LATCH_INTO();
- 0000C4 B012.... CALL #COMMAND_LATCH_INTO
- 122 //ATcmdDelay();
- 123 while((FLASH_CON_PORT_IN & RB)==0);
- ??DteGetFaxList_1:
- 0000C8 F2B020002800 BIT.B #0x20, &0x28
- 0000CE FC2B JNC ??DteGetFaxList_1
- 124 DATA_PORT_IN_INITIAL;
- 0000D0 C2433200 MOV.B #0x0, &0x32
- 125 for (ucFaxPropertyLenCnt=0;ucFaxPropertyLenCnt<16;ucFaxPropertyLenCnt++)
- 0000D4 C1430100 MOV.B #0x0, 0x1(SP)
- ??DteGetFaxList_2:
- 0000D8 F19010000100 CMP.B #0x10, 0x1(SP)
- 0000DE 142C JC ??DteGetFaxList_9
- 126 {
- 127 FLASH_CON_PORT_OUT &=~ RE; //RE IS LOW,ENABLE READ DATA
- 0000E0 F2C010002900 BIC.B #0x10, &0x29
- 128 SoftUartTxOneFrame(DATA_PORT_IN);//add at Jan. 25, 2007
- 0000E6 5C423000 MOV.B &0x30, R12
- 0000EA B012.... CALL #SoftUartTxOneFrame
- 129 aucUartRxBuf[ucRxIndex++]=DATA_PORT_IN;
- 0000EE 4E4B MOV.B R11, R14
- 0000F0 3EF0FF00 AND.W #0xff, R14
- 0000F4 DE423000.... MOV.B &0x30, aucUartRxBuf(R14)
- 0000FA 5B53 ADD.B #0x1, R11
- 130 FLASH_CON_PORT_OUT |= RE;
- 0000FC F2D010002900 BIS.B #0x10, &0x29
- 131 }
- 000102 D1530100 ADD.B #0x1, 0x1(SP)
- 000106 E83F JMP ??DteGetFaxList_2
- 132 wRearPntCnt++;
- ??DteGetFaxList_9:
- 000108 91530400 ADD.W #0x1, 0x4(SP)
- 133 ucRxIndex3=ucRxIndex-4;
- 00010C 7E40FC00 MOV.B #0xfc, R14
- 000110 4E5B ADD.B R11, R14
- 000112 444E MOV.B R14, R4
- 134 ucRxIndex2=ucRxIndex-3;
- 000114 7E40FD00 MOV.B #0xfd, R14
- 000118 4E5B ADD.B R11, R14
- 00011A 484E MOV.B R14, R8
- 135 ucRxIndex1=ucRxIndex-2;
- 00011C 7E40FE00 MOV.B #0xfe, R14
- 000120 4E5B ADD.B R11, R14
- 000122 464E MOV.B R14, R6
- 136 ucRxIndex0=ucRxIndex-1;
- 000124 7E43 MOV.B #0xff, R14
- 000126 4E5B ADD.B R11, R14
- 000128 494E MOV.B R14, R9
- 137 if (0xff == aucUartRxBuf[ucRxIndex0] && 0xff == aucUartRxBuf[ucRxIndex1] &&
- 138 0xff == aucUartRxBuf[ucRxIndex2] && 0xff == aucUartRxBuf[ucRxIndex3])
- 00012A 4E49 MOV.B R9, R14
- 00012C 3EF0FF00 AND.W #0xff, R14
- 000130 FE93.... CMP.B #0xff, aucUartRxBuf(R14)
- 000134 1220 JNE ??DteGetFaxList_10
- 000136 4E46 MOV.B R6, R14
- 000138 3EF0FF00 AND.W #0xff, R14
- 00013C FE93.... CMP.B #0xff, aucUartRxBuf(R14)
- 000140 0C20 JNE ??DteGetFaxList_10
- 000142 4E48 MOV.B R8, R14
- 000144 3EF0FF00 AND.W #0xff, R14
- 000148 FE93.... CMP.B #0xff, aucUartRxBuf(R14)
- 00014C 0620 JNE ??DteGetFaxList_10
- 00014E 4E44 MOV.B R4, R14
- 000150 3EF0FF00 AND.W #0xff, R14
- 000154 FE93.... CMP.B #0xff, aucUartRxBuf(R14)
- 000158 0B24 JEQ ??DteGetFaxList_8
- 139 {
- 140 break; //next rear
- 141 }//if
- 142 if (ucGeneralCnt<4)
- ??DteGetFaxList_10:
- 00015A E1920000 CMP.B #0x4, 0x0(SP)
- 00015E 032C JC ??DteGetFaxList_11
- 143 wColumnAddress+=512;
- 000160 3A500002 ADD.W #0x200, R10
- 000164 023C JMP ??DteGetFaxList_12
- 144 else
- 145 wColumnAddress+=16;
- ??DteGetFaxList_11:
- 000166 3A501000 ADD.W #0x10, R10
- 146 }//for read next property pointer
- ??DteGetFaxList_12:
- 00016A D1530000 ADD.B #0x1, 0x0(SP)
- 00016E 883F 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:
- 000170 4E49 MOV.B R9, R14
- 000172 3EF0FF00 AND.W #0xff, R14
- 000176 FE93.... CMP.B #0xff, aucUartRxBuf(R14)
- 00017A 1220 JNE ??DteGetFaxList_13
- 00017C 4E46 MOV.B R6, R14
- 00017E 3EF0FF00 AND.W #0xff, R14
- 000182 FE93.... CMP.B #0xff, aucUartRxBuf(R14)
- 000186 0C20 JNE ??DteGetFaxList_13
- 000188 4E48 MOV.B R8, R14
- 00018A 3EF0FF00 AND.W #0xff, R14
- 00018E FE93.... CMP.B #0xff, aucUartRxBuf(R14)
- 000192 0620 JNE ??DteGetFaxList_13
- 000194 4E44 MOV.B R4, R14
- 000196 3EF0FF00 AND.W #0xff, R14
- 00019A FE93.... CMP.B #0xff, aucUartRxBuf(R14)
- 00019E 0224 JEQ ??DteGetFaxList_7
- 154 {break;}
- 155 }//for next page
- ??DteGetFaxList_13:
- 0001A0 1753 ADD.W #0x1, R7
- 0001A2 503F 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:
- 0001A4 4E49 MOV.B R9, R14
- 0001A6 3EF0FF00 AND.W #0xff, R14
- 0001AA FE93.... CMP.B #0xff, aucUartRxBuf(R14)
- 0001AE 1220 JNE ??DteGetFaxList_14
- 0001B0 4E46 MOV.B R6, R14
- 0001B2 3EF0FF00 AND.W #0xff, R14
- 0001B6 FE93.... CMP.B #0xff, aucUartRxBuf(R14)
- 0001BA 0C20 JNE ??DteGetFaxList_14
- 0001BC 4E48 MOV.B R8, R14
- 0001BE 3EF0FF00 AND.W #0xff, R14
- 0001C2 FE93.... CMP.B #0xff, aucUartRxBuf(R14)
- 0001C6 0620 JNE ??DteGetFaxList_14
- 0001C8 4E44 MOV.B R4, R14
- 0001CA 3EF0FF00 AND.W #0xff, R14
- 0001CE FE93.... CMP.B #0xff, aucUartRxBuf(R14)
- 0001D2 0224 JEQ ??DteGetFaxList_6
- 177 {break;}
- 178 }//for next block
- ??DteGetFaxList_14:
- 0001D4 1553 ADD.W #0x1, R5
- 0001D6 2F3F JMP ??DteGetFaxList_5
- 179 gwGeneralPageAddress=wPageAddress; //for write Fax property record
- ??DteGetFaxList_6:
- 0001D8 8247.... MOV.W R7, &gwGeneralPageAddress
- 180 gwColumnAddress=wColumnAddress; //for write Fax property record
- 0001DC 824A.... MOV.W R10, &gwColumnAddress
- 181 SOFTUART_PORT_DIRECTION &= ~bitSOFTUARTTX;//off the SoftUart
- 0001E0 D2C33600 BIC.B #0x1, &0x36
- 182 }
- 0001E4 31500600 ADD.W #0x6, SP
- 0001E8 3040.... BR #?Epilogue8
- 183
- 184 //*************************************************************************
- In segment CODE, align 2, keep-with-next
- 185 void DteGetOneFax(unsigned int wEveryFaxHead, unsigned int wEveryFaxRear)
- DteGetOneFax:
- 186 {
- 000000 0A12 PUSH.W R10
- 000002 0B12 PUSH.W R11
- 000004 0812 PUSH.W R8
- 000006 0912 PUSH.W R9
- 000008 0612 PUSH.W R6
- 00000A 0712 PUSH.W R7
- 00000C 064C MOV.W R12, R6
- 00000E 0A4E MOV.W R14, R10
- 187 unsigned char ucFlashColumnAddCnt=0;
- 000010 4743 MOV.B #0x0, R7
- 188
- 189 //unsigned char ucRxIndex=0;
- 190 //unsigned char ucBlockCnt=0;
- 191 unsigned int
- 192 wNextPageAddress=0,wPageAddress=0,
- 000012 0B43 MOV.W #0x0, R11
- 000014 0843 MOV.W #0x0, R8
- 193 wGeneralCnt=0;
- 000016 0943 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;
- 000018 D2D33600 BIS.B #0x1, &0x36
- 197 if (wEveryFaxHead<wEveryFaxRear)//(wEveryFaxHead!=wEveryFaxRear)//
- 00001C 069A CMP.W R10, R6
- 00001E 7C2C JC ??DteGetOneFax_5
- 198 {
- 199
- 200 for (wPageAddress=wEveryFaxHead;wPageAddress<=wEveryFaxRear;)//
- 000020 0846 MOV.W R6, R8
- ??DteGetOneFax_3:
- 000022 0A98 CMP.W R8, R10
- 000024 7928 JNC ??DteGetOneFax_5
- 201 {
- 202
- 203 ROW_ADDRESS_LOW = wPageAddress & 0xff;
- 000026 C248.... MOV.B R8, &ROW_ADDRESS_LOW
- 204 ROW_ADDRESS_HIGH = (wPageAddress>>8) & 0xff;
- 00002A 0E48 MOV.W R8, R14
- 00002C 8E10 SWPB R14
- 00002E 3EF0FF00 AND.W #0xff, R14
- 000032 C24E.... MOV.B R14, &ROW_ADDRESS_HIGH
- 205 for (ucFlashColumnAddCnt = 0;ucFlashColumnAddCnt < 8;ucFlashColumnAddCnt++)//8*256=2048
- 000036 4743 MOV.B #0x0, R7
- ??DteGetOneFax_1:
- 000038 7792 CMP.B #0x8, R7
- 00003A 3A2C 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;
- 00003C C247.... MOV.B R7, &COLUMN_ADDRESS_HIGH
- 210 READ_256_BYTE();//read 256 Byte to aucUartRxBuf[256]
- 000040 B012.... CALL #READ_256_BYTE
- 211 for (wGeneralCnt=0;wGeneralCnt<256;wGeneralCnt++)//
- 000044 0943 MOV.W #0x0, R9
- ??DteGetOneFax_0:
- 000046 39900001 CMP.W #0x100, R9
- 00004A 1C2C JC ??DteGetOneFax_7
- 212 {
- 213 SoftUartTxOneFrame(aucUartRxBuf[wGeneralCnt]);
- 00004C 5C49.... MOV.B aucUartRxBuf(R9), R12
- 000050 B012.... CALL #SoftUartTxOneFrame
- 214 if (aucUartRxBuf[wGeneralCnt-1] == 0xfb && aucUartRxBuf[wGeneralCnt-2] == 0x13 && aucUartRxBuf[wGeneralCnt-3] == 0xff)
- 000054 3E40.... MOV.W #aucUartRxBuf, R14
- 000058 0E59 ADD.W R9, R14
- 00005A FE90FB00FFFF CMP.B #0xfb, 0xffff(R14)
- 000060 0F20 JNE ??DteGetOneFax_8
- 000062 3E40.... MOV.W #aucUartRxBuf, R14
- 000066 0E59 ADD.W R9, R14
- 000068 FE901300FEFF CMP.B #0x13, 0xfffe(R14)
- 00006E 0820 JNE ??DteGetOneFax_8
- 000070 3E40.... MOV.W #aucUartRxBuf, R14
- 000074 0E59 ADD.W R9, R14
- 000076 FE93FDFF CMP.B #0xff, 0xfffd(R14)
- 00007A 0220 JNE ??DteGetOneFax_8
- 215 {_NOP();break;}
- 00007C 0343 NOP
- 00007E 023C JMP ??DteGetOneFax_7
- 216 }//third for
- ??DteGetOneFax_8:
- 000080 1953 ADD.W #0x1, R9
- 000082 E13F JMP ??DteGetOneFax_0
- 217 if (aucUartRxBuf[wGeneralCnt-1] == 0xfb && aucUartRxBuf[wGeneralCnt-2] == 0x13 && aucUartRxBuf[wGeneralCnt-3] == 0xff)
- ??DteGetOneFax_7:
- 000084 3E40.... MOV.W #aucUartRxBuf, R14
- 000088 0E59 ADD.W R9, R14
- 00008A FE90FB00FFFF CMP.B #0xfb, 0xffff(R14)
- 000090 0D20 JNE ??DteGetOneFax_9
- 000092 3E40.... MOV.W #aucUartRxBuf, R14
- 000096 0E59 ADD.W R9, R14
- 000098 FE901300FEFF CMP.B #0x13, 0xfffe(R14)
- 00009E 0620 JNE ??DteGetOneFax_9
- 0000A0 3E40.... MOV.W #aucUartRxBuf, R14
- 0000A4 0E59 ADD.W R9, R14
- 0000A6 FE93FDFF CMP.B #0xff, 0xfffd(R14)
- 0000AA 0224 JEQ ??DteGetOneFax_6
- 218 break;
- 219 }//second for
- ??DteGetOneFax_9:
- 0000AC 5753 ADD.B #0x1, R7
- 0000AE C43F JMP ??DteGetOneFax_1
- 220
- 221 if (aucUartRxBuf[wGeneralCnt-1] == 0xfb && aucUartRxBuf[wGeneralCnt-2] == 0x13 && aucUartRxBuf[wGeneralCnt-3] == 0xff)//pageimage over
- ??DteGetOneFax_6:
- 0000B0 3E40.... MOV.W #aucUartRxBuf, R14
- 0000B4 0E59 ADD.W R9, R14
- 0000B6 FE90FB00FFFF CMP.B #0xfb, 0xffff(R14)
- 0000BC 1D20 JNE ??DteGetOneFax_10
- 0000BE 3E40.... MOV.W #aucUartRxBuf, R14
- 0000C2 0E59 ADD.W R9, R14
- 0000C4 FE901300FEFF CMP.B #0x13, 0xfffe(R14)
- 0000CA 1620 JNE ??DteGetOneFax_10
- 0000CC 3E40.... MOV.W #aucUartRxBuf, R14
- 0000D0 0E59 ADD.W R9, R14
- 0000D2 FE93FDFF CMP.B #0xff, 0xfffd(R14)
- 0000D6 1020 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++;
- 0000D8 1853 ADD.W #0x1, R8
- 252 if(wPageAddress==0)
- 0000DA 0893 CMP.W #0x0, R8
- 0000DC 0220 JNE ??DteGetOneFax_2
- 253 wPageAddress += cstFaxContentStartPage;//2560;//Mar. 1, 20007
- 0000DE 38500014 ADD.W #0x1400, R8
- 254 do{
- 255 wNextPageAddress=wPageAddress+64;
- ??DteGetOneFax_2:
- 0000E2 3E404000 MOV.W #0x40, R14
- 0000E6 0E58 ADD.W R8, R14
- 0000E8 0B4E MOV.W R14, R11
- 256 wPageAddress=CalNextPageAddress(wPageAddress);
- 0000EA 0C48 MOV.W R8, R12
- 0000EC B012.... CALL #CalNextPageAddress
- 0000F0 084C MOV.W R12, R8
- 257 }while(wNextPageAddress==wPageAddress);
- 0000F2 0B98 CMP.W R8, R11
- 0000F4 F627 JEQ ??DteGetOneFax_2
- 0000F6 953F 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:
- 0000F8 1853 ADD.W #0x1, R8
- 262 if(wPageAddress==0)
- 0000FA 0893 CMP.W #0x0, R8
- 0000FC 0220 JNE ??DteGetOneFax_4
- 263 wPageAddress += cstFaxContentStartPage;//2560;//Mar. 1, 20007
- 0000FE 38500014 ADD.W #0x1400, R8
- 264 do{
- 265 wNextPageAddress=wPageAddress+64;//wNextPageAddress=gwPageAddress+64;
- ??DteGetOneFax_4:
- 000102 3E404000 MOV.W #0x40, R14
- 000106 0E58 ADD.W R8, R14
- 000108 0B4E MOV.W R14, R11
- 266 wPageAddress=CalNextPageAddress(wPageAddress);
- 00010A 0C48 MOV.W R8, R12
- 00010C B012.... CALL #CalNextPageAddress
- 000110 084C MOV.W R12, R8
- 267 }while(wNextPageAddress==wPageAddress);
- 000112 0B98 CMP.W R8, R11
- 000114 F627 JEQ ??DteGetOneFax_4
- 000116 853F 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:
- 000118 D2C33600 BIC.B #0x1, &0x36
- 274 }//DteGetOneFax function over
- 00011C 3040.... BR #?Epilogue6
- 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
- In segment CODE, align 2, keep-with-next
- 285 void DceResponsePc(void)
- DceResponsePc:
- 286 {
- 000000 0A12 PUSH.W R10
- 287 unsigned char ucRxIndex=0;
- 000002 4A43 MOV.B #0x0, R10
- 288 for (ucRxIndex=0; ucRxIndex<8; ucRxIndex++)
- 000004 4A43 MOV.B #0x0, R10
- ??DceResponsePc_0:
- 000006 7A92 CMP.B #0x8, R10
- 000008 092C JC ??DceResponsePc_1
- 289 SoftUartTxOneFrame(aucUartRxBuf[ucRxIndex]);
- 00000A 4E4A MOV.B R10, R14
- 00000C 3EF0FF00 AND.W #0xff, R14
- 000010 5C4E.... MOV.B aucUartRxBuf(R14), R12
- 000014 B012.... CALL #SoftUartTxOneFrame
- 000018 5A53 ADD.B #0x1, R10
- 00001A F53F JMP ??DceResponsePc_0
- 290 }
- ??DceResponsePc_1:
- 00001C 3A41 POP.W R10
- 00001E 3041 RET
- Maximum stack usage in bytes:
- Function CSTACK
- -------- ------
- DceResponsePc 4
- -> SoftUartTxOneFrame 4
- DteGetFaxList 24
- -> CalNextPageAddress 24
- -> COMMAND_LATCH_INTO 24
- -> ADDRESS_LATCH_INTO 24
- -> ADDRESS_LATCH_INTO 24
- -> ADDRESS_LATCH_INTO 24
- -> ADDRESS_LATCH_INTO 24
- -> COMMAND_LATCH_INTO 24
- -> SoftUartTxOneFrame 24
- DteGetModemBus 2
- -> ViewCommunicationTX 2
- DteGetOneFax 14
- -> READ_256_BYTE 14
- -> SoftUartTxOneFrame 14
- -> CalNextPageAddress 14
- -> CalNextPageAddress 14
- DteReturnModemBus 12
- -> ATcmdDelay 12
- -> SendATcmd 12
- -> ATcmdDelay 12
- -> ATcmdDelay 12
- -> SendATcmdModemSoftReset 12
- -> ATcmdDelay 12
- -> ATcmdDelay 12
- -> ViewCommunicationTX 12
- Segment part sizes:
- Function/Label Bytes
- -------------- -----
- P2IN 1
- P2OUT 1
- P5IN 1
- P5DIR 1
- P6OUT 1
- P6DIR 1
- DteGetModemBus 24
- DteReturnModemBus 190
- DteGetFaxList 492
- DteGetOneFax 288
- DceResponsePc 32
-
- 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