main.lst
上传用户:xhjmsc
上传日期:2019-09-13
资源大小:389k
文件大小:90k
- ##############################################################################
- # #
- # IAR MSP430 C/EC++ Compiler V2.10A/W32 23/Apr/2007 18:06:22 #
- # 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 #
- # filesmain.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 #
- # filesmain.c #
- # List file = E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
- # DebugListmain.lst #
- # Object file = E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
- # DebugObjmain.r43 #
- # #
- # #
- ##############################################################################
- E:projectFaxProgramVson_Bryan_Fax_Conexant_070423filesmain.c
- 1 /************************************************
- 2 Network 3G Fax
- 3 Copyright 2006 by Vson. All rights reserved.
- 4 Author: Bryan Cai
- 5 Date: 2006.09.04
- 6 Description: Carry out a Network 3G Fax with Conexant CX06833.
- 7 Note:
- 8 Identifier abbreviation:
- 9 c-const
- 10 a-array
- 11 p-pointer
- 12 g-global
- 13 uc-unsigned char
- 14 w-unsigned int
- 15 cnt-count
- 16 pnt-point
- 17 Update:
- 18 2007.04.12 Bryan Concise the FaxManager program
- 19 2007.03.20 Bryan Complete all DTE command function
- 20 2007.03.16 Bryan Fast exit RxProcess when error occur.
- 21 2007.01.03 Bryan Add Modem RX parameter set
- 22 2006.12.27 Bryan add RX multi imagepages
- 23 2006.12.22 Bryan Flash I/O changed
- 24 2006.11.02 Bryan program header
- 25
- 26 ************************************************/
- 27
- 28
- 29 #include "includeH.h"
- In segment DATA16_AN, at 0x120
- unsigned short volatile __data WDTCTL
- WDTCTL:
- 000000 DS8 2
- In segment DATA16_AN, at 0x20
- unsigned char const volatile __data P1IN
- P1IN:
- 000000 DS8 1
- In segment DATA16_AN, at 0x21
- unsigned char volatile __data P1OUT
- P1OUT:
- 000000 DS8 1
- In segment DATA16_AN, at 0x22
- unsigned char volatile __data P1DIR
- P1DIR:
- 000000 DS8 1
- In segment DATA16_AN, at 0x36
- unsigned char volatile __data P6DIR
- P6DIR:
- 000000 DS8 1
- 30
- 31
- 32
- 33 //interrupt [USART0TX_VECTOR] void intUartTx(void);
- 34 //interrupt [USART0RX_VECTOR] void intUartRx(void);
- 35
- 36 /* AT command Set
- 37 unsigned char ATcmdPrefix[]={0x41,0x54}, ATcmdSuffix[]={0x0D},
- 38 //ATFS0[]={0x26,0x46,0x53,0x30,0x3d,0x30,0x45,0x31,0x56,0x31,0x51,0x30},
- 39 //ATS7[]={0x53,0x37,0x3d,0x36,0x30,0x26,0x44,0x33,0x26,0x4b,0x34},
- 40 //ATX4M1L0[]={0x58,0x34,0x4d,0x31,0x4c,0x30},
- 41 //FCLASS[]={0x2b,0x46,0x43,0x4c,0x41,0x53,0x53,0x3d,0x31},
- 42 //FCLASS0[]={0x2b,0x46,0x43,0x4c,0x41,0x53,0x53,0x3d,0x30},
- 43
- 44
- 45 ATS0RX[]={0x53,0x30,0x3d,0x30},
- 46 DT[]={0x44,0x54,0x39,0x36,0x31,0x31,0x33,0x39,0x35,0x30,0x39},
- 47 A[]={0x41},
- 48 //DT[]={0x44,0x54,0x39,0x30,0x37,0x39,0x37,0x36,0x39,0x30,0x35,0x31,0x39,0x31},
- 49 FRH[]={0x2b,0x46,0x52,0x48,0x3d,0x33,0x0d},
- 50 FTH[]={0x2b,0x46,0x54,0x48,0x3d,0x33,0x0d},
- 51 //FTHNSF[]={0xff,0x03,0x54,0x47,0x46,0x33,0x36,0x36,0x43,0x00,0x77,0x9C,0x10,0x03},
- 52 //for TX
- 53 FTHTSI[]={0xff,0x03,0x43,0x78,0x61,0x46,0x10,0x03},
- 54 FTHDCS[]={0xff,0x13,0x83,0x00,0x46,0x78,0x10,0x03},//for TX
- 55 //for RX
- 56 //FTHCSI[]={0xff,0x03,0x40,0x78,0x61,0x46,0x10,0x03},//@Fax
- 57 FTHCSI[]={0xff,0x03,0x40,0x36,0x33,0x38,0x10,0x03},//@836
- 58 FTHDIS[]={0xff,0x13,0x80,0x00,0xee,0x78,0x10,0x03},//for RX ee 78
- 59 //FTHDIS[]={0xff,0x13,0x80,0x00,0x46,0x70,0x10,0x03},//for RX ee 78
- 60 //FTHCSI[]={0xff,0x03,0x40,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x36,0x33,0x38,0x10,0x03},//@Fax
- 61 //FTHDIS[]={0xff,0x13,0x80,0x00,0xee,0x78,0x10,0x03},//for RX ee 78
- 62 FTHCFR[]={0xff,0x13,0x84,0x10,0x03},// Confirmation to receive MSB 21H LSB 83H
- 63 FTHMCF[]={0xff,0x13,0x8C,0x10,0x03},// Message Confirmation MSB 31H LSB 8CH
- 64 FTHEOP[]={0xff,0x13,0x2f,0x10,0x03},
- 65 FTHDNC[]={0xff,0x13,0xfb,0x10,0x03},
- 66 FTHEOM[]={0xff,0x03,0x43,0x78,0x61,0x46,0x10,0x03},
- 67 FTS[]={0x2b,0x46,0x54,0x53,0x3d,0x38},
- 68 FTM[]={0x2b,0x46,0x54,0x4d,0x3d,0x39,0x36},
- 69 //FRM[]={0x2b,0x46,0x52,0x4d,0x3d,0x31,0x34,0x35},
- 70 FRM[]={0x2b,0x46,0x52,0x4d,0x3d,0x39,0x36},
- 71 H0[]={0x48,0x00},
- 72 TerminalFlag[]={0x10,0x03};
- 73 */
- 74
- 75
- 76
- In segment CODE, align 2, keep-with-next
- 77 void main(void)
- main:
- 78 {
- 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 31800C00 SUB.W #0xc, SP
- 79
- 80
- 81 unsigned int wGeneralCount = 0,
- 000014 81430000 MOV.W #0x0, 0x0(SP)
- 82 wOKcount=0,
- 000018 81430800 MOV.W #0x0, 0x8(SP)
- 83 wNotOKcount=0,
- 00001C 81430A00 MOV.W #0x0, 0xa(SP)
- 84 wOneFaxHead=0,
- 000020 81430200 MOV.W #0x0, 0x2(SP)
- 85 wOneFaxRear=0,
- 000024 81430400 MOV.W #0x0, 0x4(SP)
- 86 wGeneralVar=0;
- 000028 0A43 MOV.W #0x0, R10
- 87 unsigned char
- 88 ucRxIndex3=0,ucRxIndex2=0,
- 00002A 4543 MOV.B #0x0, R5
- 00002C 4443 MOV.B #0x0, R4
- 89 ucRxIndex1=0,ucRxIndex0=0,
- 00002E 4B43 MOV.B #0x0, R11
- 000030 4843 MOV.B #0x0, R8
- 90 ucSoftUartRxCnt=0;
- 000032 4643 MOV.B #0x0, R6
- 91 //unsigned char ucGeneralCount=1;
- 92 unsigned char ucGeneralCnt=0;
- 000034 C1430600 MOV.B #0x0, 0x6(SP)
- 93 unsigned char ucRingNum=0;
- 000038 4743 MOV.B #0x0, R7
- 94 unsigned char ucRxIndex=0;
- 00003A 4943 MOV.B #0x0, R9
- 95 //unsigned char ucSoftUartRxData=0;
- 96 //unsigned char ucFlashWriteData;
- 97 //unsigned char ucFlashColumnAddCnt;
- 98 //unsigned int wGeneralCnt;
- 99 //unsigned int wBlockAddress=0,wPageAddress=0;
- 100 WDTCTL=WDTPW+WDTHOLD; //close watch dog
- 00003C B240805A2001 MOV.W #0x5a80, &0x120
- 101
- 102 /*
- 103 FLASH_CON_PORT_OUT |= CE; //COMMAND_LATCH_INTO_INITAIL all control disable
- 104 FLASH_CON_PORT_OUT &= ~CE;
- 105 FLASH_CON_PORT_OUT |= WE;
- 106 FLASH_CON_PORT_OUT &= ~WE;
- 107 FLASH_CON_PORT_OUT |= RE;
- 108 FLASH_CON_PORT_OUT &= ~RE;
- 109 FLASH_CON_PORT_OUT |= CLE;
- 110 FLASH_CON_PORT_OUT &= ~CLE;
- 111 FLASH_CON_PORT_OUT |= ALE;
- 112 FLASH_CON_PORT_OUT &= ~ALE;
- 113 */
- 114 //while (1) _NOP();
- 115 IoInitial();
- 000042 B012.... CALL #IoInitial
- 116 InitUART();
- 000046 B012.... CALL #InitUART
- 117 Flash_Reset();
- 00004A B012.... CALL #Flash_Reset
- 118 FLASH_READ_ID();
- 00004E B012.... CALL #FLASH_READ_ID
- 119 //while (0) aucUartRxBuf[ucRxIndex++]=SoftUartRxOneFrame();
- 120 SOFTUART_PORT_DIRECTION |= bitSOFTUARTTX;
- 000052 D2D33600 BIS.B #0x1, &0x36
- 121 /*
- 122 while (0)
- 123 {
- 124 SOFTUART_PORT_OUT |= bitSOFTUARTTX;
- 125 delay1us(20);
- 126 SOFTUART_PORT_OUT &= ~bitSOFTUARTTX;
- 127 delay1us(8);
- 128 SOFTUART_PORT_OUT |= bitSOFTUARTTX;
- 129 for (ucGeneralCnt=0;ucGeneralCnt<8;ucGeneralCnt++)
- 130 {
- 131 delay1us(2);//SoftUartDelayHalf();
- 132 ucSoftUartRxData=ucSoftUartRxData>>1;
- 133 //if ((SOFTUART_PORT_IN & bitSOFTUARTRX) == bitSOFTUARTRX)
- 134 //ucSoftUartRxData |= BIT7;//BIT7;//(1<<ucGeneralCount);//set Rx bit
- 135 //else
- 136 //{ucSoftUartRxData &= ~BIT7;__no_operation();__no_operation();__no_operation();}//~BIT7;//~(1<<ucGeneralCount);//set Rx bit
- 137 if ((SOFTUART_PORT_OUT & bitSOFTUARTTX) != bitSOFTUARTTX)
- 138 {SOFTUART_PORT_OUT |= bitSOFTUARTTX;} //set Tx bit
- 139 else
- 140 {SOFTUART_PORT_OUT &= ~bitSOFTUARTTX;__no_operation();__no_operation();}
- 141 delay1us(2);//SoftUartDelayHalf();
- 142 __no_operation();
- 143 __no_operation();
- 144 __no_operation();
- 145 __no_operation();
- 146 __no_operation();
- 147
- 148 }
- 149
- 150 SOFTUART_PORT_OUT &= ~bitSOFTUARTTX;
- 151 delay1us(8);
- 152 SOFTUART_PORT_OUT |= bitSOFTUARTTX;
- 153 }
- 154 */
- 155 Delay2000ms();
- 000056 B012.... CALL #Delay2000ms
- 156
- 157 ReadLastViewData();
- 00005A 7E402900 MOV.B #0x29, R14
- 00005E 7C402800 MOV.B #0x28, R12
- 000062 B012.... CALL #ReadLast16BytesFromFlashMemoryArea
- 158 //ReadLast16BytesFromFlashMemoryArea(cstViewDataAreaStartBlockNum,cstViewDataAreaOverBlockNum);
- 159
- 160 ucRxIndex=gucUartRxCnt;
- 000066 5942.... MOV.B &gucUartRxCnt, R9
- 161 if ((gucGeneralStatus & bitReadFlashMemoryOK) == bitReadFlashMemoryOK)
- 00006A F2B02000.... BIT.B #0x20, &gucGeneralStatus
- 000070 1C28 JNC ??main_10
- 162 {
- 163 gucViewRingNum = aucUartRxBuf[ucRxIndex++];
- 000072 4E49 MOV.B R9, R14
- 000074 3EF0FF00 AND.W #0xff, R14
- 000078 D24E........ MOV.B aucUartRxBuf(R14), &aucViewData + 0x6
- 00007E 5953 ADD.B #0x1, R9
- 164 gucViewStaticStatus = aucUartRxBuf[ucRxIndex++];
- 000080 4E49 MOV.B R9, R14
- 000082 3EF0FF00 AND.W #0xff, R14
- 000086 D24E........ MOV.B aucUartRxBuf(R14), &aucViewData + 0x7
- 00008C 5953 ADD.B #0x1, R9
- 165 gucViewDynamicStatus = aucUartRxBuf[ucRxIndex++];
- 00008E 4E49 MOV.B R9, R14
- 000090 3EF0FF00 AND.W #0xff, R14
- 000094 D24E........ MOV.B aucUartRxBuf(R14), &aucViewData + 0x8
- 00009A 5953 ADD.B #0x1, R9
- 166 gucViewDceNewFaxNum = aucUartRxBuf[ucRxIndex++];
- 00009C 4E49 MOV.B R9, R14
- 00009E 3EF0FF00 AND.W #0xff, R14
- 0000A2 D24E........ MOV.B aucUartRxBuf(R14), &aucViewData + 0x9
- 0000A8 5953 ADD.B #0x1, R9
- 167 }
- 168 ViewCommunicationTX(0);
- ??main_10:
- 0000AA 4C43 MOV.B #0x0, R12
- 0000AC B012.... CALL #ViewCommunicationTX
- 169
- 170 //while (1) wGeneralCount = gwGeneralPageAddress>>6;
- 171 //while (1) _NOP();
- 172 /*
- 173 while (1)
- 174 {
- 175 ViewCommunicationTX(1);
- 176 ViewCommunicationRX();
- 177 }
- 178 */
- 179
- 180
- 181
- 182
- 183
- 184 //while (1)
- 185 //{
- 186 //Initial Device Reset Modem
- 187 ModemResetPortDir |= bitModemHardwareReset;
- 0000B0 F2D040002200 BIS.B #0x40, &0x22
- 188 ModemResetCon &= ~bitModemHardwareReset;
- 0000B6 F2C040002100 BIC.B #0x40, &0x21
- 189 ATcmdDelay();
- 0000BC B012.... CALL #ATcmdDelay
- 190 ModemResetPortDir &= ~bitModemHardwareReset;
- 0000C0 F2C040002200 BIC.B #0x40, &0x22
- 191 ModemResetCon |= bitModemHardwareReset;
- 0000C6 F2D040002100 BIS.B #0x40, &0x21
- 192 while (1)
- 193 {
- 194
- 195 ATcmdDelay();
- ??main_0:
- 0000CC B012.... CALL #ATcmdDelay
- 196 SendATcmd();
- 0000D0 B012.... CALL #SendATcmd
- 197 ATcmdDelay();
- 0000D4 B012.... CALL #ATcmdDelay
- 198 ATcmdDelay();
- 0000D8 B012.... CALL #ATcmdDelay
- 199 if ((0x0d!=aucUartRxBuf[ucRxIndex0])&&(0x4B!=aucUartRxBuf[ucRxIndex1]))
- 0000DC 4E48 MOV.B R8, R14
- 0000DE 3EF0FF00 AND.W #0xff, R14
- 0000E2 FE900D00.... CMP.B #0xd, aucUartRxBuf(R14)
- 0000E8 F127 JEQ ??main_0
- 0000EA 4E4B MOV.B R11, R14
- 0000EC 3EF0FF00 AND.W #0xff, R14
- 0000F0 FE904B00.... CMP.B #0x4b, aucUartRxBuf(R14)
- 0000F6 EA27 JEQ ??main_0
- 200 {
- 201 SendATcmdModemSoftReset();
- 0000F8 B012.... CALL #SendATcmdModemSoftReset
- 202 ATcmdDelay();
- 0000FC B012.... CALL #ATcmdDelay
- 203 ATcmdDelay();
- 000100 B012.... CALL #ATcmdDelay
- 204
- 205 ucRxIndex1=gucUartRxCnt-3;
- 000104 7E40FD00 MOV.B #0xfd, R14
- 000108 5E52.... ADD.B &gucUartRxCnt, R14
- 00010C 4B4E MOV.B R14, R11
- 206 ucRxIndex0=gucUartRxCnt-2;
- 00010E 7E40FE00 MOV.B #0xfe, R14
- 000112 5E52.... ADD.B &gucUartRxCnt, R14
- 000116 484E MOV.B R14, R8
- 207 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
- 000118 4E48 MOV.B R8, R14
- 00011A 3EF0FF00 AND.W #0xff, R14
- 00011E FE900D00.... CMP.B #0xd, aucUartRxBuf(R14)
- 000124 D323 JNE ??main_0
- 000126 4E4B MOV.B R11, R14
- 000128 3EF0FF00 AND.W #0xff, R14
- 00012C FE904B00.... CMP.B #0x4b, aucUartRxBuf(R14)
- 000132 CC23 JNE ??main_0
- 208 {break;}
- 209 }
- 210 }//while
- 211 while (1)
- 212 {
- 213 ATcmdDelay();
- ??main_2:
- 000134 B012.... CALL #ATcmdDelay
- 214 SendATcmd(); //a bug of Sep.22 If this AT is not added, the ring can't receive sometimes.
- 000138 B012.... CALL #SendATcmd
- 215 ATcmdDelay();
- 00013C B012.... CALL #ATcmdDelay
- 216 ATcmdDelay();
- 000140 B012.... CALL #ATcmdDelay
- 217
- 218 while (wGeneralCount++<0xffff)
- ??main_1:
- 000144 2E41 MOV.W 0x0(SP), R14
- 000146 1F43 MOV.W #0x1, R15
- 000148 0F5E ADD.W R14, R15
- 00014A 814F0000 MOV.W R15, 0x0(SP)
- 00014E 3E93 CMP.W #0xffff, R14
- 000150 2524 JEQ ??main_11
- 219 {
- 220 ucRxIndex1=gucUartRxCnt-3;
- 000152 7E40FD00 MOV.B #0xfd, R14
- 000156 5E52.... ADD.B &gucUartRxCnt, R14
- 00015A 4B4E MOV.B R14, R11
- 221 ucRxIndex0=gucUartRxCnt-2;
- 00015C 7E40FE00 MOV.B #0xfe, R14
- 000160 5E52.... ADD.B &gucUartRxCnt, R14
- 000164 484E MOV.B R14, R8
- 222 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
- 000166 38F0FF00 AND.W #0xff, R8
- 00016A F8900D00.... CMP.B #0xd, aucUartRxBuf(R8)
- 000170 0920 JNE ??main_12
- 000172 3BF0FF00 AND.W #0xff, R11
- 000176 FB904B00.... CMP.B #0x4b, aucUartRxBuf(R11)
- 00017C 0320 JNE ??main_12
- 223 {wOKcount++;break;}
- 00017E 91530800 ADD.W #0x1, 0x8(SP)
- 000182 0C3C JMP ??main_11
- 224 if (wGeneralCount==0xffff)
- ??main_12:
- 000184 B1930000 CMP.W #0xffff, 0x0(SP)
- 000188 DD23 JNE ??main_1
- 225 {
- 226 //wGeneralCount=0;
- 227 wNotOKcount++;
- 00018A 91530A00 ADD.W #0x1, 0xa(SP)
- 228 SendATcmdModemSoftReset();
- 00018E B012.... CALL #SendATcmdModemSoftReset
- 229 ATcmdDelay();
- 000192 B012.... CALL #ATcmdDelay
- 230 ATcmdDelay();
- 000196 B012.... CALL #ATcmdDelay
- 00019A D43F JMP ??main_1
- 231 }//if
- 232 }//while
- 233 ucRxIndex1=gucUartRxCnt-3;
- ??main_11:
- 00019C 7E40FD00 MOV.B #0xfd, R14
- 0001A0 5E52.... ADD.B &gucUartRxCnt, R14
- 0001A4 4B4E MOV.B R14, R11
- 234 ucRxIndex0=gucUartRxCnt-2;
- 0001A6 7E40FE00 MOV.B #0xfe, R14
- 0001AA 5E52.... ADD.B &gucUartRxCnt, R14
- 0001AE 484E MOV.B R14, R8
- 235 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
- 0001B0 38F0FF00 AND.W #0xff, R8
- 0001B4 F8900D00.... CMP.B #0xd, aucUartRxBuf(R8)
- 0001BA BC23 JNE ??main_2
- 0001BC 3BF0FF00 AND.W #0xff, R11
- 0001C0 FB904B00.... CMP.B #0x4b, aucUartRxBuf(R11)
- 0001C6 B623 JNE ??main_2
- 236 {wOKcount++;break;}
- 0001C8 91530800 ADD.W #0x1, 0x8(SP)
- 237 }//while
- 238
- 239 _NOP();
- 0001CC 0343 NOP
- 240 gucGeneralStatus &= ~bitModemActive;
- 0001CE E2C3.... BIC.B #0x2, &gucGeneralStatus
- 241
- 242 //gucUartRxCnt++;
- 243 //}//while
- 244
- 245 //Main Circle
- 246 while (1)
- 247 {
- 248 //Key Scan and Set Parameters
- 249
- 250 KeyScan();
- ??main_7:
- 0001D2 B012.... CALL #KeyScan
- 251 //}// test keyscan
- 252 //while (1)//test keyscan
- 253 //{//test keyscan
- 254
- 255 //if Modem active(bitModemActive=0X0002)
- 256 //detect modem
- 257 //else
- 258 //detect PC command through SoftUart
- 259 ucRingNum=0;
- 0001D6 4743 MOV.B #0x0, R7
- 260 if ((gucGeneralStatus & bitModemActive) == bitModemActive)
- 0001D8 E2B3.... BIT.B #0x2, &gucGeneralStatus
- 0001DC 1B29 JNC ??main_13
- 261 {
- 262 while (wGeneralCount++<0xffff)
- ??main_3:
- 0001DE 2E41 MOV.W 0x0(SP), R14
- 0001E0 1F43 MOV.W #0x1, R15
- 0001E2 0F5E ADD.W R14, R15
- 0001E4 814F0000 MOV.W R15, 0x0(SP)
- 0001E8 3E93 CMP.W #0xffff, R14
- 0001EA BC24 JEQ ??main_14
- 263 {
- 264 ucRxIndex3=gucUartRxCnt-6;
- 0001EC 7E40FA00 MOV.B #0xfa, R14
- 0001F0 5E52.... ADD.B &gucUartRxCnt, R14
- 0001F4 454E MOV.B R14, R5
- 265 ucRxIndex2=gucUartRxCnt-5;
- 0001F6 7E40FB00 MOV.B #0xfb, R14
- 0001FA 5E52.... ADD.B &gucUartRxCnt, R14
- 0001FE 444E MOV.B R14, R4
- 266 ucRxIndex1=gucUartRxCnt-4;
- 000200 7E40FC00 MOV.B #0xfc, R14
- 000204 5E52.... ADD.B &gucUartRxCnt, R14
- 000208 4B4E MOV.B R14, R11
- 267 ucRxIndex0=gucUartRxCnt-3;
- 00020A 7E40FD00 MOV.B #0xfd, R14
- 00020E 5E52.... ADD.B &gucUartRxCnt, R14
- 000212 484E MOV.B R14, R8
- 268 if ((aucUartRxBuf[ucRxIndex0]==0x47)&&(aucUartRxBuf[ucRxIndex1]==0x4e)&&
- 269 (aucUartRxBuf[ucRxIndex2]==0x49)&&(aucUartRxBuf[ucRxIndex3]==0x52))
- 000214 38F0FF00 AND.W #0xff, R8
- 000218 F8904700.... CMP.B #0x47, aucUartRxBuf(R8)
- 00021E DF23 JNE ??main_3
- 000220 3BF0FF00 AND.W #0xff, R11
- 000224 FB904E00.... CMP.B #0x4e, aucUartRxBuf(R11)
- 00022A D923 JNE ??main_3
- 00022C 34F0FF00 AND.W #0xff, R4
- 000230 F4904900.... CMP.B #0x49, aucUartRxBuf(R4)
- 000236 D323 JNE ??main_3
- 000238 35F0FF00 AND.W #0xff, R5
- 00023C F5905200.... CMP.B #0x52, aucUartRxBuf(R5)
- 000242 CD23 JNE ??main_3
- 270 {
- 271 gucUartRxCnt+=1;
- 000244 D253.... ADD.B #0x1, &gucUartRxCnt
- 272 ucRingNum++;
- 000248 5753 ADD.B #0x1, R7
- 273 //if AutoMode
- 274 //{
- 275 //if Ring Num < Ring Num Max
- 276 //gucUartRxCnt++; RingNumCnt++;
- 277 //else
- 278 //break;
- 279 //}
- 280 //else (Manual Mode)
- 281 //if Receive Start Key Switch On
- 282 // break;
- 283 if ((gucViewStaticStatus & bitViewAutoMode) == bitViewAutoMode) //auto mode
- 00024A F2B01000.... BIT.B #0x10, &aucViewData + 0x7
- 000250 4C28 JNC ??main_5
- 284 {
- 285 while (1)
- 286 {
- 287
- 288 ucRxIndex3=gucUartRxCnt-6;
- ??main_4:
- 000252 7E40FA00 MOV.B #0xfa, R14
- 000256 5E52.... ADD.B &gucUartRxCnt, R14
- 00025A 454E MOV.B R14, R5
- 289 ucRxIndex2=gucUartRxCnt-5;
- 00025C 7E40FB00 MOV.B #0xfb, R14
- 000260 5E52.... ADD.B &gucUartRxCnt, R14
- 000264 444E MOV.B R14, R4
- 290 ucRxIndex1=gucUartRxCnt-4;
- 000266 7E40FC00 MOV.B #0xfc, R14
- 00026A 5E52.... ADD.B &gucUartRxCnt, R14
- 00026E 4B4E MOV.B R14, R11
- 291 ucRxIndex0=gucUartRxCnt-3;
- 000270 7E40FD00 MOV.B #0xfd, R14
- 000274 5E52.... ADD.B &gucUartRxCnt, R14
- 000278 484E MOV.B R14, R8
- 292 if ((aucUartRxBuf[ucRxIndex0]==0x47)&&(aucUartRxBuf[ucRxIndex1]==0x4e)&&
- 293 (aucUartRxBuf[ucRxIndex2]==0x49)&&(aucUartRxBuf[ucRxIndex3]==0x52))
- 00027A 38F0FF00 AND.W #0xff, R8
- 00027E F8904700.... CMP.B #0x47, aucUartRxBuf(R8)
- 000284 1520 JNE ??main_15
- 000286 3BF0FF00 AND.W #0xff, R11
- 00028A FB904E00.... CMP.B #0x4e, aucUartRxBuf(R11)
- 000290 0F20 JNE ??main_15
- 000292 34F0FF00 AND.W #0xff, R4
- 000296 F4904900.... CMP.B #0x49, aucUartRxBuf(R4)
- 00029C 0920 JNE ??main_15
- 00029E 35F0FF00 AND.W #0xff, R5
- 0002A2 F5905200.... CMP.B #0x52, aucUartRxBuf(R5)
- 0002A8 0320 JNE ??main_15
- 294 {ucRingNum++;gucUartRxCnt++;}// pointer to next imcoming RING
- 0002AA 5753 ADD.B #0x1, R7
- 0002AC D253.... ADD.B #0x1, &gucUartRxCnt
- 295 if (ucRingNum>=gucViewRingNum)
- ??main_15:
- 0002B0 5792.... CMP.B &aucViewData + 0x6, R7
- 0002B4 0428 JNC ??main_16
- 296 {gucGeneralStatus |= bitSendFaxSignalOK;break;}//OK
- 0002B6 F2D01000.... BIS.B #0x10, &gucGeneralStatus
- 0002BC 533C JMP ??main_14
- 297 //time overflow quit
- 298 if (gwTimeOverflowCount++ == 0xffff)
- ??main_16:
- 0002BE 1E42.... MOV.W &gwTimeOverflowCount, R14
- 0002C2 1F43 MOV.W #0x1, R15
- 0002C4 0F5E ADD.W R14, R15
- 0002C6 824F.... MOV.W R15, &gwTimeOverflowCount
- 0002CA 3E93 CMP.W #0xffff, R14
- 0002CC 0220 JNE ??main_17
- 299 gucTimeOverflowCount++;
- 0002CE D253.... ADD.B #0x1, &gucTimeOverflowCount
- 300 if (gucTimeOverflowCount == 20)
- ??main_17:
- 0002D2 F2901400.... CMP.B #0x14, &gucTimeOverflowCount
- 0002D8 BC23 JNE ??main_4
- 301 {gucGeneralStatus &= ~bitSendFaxSignalOK;gucTimeOverflowCount=0;gwTimeOverflowCount=0;break;}
- 0002DA F2C01000.... BIC.B #0x10, &gucGeneralStatus
- 0002E0 C243.... MOV.B #0x0, &gucTimeOverflowCount
- 0002E4 8243.... MOV.W #0x0, &gwTimeOverflowCount
- 0002E8 3D3C JMP ??main_14
- 302 }
- 303
- 304 }//if auto mode end
- 305 else //manual mode
- 306 {
- 307 while (1)
- 308 {
- 309 gucUartRxCnt++;// pointer to next imcoming RING
- ??main_5:
- 0002EA D253.... ADD.B #0x1, &gucUartRxCnt
- 310 ucRxIndex3=gucUartRxCnt-6;
- 0002EE 7E40FA00 MOV.B #0xfa, R14
- 0002F2 5E52.... ADD.B &gucUartRxCnt, R14
- 0002F6 454E MOV.B R14, R5
- 311 ucRxIndex2=gucUartRxCnt-5;
- 0002F8 7E40FB00 MOV.B #0xfb, R14
- 0002FC 5E52.... ADD.B &gucUartRxCnt, R14
- 000300 444E MOV.B R14, R4
- 312 ucRxIndex1=gucUartRxCnt-4;
- 000302 7E40FC00 MOV.B #0xfc, R14
- 000306 5E52.... ADD.B &gucUartRxCnt, R14
- 00030A 4B4E MOV.B R14, R11
- 313 ucRxIndex0=gucUartRxCnt-3;
- 00030C 7E40FD00 MOV.B #0xfd, R14
- 000310 5E52.... ADD.B &gucUartRxCnt, R14
- 000314 484E MOV.B R14, R8
- 314 if ((aucUartRxBuf[ucRxIndex0]==0x47)&&(aucUartRxBuf[ucRxIndex1]==0x4e)&&
- 315 (aucUartRxBuf[ucRxIndex2]==0x49)&&(aucUartRxBuf[ucRxIndex3]==0x52))
- 000316 38F0FF00 AND.W #0xff, R8
- 00031A F8904700.... CMP.B #0x47, aucUartRxBuf(R8)
- 000320 1320 JNE ??main_18
- 000322 3BF0FF00 AND.W #0xff, R11
- 000326 FB904E00.... CMP.B #0x4e, aucUartRxBuf(R11)
- 00032C 0D20 JNE ??main_18
- 00032E 34F0FF00 AND.W #0xff, R4
- 000332 F4904900.... CMP.B #0x49, aucUartRxBuf(R4)
- 000338 0720 JNE ??main_18
- 00033A 35F0FF00 AND.W #0xff, R5
- 00033E F5905200.... CMP.B #0x52, aucUartRxBuf(R5)
- 000344 0120 JNE ??main_18
- 316 ucRingNum++;
- 000346 5753 ADD.B #0x1, R7
- 317 if (ucRingNum>10)//if RING is over 10, error
- ??main_18:
- 000348 77900B00 CMP.B #0xb, R7
- 00034C 0428 JNC ??main_19
- 318 {gucGeneralStatus &= ~bitSendFaxSignalOK;break;}//Not OK
- 00034E F2C01000.... BIC.B #0x10, &gucGeneralStatus
- 000354 073C JMP ??main_14
- 319 if ((KEY_PORT_IN & bitKeySendFaxSignal) != bitKeySendFaxSignal)
- ??main_19:
- 000356 F2B010002000 BIT.B #0x10, &0x20
- 00035C C62F JC ??main_5
- 320 {gucGeneralStatus |= bitSendFaxSignalOK;break;}//OK
- 00035E F2D01000.... BIS.B #0x10, &gucGeneralStatus
- 321 }
- 322 }//else manual mode end
- 323 break;
- 324 }//if
- 325 }//while
- 326
- 327
- 328 //receive fax
- 329 if ((gucGeneralStatus & bitSendFaxSignalOK) == bitSendFaxSignalOK)
- ??main_14:
- 000364 F2B01000.... BIT.B #0x10, &gucGeneralStatus
- 00036A 5128 JNC ??main_20
- 330 {
- 331 gucGeneralStatus &= ~bitSendFaxSignalOK;
- 00036C F2C01000.... BIC.B #0x10, &gucGeneralStatus
- 332 //Driver Screen Flash Receiving
- 333
- 334 gucViewDynamicStatus |= bitViewReceiving;
- 000372 D2D3.... BIS.B #0x1, &aucViewData + 0x8
- 335
- 336 ViewCommunicationTX(0x01);
- 000376 5C43 MOV.B #0x1, R12
- 000378 B012.... CALL #ViewCommunicationTX
- 337 //ViewCommunicationRX();
- 338
- 339
- 340 gucUartRxCnt=0;//
- 00037C C243.... MOV.B #0x0, &gucUartRxCnt
- 341 gucFrhErrorStatus=0x00;
- 000380 C243.... MOV.B #0x0, &gucFrhErrorStatus
- 342 FaxRXProcess();
- 000384 B012.... CALL #FaxRXProcess
- 343
- 344 //Off Screen Flash Receiving
- 345 gucViewDynamicStatus &= ~bitViewReceiving;
- 000388 D2C3.... BIC.B #0x1, &aucViewData + 0x8
- 346 ViewCommunicationTX(0x01);
- 00038C 5C43 MOV.B #0x1, R12
- 00038E B012.... CALL #ViewCommunicationTX
- 347 //if receive is OK
- 348 //write data to flash
- 349 //FaxRawDataBuf2Flash();
- 350 //gucRxTxFlag = DTERX;
- 351
- 352
- 353 if (gucFrhErrorStatus!=3)
- 000392 F2900300.... CMP.B #0x3, &gucFrhErrorStatus
- 000398 1024 JEQ ??main_21
- 354 {
- 355 FaxRxBufRawdata2PCFromSoftUart();
- 00039A B012.... CALL #FaxRxBufRawdata2PCFromSoftUart
- 356 //FaxRxBufRawdata2PCFromUart();
- 357 FaxRxBufRawdata2Flash();
- 00039E B012.... CALL #FaxRxBufRawdata2Flash
- 358 //FaxData2PCFromSoftUart();
- 359 gucViewStaticStatus |= bitViewNewFax;
- 0003A2 E2D2.... BIS.B #0x4, &aucViewData + 0x7
- 360 gucViewDynamicStatus |= bitViewNewFax;
- 0003A6 E2D2.... BIS.B #0x4, &aucViewData + 0x8
- 361 gucViewDceNewFaxNum++;
- 0003AA D253.... ADD.B #0x1, &aucViewData + 0x9
- 362 ViewCommunicationTX(0x01);
- 0003AE 5C43 MOV.B #0x1, R12
- 0003B0 B012.... CALL #ViewCommunicationTX
- 363 ReadAndWriteViewDataMemory();
- 0003B4 B012.... CALL #ReadAndWriteViewDataMemory
- 0003B8 2A3C JMP ??main_20
- 364
- 365 }//if
- 366 else
- 367 {
- 368 ModemResetPortDir |= bitModemHardwareReset;
- ??main_21:
- 0003BA F2D040002200 BIS.B #0x40, &0x22
- 369 ModemResetCon &= ~bitModemHardwareReset;
- 0003C0 F2C040002100 BIC.B #0x40, &0x21
- 370 ATcmdDelay();
- 0003C6 B012.... CALL #ATcmdDelay
- 371 ModemResetPortDir &= ~bitModemHardwareReset;
- 0003CA F2C040002200 BIC.B #0x40, &0x22
- 372 ModemResetCon |= bitModemHardwareReset;
- 0003D0 F2D040002100 BIS.B #0x40, &0x21
- 373 //InitUART();
- 374 while (1) //add at Apr. 13, 2007 can't receive RS232 Data
- 375 {
- 376 SendATcmdModemSoftReset();
- ??main_6:
- 0003D6 B012.... CALL #SendATcmdModemSoftReset
- 377 ATcmdDelay();
- 0003DA B012.... CALL #ATcmdDelay
- 378 ATcmdDelay();
- 0003DE B012.... CALL #ATcmdDelay
- 379
- 380 ucRxIndex1=gucUartRxCnt-3;
- 0003E2 7E40FD00 MOV.B #0xfd, R14
- 0003E6 5E52.... ADD.B &gucUartRxCnt, R14
- 0003EA 4B4E MOV.B R14, R11
- 381 ucRxIndex0=gucUartRxCnt-2;
- 0003EC 7E40FE00 MOV.B #0xfe, R14
- 0003F0 5E52.... ADD.B &gucUartRxCnt, R14
- 0003F4 484E MOV.B R14, R8
- 382 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
- 0003F6 38F0FF00 AND.W #0xff, R8
- 0003FA F8900D00.... CMP.B #0xd, aucUartRxBuf(R8)
- 000400 EA23 JNE ??main_6
- 000402 3BF0FF00 AND.W #0xff, R11
- 000406 FB904B00.... CMP.B #0x4b, aucUartRxBuf(R11)
- 00040C E423 JNE ??main_6
- 383 {break;}
- 384 }
- 385 }//else Rx error
- 386 //break; //Cant's delete it should be over this while circle //break; //delete at Mar. 16, 2007
- 387 }//if fax receive end
- 388
- 389 //Fax receive over, reset bitModemActive for PC detect the new fax
- 390 gucGeneralStatus &= ~bitModemActive; //fax receiving over
- ??main_20:
- 00040E E2C3.... BIC.B #0x2, &gucGeneralStatus
- 000412 DF3E JMP ??main_7
- 391 }//if modem active end
- 392 else
- 393 {
- 394 //receive data from SoftUart
- 395 ucSoftUartRxCnt=0;
- ??main_13:
- 000414 4643 MOV.B #0x0, R6
- 396 gucSoftUartRxCnt=0;
- 000416 C243.... MOV.B #0x0, &gucSoftUartRxCnt
- 397 //ucGeneralCnt=0;
- 398 while (1)
- 399 {
- 400 aucSoftUartRxBuf[ucSoftUartRxCnt++]=SoftUartRxOneFrame();//receive one Byte Data
- ??main_8:
- 00041A 4E46 MOV.B R6, R14
- 00041C 3EF0FF00 AND.W #0xff, R14
- 000420 0E12 PUSH.W R14
- 000422 B012.... CALL #SoftUartRxOneFrame
- 000426 3E41 POP.W R14
- 000428 CE4C.... MOV.B R12, aucSoftUartRxBuf(R14)
- 00042C 5653 ADD.B #0x1, R6
- 401 if (ucSoftUartRxCnt>19)//17)//
- 00042E 76901400 CMP.B #0x14, R6
- 000432 0128 JNC ??main_22
- 402 ucSoftUartRxCnt=0;//gucSoftUartRxCnt=0; 2-2=0
- 000434 4643 MOV.B #0x0, R6
- 403 if (aucSoftUartRxBuf[ucSoftUartRxCnt-1]==0x03 && aucSoftUartRxBuf[ucSoftUartRxCnt-2]==0x10)
- ??main_22:
- 000436 3E40.... MOV.W #aucSoftUartRxBuf, R14
- 00043A 4F46 MOV.B R6, R15
- 00043C 3FF0FF00 AND.W #0xff, R15
- 000440 0E5F ADD.W R15, R14
- 000442 FE900300FFFF CMP.B #0x3, 0xffff(R14)
- 000448 0E20 JNE ??main_23
- 00044A 3E40.... MOV.W #aucSoftUartRxBuf, R14
- 00044E 4F46 MOV.B R6, R15
- 000450 3FF0FF00 AND.W #0xff, R15
- 000454 0E5F ADD.W R15, R14
- 000456 FE901000FEFF CMP.B #0x10, 0xfffe(R14)
- 00045C 0420 JNE ??main_23
- 404 {gucSoftUartRxCnt=ucSoftUartRxCnt;ucSoftUartRxCnt=0; break;}//{gucSoftUartRxCnt=0; break;} //bug of Apr. 03, 20007
- 00045E C246.... MOV.B R6, &gucSoftUartRxCnt
- 000462 4643 MOV.B #0x0, R6
- 000464 0F3C JMP ??main_24
- 405 if ((gucGeneralStatus & bitModemActive) == bitModemActive)//if modem active, over this while function
- ??main_23:
- 000466 E2B3.... BIT.B #0x2, &gucGeneralStatus
- 00046A 0C2C JC ??main_24
- 406 break;
- 407 if (((KEY_PORT_IN & bitKeyRingNumDec) != bitKeyRingNumDec) ||
- 408 ((KEY_PORT_IN & bitKeyRingNumAdd) != bitKeyRingNumAdd) ||
- 409 ((KEY_PORT_IN & bitKeyAutoMode) != bitKeyAutoMode) ||
- 410 ((KEY_PORT_IN & bitKeyManualMode) != bitKeyManualMode)) //||
- 00046C D2B32000 BIT.B #0x1, &0x20
- 000470 0928 JNC ??main_24
- 000472 E2B32000 BIT.B #0x2, &0x20
- 000476 0628 JNC ??main_24
- 000478 E2B22000 BIT.B #0x4, &0x20
- 00047C 0328 JNC ??main_24
- 00047E F2B22000 BIT.B #0x8, &0x20
- 000482 CB2F JC ??main_8
- 411 //((KEY_PORT_IN & bitKeySendFaxSignal) != bitKeySendFaxSignal))
- 412 break;
- 413 }
- 414
- 415 //Judge the received data
- 416
- 417 //PC get Modem Bus command:ba 23 00 01 10 03
- 418 if ((aucSoftUartRxBuf[gucSoftUartRxCnt-1]==0x03) && (aucSoftUartRxBuf[gucSoftUartRxCnt-2]==0x10)&&
- 419 (aucSoftUartRxBuf[gucSoftUartRxCnt-3]==0x01) && (aucSoftUartRxBuf[gucSoftUartRxCnt-4]==0x00)&&
- 420 (aucSoftUartRxBuf[gucSoftUartRxCnt-5]==0x23) && (aucSoftUartRxBuf[gucSoftUartRxCnt-6]==0xba))
- ??main_24:
- 000484 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000488 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 00048C 3EF0FF00 AND.W #0xff, R14
- 000490 0F5E ADD.W R14, R15
- 000492 FF900300FFFF CMP.B #0x3, 0xffff(R15)
- 000498 3A20 JNE ??main_25
- 00049A 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 00049E 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 0004A2 3EF0FF00 AND.W #0xff, R14
- 0004A6 0F5E ADD.W R14, R15
- 0004A8 FF901000FEFF CMP.B #0x10, 0xfffe(R15)
- 0004AE 2F20 JNE ??main_25
- 0004B0 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 0004B4 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 0004B8 3EF0FF00 AND.W #0xff, R14
- 0004BC 0F5E ADD.W R14, R15
- 0004BE DF93FDFF CMP.B #0x1, 0xfffd(R15)
- 0004C2 2520 JNE ??main_25
- 0004C4 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 0004C8 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 0004CC 3EF0FF00 AND.W #0xff, R14
- 0004D0 0F5E ADD.W R14, R15
- 0004D2 CF93FCFF CMP.B #0x0, 0xfffc(R15)
- 0004D6 1B20 JNE ??main_25
- 0004D8 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 0004DC 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 0004E0 3EF0FF00 AND.W #0xff, R14
- 0004E4 0F5E ADD.W R14, R15
- 0004E6 FF902300FBFF CMP.B #0x23, 0xfffb(R15)
- 0004EC 1020 JNE ??main_25
- 0004EE 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 0004F2 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 0004F6 3EF0FF00 AND.W #0xff, R14
- 0004FA 0F5E ADD.W R14, R15
- 0004FC FF90BA00FAFF CMP.B #0xba, 0xfffa(R15)
- 000502 0520 JNE ??main_25
- 421 {
- 422 DteGetModemBus();
- 000504 B012.... CALL #DteGetModemBus
- 423 SoftUartTxOneFrame(0xff);
- 000508 7C43 MOV.B #0xff, R12
- 00050A B012.... CALL #SoftUartTxOneFrame
- 424 }
- 425
- 426 //PC return Modem Bus command:ba 23 00 02 10 03
- 427 if ((aucSoftUartRxBuf[gucSoftUartRxCnt-1]==0x03) && (aucSoftUartRxBuf[gucSoftUartRxCnt-2]==0x10)&&
- 428 (aucSoftUartRxBuf[gucSoftUartRxCnt-3]==0x02) && (aucSoftUartRxBuf[gucSoftUartRxCnt-4]==0x00)&&
- 429 (aucSoftUartRxBuf[gucSoftUartRxCnt-5]==0x23) && (aucSoftUartRxBuf[gucSoftUartRxCnt-6]==0xba))
- ??main_25:
- 00050E 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000512 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 000516 3EF0FF00 AND.W #0xff, R14
- 00051A 0F5E ADD.W R14, R15
- 00051C FF900300FFFF CMP.B #0x3, 0xffff(R15)
- 000522 3A20 JNE ??main_26
- 000524 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000528 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 00052C 3EF0FF00 AND.W #0xff, R14
- 000530 0F5E ADD.W R14, R15
- 000532 FF901000FEFF CMP.B #0x10, 0xfffe(R15)
- 000538 2F20 JNE ??main_26
- 00053A 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 00053E 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 000542 3EF0FF00 AND.W #0xff, R14
- 000546 0F5E ADD.W R14, R15
- 000548 EF93FDFF CMP.B #0x2, 0xfffd(R15)
- 00054C 2520 JNE ??main_26
- 00054E 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000552 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 000556 3EF0FF00 AND.W #0xff, R14
- 00055A 0F5E ADD.W R14, R15
- 00055C CF93FCFF CMP.B #0x0, 0xfffc(R15)
- 000560 1B20 JNE ??main_26
- 000562 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000566 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 00056A 3EF0FF00 AND.W #0xff, R14
- 00056E 0F5E ADD.W R14, R15
- 000570 FF902300FBFF CMP.B #0x23, 0xfffb(R15)
- 000576 1020 JNE ??main_26
- 000578 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 00057C 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 000580 3EF0FF00 AND.W #0xff, R14
- 000584 0F5E ADD.W R14, R15
- 000586 FF90BA00FAFF CMP.B #0xba, 0xfffa(R15)
- 00058C 0520 JNE ??main_26
- 430 {
- 431 DteReturnModemBus();
- 00058E B012.... CALL #DteReturnModemBus
- 432 SoftUartTxOneFrame(0xff);
- 000592 7C43 MOV.B #0xff, R12
- 000594 B012.... CALL #SoftUartTxOneFrame
- 433 }
- 434
- 435 //PC get Fax List command:ba 23 00 03 10 03
- 436 if ((aucSoftUartRxBuf[gucSoftUartRxCnt-1]==0x03)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-2]==0x10)&&
- 437 (aucSoftUartRxBuf[gucSoftUartRxCnt-3]==0x03)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-4]==0x00)&&
- 438 (aucSoftUartRxBuf[gucSoftUartRxCnt-5]==0x23)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-6]==0xba))
- ??main_26:
- 000598 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 00059C 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 0005A0 3EF0FF00 AND.W #0xff, R14
- 0005A4 0F5E ADD.W R14, R15
- 0005A6 FF900300FFFF CMP.B #0x3, 0xffff(R15)
- 0005AC 3820 JNE ??main_27
- 0005AE 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 0005B2 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 0005B6 3EF0FF00 AND.W #0xff, R14
- 0005BA 0F5E ADD.W R14, R15
- 0005BC FF901000FEFF CMP.B #0x10, 0xfffe(R15)
- 0005C2 2D20 JNE ??main_27
- 0005C4 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 0005C8 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 0005CC 3EF0FF00 AND.W #0xff, R14
- 0005D0 0F5E ADD.W R14, R15
- 0005D2 FF900300FDFF CMP.B #0x3, 0xfffd(R15)
- 0005D8 2220 JNE ??main_27
- 0005DA 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 0005DE 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 0005E2 3EF0FF00 AND.W #0xff, R14
- 0005E6 0F5E ADD.W R14, R15
- 0005E8 CF93FCFF CMP.B #0x0, 0xfffc(R15)
- 0005EC 1820 JNE ??main_27
- 0005EE 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 0005F2 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 0005F6 3EF0FF00 AND.W #0xff, R14
- 0005FA 0F5E ADD.W R14, R15
- 0005FC FF902300FBFF CMP.B #0x23, 0xfffb(R15)
- 000602 0D20 JNE ??main_27
- 000604 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000608 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 00060C 3EF0FF00 AND.W #0xff, R14
- 000610 0F5E ADD.W R14, R15
- 000612 FF90BA00FAFF CMP.B #0xba, 0xfffa(R15)
- 000618 0220 JNE ??main_27
- 439 {
- 440 DteGetFaxList();
- 00061A B012.... CALL #DteGetFaxList
- 441 }
- 442
- 443 //PC get One Fax command:ba 23 00 04 HeadLow HeadHigh RearLow RearHigh 10 03
- 444 if ((aucSoftUartRxBuf[gucSoftUartRxCnt-1]==0x03)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-2]==0x10)&&
- 445 (aucSoftUartRxBuf[gucSoftUartRxCnt-7]==0x04)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-8]==0x00)&&
- 446 (aucSoftUartRxBuf[gucSoftUartRxCnt-9]==0x23)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-10]==0xba))
- ??main_27:
- 00061E 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000622 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 000626 3EF0FF00 AND.W #0xff, R14
- 00062A 0F5E ADD.W R14, R15
- 00062C FF900300FFFF CMP.B #0x3, 0xffff(R15)
- 000632 8F20 JNE ??main_28
- 000634 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000638 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 00063C 3EF0FF00 AND.W #0xff, R14
- 000640 0F5E ADD.W R14, R15
- 000642 FF901000FEFF CMP.B #0x10, 0xfffe(R15)
- 000648 8420 JNE ??main_28
- 00064A 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 00064E 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 000652 3EF0FF00 AND.W #0xff, R14
- 000656 0F5E ADD.W R14, R15
- 000658 EF92F9FF CMP.B #0x4, 0xfff9(R15)
- 00065C 7A20 JNE ??main_28
- 00065E 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000662 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 000666 3EF0FF00 AND.W #0xff, R14
- 00066A 0F5E ADD.W R14, R15
- 00066C CF93F8FF CMP.B #0x0, 0xfff8(R15)
- 000670 7020 JNE ??main_28
- 000672 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000676 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 00067A 3EF0FF00 AND.W #0xff, R14
- 00067E 0F5E ADD.W R14, R15
- 000680 FF902300F7FF CMP.B #0x23, 0xfff7(R15)
- 000686 6520 JNE ??main_28
- 000688 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 00068C 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 000690 3EF0FF00 AND.W #0xff, R14
- 000694 0F5E ADD.W R14, R15
- 000696 FF90BA00F6FF CMP.B #0xba, 0xfff6(R15)
- 00069C 5A20 JNE ??main_28
- 447 {
- 448
- 449 if (gucFrhErrorStatus==0)
- 00069E C293.... CMP.B #0x0, &gucFrhErrorStatus
- 0006A2 5720 JNE ??main_28
- 450 {
- 451 ucRxIndex1=gucSoftUartRxCnt-6;//Low Byte
- 0006A4 7E40FA00 MOV.B #0xfa, R14
- 0006A8 5E52.... ADD.B &gucSoftUartRxCnt, R14
- 0006AC 4B4E MOV.B R14, R11
- 452 ucRxIndex0=gucSoftUartRxCnt-5;//High Byte
- 0006AE 7E40FB00 MOV.B #0xfb, R14
- 0006B2 5E52.... ADD.B &gucSoftUartRxCnt, R14
- 0006B6 484E MOV.B R14, R8
- 453 wGeneralVar=aucSoftUartRxBuf[ucRxIndex0];
- 0006B8 4E48 MOV.B R8, R14
- 0006BA 3EF0FF00 AND.W #0xff, R14
- 0006BE 5E4E.... MOV.B aucSoftUartRxBuf(R14), R14
- 0006C2 3EF0FF00 AND.W #0xff, R14
- 0006C6 0A4E MOV.W R14, R10
- 454 wOneFaxHead=(wGeneralVar<<8) | aucSoftUartRxBuf[ucRxIndex1];
- 0006C8 0F4A MOV.W R10, R15
- 0006CA 3FF0FF00 AND.W #0xff, R15
- 0006CE 8F10 SWPB R15
- 0006D0 4E4B MOV.B R11, R14
- 0006D2 3EF0FF00 AND.W #0xff, R14
- 0006D6 5E4E.... MOV.B aucSoftUartRxBuf(R14), R14
- 0006DA 3EF0FF00 AND.W #0xff, R14
- 0006DE 0FDE BIS.W R14, R15
- 0006E0 814F0200 MOV.W R15, 0x2(SP)
- 455
- 456 ucRxIndex1=gucSoftUartRxCnt-4;//Low Byte
- 0006E4 7E40FC00 MOV.B #0xfc, R14
- 0006E8 5E52.... ADD.B &gucSoftUartRxCnt, R14
- 0006EC 4B4E MOV.B R14, R11
- 457 ucRxIndex0=gucSoftUartRxCnt-3;//High Byte
- 0006EE 7E40FD00 MOV.B #0xfd, R14
- 0006F2 5E52.... ADD.B &gucSoftUartRxCnt, R14
- 0006F6 484E MOV.B R14, R8
- 458 wGeneralVar=aucSoftUartRxBuf[ucRxIndex0];
- 0006F8 4E48 MOV.B R8, R14
- 0006FA 3EF0FF00 AND.W #0xff, R14
- 0006FE 5E4E.... MOV.B aucSoftUartRxBuf(R14), R14
- 000702 3EF0FF00 AND.W #0xff, R14
- 000706 0A4E MOV.W R14, R10
- 459 wOneFaxRear=(wGeneralVar<<8) | aucSoftUartRxBuf[ucRxIndex1];
- 000708 0F4A MOV.W R10, R15
- 00070A 3FF0FF00 AND.W #0xff, R15
- 00070E 8F10 SWPB R15
- 000710 4E4B MOV.B R11, R14
- 000712 3EF0FF00 AND.W #0xff, R14
- 000716 5E4E.... MOV.B aucSoftUartRxBuf(R14), R14
- 00071A 3EF0FF00 AND.W #0xff, R14
- 00071E 0FDE BIS.W R14, R15
- 000720 814F0400 MOV.W R15, 0x4(SP)
- 460
- 461 DteGetOneFax(wOneFaxHead, wOneFaxRear);
- 000724 1E410400 MOV.W 0x4(SP), R14
- 000728 1C410200 MOV.W 0x2(SP), R12
- 00072C B012.... CALL #DteGetOneFax
- 462 if (gucViewDceNewFaxNum>0)
- 000730 D293.... CMP.B #0x1, &aucViewData + 0x9
- 000734 0728 JNC ??main_29
- 463 {
- 464 gucViewDceNewFaxNum--;// for DCE check the new fax
- 000736 F253.... ADD.B #0xff, &aucViewData + 0x9
- 465 gucViewStaticStatus |= bitViewNewFax;
- 00073A E2D2.... BIS.B #0x4, &aucViewData + 0x7
- 466 gucViewDynamicStatus |= bitViewNewFax;
- 00073E E2D2.... BIS.B #0x4, &aucViewData + 0x8
- 000742 023C JMP ??main_30
- 467 }
- 468 else
- 469 {gucViewStaticStatus &= ~bitViewNewFax;}
- ??main_29:
- 000744 E2C2.... BIC.B #0x4, &aucViewData + 0x7
- 470
- 471 ViewCommunicationTX(0x01);
- ??main_30:
- 000748 5C43 MOV.B #0x1, R12
- 00074A B012.... CALL #ViewCommunicationTX
- 472 ReadAndWriteViewDataMemory();
- 00074E B012.... CALL #ReadAndWriteViewDataMemory
- 473 }
- 474 }
- 475
- 476 //PC delete One Fax command:ba 23 00 05 HeadLow HeadHigh RearLow RearHigh 10 03
- 477 if ((aucSoftUartRxBuf[gucSoftUartRxCnt-1]==0x03)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-2]==0x10)&&
- 478 (aucSoftUartRxBuf[gucSoftUartRxCnt-7]==0x05)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-8]==0x00)&&
- 479 (aucSoftUartRxBuf[gucSoftUartRxCnt-9]==0x23)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-10]==0xba))
- ??main_28:
- 000752 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000756 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 00075A 3EF0FF00 AND.W #0xff, R14
- 00075E 0F5E ADD.W R14, R15
- 000760 FF900300FFFF CMP.B #0x3, 0xffff(R15)
- 000766 7720 JNE ??main_31
- 000768 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 00076C 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 000770 3EF0FF00 AND.W #0xff, R14
- 000774 0F5E ADD.W R14, R15
- 000776 FF901000FEFF CMP.B #0x10, 0xfffe(R15)
- 00077C 6C20 JNE ??main_31
- 00077E 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000782 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 000786 3EF0FF00 AND.W #0xff, R14
- 00078A 0F5E ADD.W R14, R15
- 00078C FF900500F9FF CMP.B #0x5, 0xfff9(R15)
- 000792 6120 JNE ??main_31
- 000794 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000798 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 00079C 3EF0FF00 AND.W #0xff, R14
- 0007A0 0F5E ADD.W R14, R15
- 0007A2 CF93F8FF CMP.B #0x0, 0xfff8(R15)
- 0007A6 5720 JNE ??main_31
- 0007A8 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 0007AC 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 0007B0 3EF0FF00 AND.W #0xff, R14
- 0007B4 0F5E ADD.W R14, R15
- 0007B6 FF902300F7FF CMP.B #0x23, 0xfff7(R15)
- 0007BC 4C20 JNE ??main_31
- 0007BE 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 0007C2 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 0007C6 3EF0FF00 AND.W #0xff, R14
- 0007CA 0F5E ADD.W R14, R15
- 0007CC FF90BA00F6FF CMP.B #0xba, 0xfff6(R15)
- 0007D2 4120 JNE ??main_31
- 480 {
- 481
- 482 if (gucFrhErrorStatus==0)
- 0007D4 C293.... CMP.B #0x0, &gucFrhErrorStatus
- 0007D8 3E20 JNE ??main_31
- 483 {
- 484 ucRxIndex1=gucSoftUartRxCnt-6;//Low Byte
- 0007DA 7E40FA00 MOV.B #0xfa, R14
- 0007DE 5E52.... ADD.B &gucSoftUartRxCnt, R14
- 0007E2 4B4E MOV.B R14, R11
- 485 ucRxIndex0=gucSoftUartRxCnt-5;//High Byte
- 0007E4 7E40FB00 MOV.B #0xfb, R14
- 0007E8 5E52.... ADD.B &gucSoftUartRxCnt, R14
- 0007EC 484E MOV.B R14, R8
- 486 wGeneralVar=aucSoftUartRxBuf[ucRxIndex0];
- 0007EE 4E48 MOV.B R8, R14
- 0007F0 3EF0FF00 AND.W #0xff, R14
- 0007F4 5E4E.... MOV.B aucSoftUartRxBuf(R14), R14
- 0007F8 3EF0FF00 AND.W #0xff, R14
- 0007FC 0A4E MOV.W R14, R10
- 487 wOneFaxHead=(wGeneralVar<<8) | aucSoftUartRxBuf[ucRxIndex1];
- 0007FE 0F4A MOV.W R10, R15
- 000800 3FF0FF00 AND.W #0xff, R15
- 000804 8F10 SWPB R15
- 000806 4E4B MOV.B R11, R14
- 000808 3EF0FF00 AND.W #0xff, R14
- 00080C 5E4E.... MOV.B aucSoftUartRxBuf(R14), R14
- 000810 3EF0FF00 AND.W #0xff, R14
- 000814 0FDE BIS.W R14, R15
- 000816 814F0200 MOV.W R15, 0x2(SP)
- 488
- 489 ucRxIndex1=gucSoftUartRxCnt-4;//Low Byte
- 00081A 7E40FC00 MOV.B #0xfc, R14
- 00081E 5E52.... ADD.B &gucSoftUartRxCnt, R14
- 000822 4B4E MOV.B R14, R11
- 490 ucRxIndex0=gucSoftUartRxCnt-3;//High Byte
- 000824 7E40FD00 MOV.B #0xfd, R14
- 000828 5E52.... ADD.B &gucSoftUartRxCnt, R14
- 00082C 484E MOV.B R14, R8
- 491 wGeneralVar=aucSoftUartRxBuf[ucRxIndex0];
- 00082E 4E48 MOV.B R8, R14
- 000830 3EF0FF00 AND.W #0xff, R14
- 000834 5E4E.... MOV.B aucSoftUartRxBuf(R14), R14
- 000838 3EF0FF00 AND.W #0xff, R14
- 00083C 0A4E MOV.W R14, R10
- 492 wOneFaxRear=(wGeneralVar<<8) | aucSoftUartRxBuf[ucRxIndex1];
- 00083E 3AF0FF00 AND.W #0xff, R10
- 000842 8A10 SWPB R10
- 000844 3BF0FF00 AND.W #0xff, R11
- 000848 5E4B.... MOV.B aucSoftUartRxBuf(R11), R14
- 00084C 3EF0FF00 AND.W #0xff, R14
- 000850 0ADE BIS.W R14, R10
- 000852 814A0400 MOV.W R10, 0x4(SP)
- 493
- 494 //DteDelOneFax(wOneFaxHead, wOneFaxRear);
- 495 }
- 496 }
- 497
- 498 //PC delete all fax command:ba 23 00 05 10 03
- 499 if ((aucSoftUartRxBuf[gucSoftUartRxCnt-1]==0x03)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-2]==0x10)&&
- 500 (aucSoftUartRxBuf[gucSoftUartRxCnt-3]==0x06)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-4]==0x00)&&
- 501 (aucSoftUartRxBuf[gucSoftUartRxCnt-5]==0x23)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-6]==0xba))
- 502 {
- 503 ;//DteDelAllFax();
- 504 }
- 505
- 506 //PC send the system time to Dce command:ba 23 00 0b YearLow YearHigh Month Day Hour Minute Second 10 03
- 507 if ((aucSoftUartRxBuf[gucSoftUartRxCnt-1]==0x03)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-2]==0x10)&&
- 508 (aucSoftUartRxBuf[gucSoftUartRxCnt-10]==0x0b)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-11]==0x00)&&
- 509 (aucSoftUartRxBuf[gucSoftUartRxCnt-12]==0x23)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-13]==0xba))
- ??main_31:
- 000856 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 00085A 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 00085E 3EF0FF00 AND.W #0xff, R14
- 000862 0F5E ADD.W R14, R15
- 000864 FF900300FFFF CMP.B #0x3, 0xffff(R15)
- 00086A 7420 JNE ??main_32
- 00086C 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000870 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 000874 3EF0FF00 AND.W #0xff, R14
- 000878 0F5E ADD.W R14, R15
- 00087A FF901000FEFF CMP.B #0x10, 0xfffe(R15)
- 000880 6920 JNE ??main_32
- 000882 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000886 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 00088A 3EF0FF00 AND.W #0xff, R14
- 00088E 0F5E ADD.W R14, R15
- 000890 FF900B00F6FF CMP.B #0xb, 0xfff6(R15)
- 000896 5E20 JNE ??main_32
- 000898 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 00089C 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 0008A0 3EF0FF00 AND.W #0xff, R14
- 0008A4 0F5E ADD.W R14, R15
- 0008A6 CF93F5FF CMP.B #0x0, 0xfff5(R15)
- 0008AA 5420 JNE ??main_32
- 0008AC 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 0008B0 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 0008B4 3EF0FF00 AND.W #0xff, R14
- 0008B8 0F5E ADD.W R14, R15
- 0008BA FF902300F4FF CMP.B #0x23, 0xfff4(R15)
- 0008C0 4920 JNE ??main_32
- 0008C2 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 0008C6 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 0008CA 3EF0FF00 AND.W #0xff, R14
- 0008CE 0F5E ADD.W R14, R15
- 0008D0 FF90BA00F3FF CMP.B #0xba, 0xfff3(R15)
- 0008D6 3E20 JNE ??main_32
- 510 {
- 511
- 512 if (gucFrhErrorStatus==0)
- 0008D8 C293.... CMP.B #0x0, &gucFrhErrorStatus
- 0008DC 3B20 JNE ??main_32
- 513 {
- 514 /*
- 515 SetSystemTime(aucSoftUartRxBuf[gucSoftUartRxCnt-9], aucSoftUartRxBuf[gucSoftUartRxCnt-8],
- 516 aucSoftUartRxBuf[gucSoftUartRxCnt-7], aucSoftUartRxBuf[gucSoftUartRxCnt-6],
- 517 aucSoftUartRxBuf[gucSoftUartRxCnt-5], aucSoftUartRxBuf[gucSoftUartRxCnt-4],
- 518 aucSoftUartRxBuf[gucSoftUartRxCnt-3]);
- 519 */
- 520 ucRxIndex=gucSoftUartRxCnt-8;
- 0008DE 7E40F800 MOV.B #0xf8, R14
- 0008E2 5E52.... ADD.B &gucSoftUartRxCnt, R14
- 0008E6 494E MOV.B R14, R9
- 521 for (ucGeneralCnt = 0; ucGeneralCnt < 6; ucGeneralCnt++)
- 0008E8 C1430600 MOV.B #0x0, 0x6(SP)
- ??main_9:
- 0008EC F19006000600 CMP.B #0x6, 0x6(SP)
- 0008F2 2D2C JC ??main_33
- 522 {
- 523 aucViewData[cstViewSecondIndex] = aucUartRxBuf[ucRxIndex++];//second
- 0008F4 4E49 MOV.B R9, R14
- 0008F6 3EF0FF00 AND.W #0xff, R14
- 0008FA D24E........ MOV.B aucUartRxBuf(R14), &aucViewData + 0x2
- 000900 5953 ADD.B #0x1, R9
- 524 aucViewData[cstViewMinuteIndex] = aucUartRxBuf[ucRxIndex++];//minute
- 000902 4E49 MOV.B R9, R14
- 000904 3EF0FF00 AND.W #0xff, R14
- 000908 D24E........ MOV.B aucUartRxBuf(R14), &aucViewData + 0x1
- 00090E 5953 ADD.B #0x1, R9
- 525 aucViewData[cstViewHourIndex] = aucUartRxBuf[ucRxIndex++];//hour
- 000910 4E49 MOV.B R9, R14
- 000912 3EF0FF00 AND.W #0xff, R14
- 000916 D24E........ MOV.B aucUartRxBuf(R14), &aucViewData
- 00091C 5953 ADD.B #0x1, R9
- 526 aucViewData[cstViewDateIndex] = aucUartRxBuf[ucRxIndex++];//date
- 00091E 4E49 MOV.B R9, R14
- 000920 3EF0FF00 AND.W #0xff, R14
- 000924 D24E........ MOV.B aucUartRxBuf(R14), &aucViewData + 0x4
- 00092A 5953 ADD.B #0x1, R9
- 527 aucViewData[cstViewMonthIndex] = aucUartRxBuf[ucRxIndex++];//month
- 00092C 4E49 MOV.B R9, R14
- 00092E 3EF0FF00 AND.W #0xff, R14
- 000932 D24E........ MOV.B aucUartRxBuf(R14), &aucViewData + 0x3
- 000938 5953 ADD.B #0x1, R9
- 528 aucViewData[cstViewYearIndex] = aucUartRxBuf[ucRxIndex++];//Year
- 00093A 4E49 MOV.B R9, R14
- 00093C 3EF0FF00 AND.W #0xff, R14
- 000940 D24E........ MOV.B aucUartRxBuf(R14), &aucViewData + 0x5
- 000946 5953 ADD.B #0x1, R9
- 529 }
- 000948 D1530600 ADD.B #0x1, 0x6(SP)
- 00094C CF3F JMP ??main_9
- 530 ViewCommunicationTX(0x00);
- ??main_33:
- 00094E 4C43 MOV.B #0x0, R12
- 000950 B012.... CALL #ViewCommunicationTX
- 531 }
- 532 }
- 533
- 534 //format flash
- 535 if ((aucSoftUartRxBuf[gucSoftUartRxCnt-1]==0x03)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-2]==0x10)&&
- 536 (aucSoftUartRxBuf[gucSoftUartRxCnt-3]==0x0c)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-4]==0x00)&&
- 537 (aucSoftUartRxBuf[gucSoftUartRxCnt-5]==0x23)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-6]==0xba))
- ??main_32:
- 000954 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000958 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 00095C 3EF0FF00 AND.W #0xff, R14
- 000960 0F5E ADD.W R14, R15
- 000962 FF900300FFFF CMP.B #0x3, 0xffff(R15)
- 000968 3820 JNE ??main_34
- 00096A 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 00096E 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 000972 3EF0FF00 AND.W #0xff, R14
- 000976 0F5E ADD.W R14, R15
- 000978 FF901000FEFF CMP.B #0x10, 0xfffe(R15)
- 00097E 2D20 JNE ??main_34
- 000980 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000984 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 000988 3EF0FF00 AND.W #0xff, R14
- 00098C 0F5E ADD.W R14, R15
- 00098E FF900C00FDFF CMP.B #0xc, 0xfffd(R15)
- 000994 2220 JNE ??main_34
- 000996 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 00099A 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 00099E 3EF0FF00 AND.W #0xff, R14
- 0009A2 0F5E ADD.W R14, R15
- 0009A4 CF93FCFF CMP.B #0x0, 0xfffc(R15)
- 0009A8 1820 JNE ??main_34
- 0009AA 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 0009AE 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 0009B2 3EF0FF00 AND.W #0xff, R14
- 0009B6 0F5E ADD.W R14, R15
- 0009B8 FF902300FBFF CMP.B #0x23, 0xfffb(R15)
- 0009BE 0D20 JNE ??main_34
- 0009C0 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 0009C4 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 0009C8 3EF0FF00 AND.W #0xff, R14
- 0009CC 0F5E ADD.W R14, R15
- 0009CE FF90BA00FAFF CMP.B #0xba, 0xfffa(R15)
- 0009D4 0220 JNE ??main_34
- 538 {
- 539 FlashFormat();
- 0009D6 B012.... CALL #FlashFormat
- 540 }
- 541
- 542 //Flash bad block process
- 543 if ((aucSoftUartRxBuf[gucSoftUartRxCnt-1]==0x03)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-2]==0x10)&&
- 544 (aucSoftUartRxBuf[gucSoftUartRxCnt-3]==0x0d)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-4]==0x00)&&
- 545 (aucSoftUartRxBuf[gucSoftUartRxCnt-5]==0x23)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-6]==0xba))
- ??main_34:
- 0009DA 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 0009DE 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 0009E2 3EF0FF00 AND.W #0xff, R14
- 0009E6 0F5E ADD.W R14, R15
- 0009E8 FF900300FFFF CMP.B #0x3, 0xffff(R15)
- 0009EE 3B20 JNE ??main_35
- 0009F0 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 0009F4 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 0009F8 3EF0FF00 AND.W #0xff, R14
- 0009FC 0F5E ADD.W R14, R15
- 0009FE FF901000FEFF CMP.B #0x10, 0xfffe(R15)
- 000A04 3020 JNE ??main_35
- 000A06 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000A0A 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 000A0E 3EF0FF00 AND.W #0xff, R14
- 000A12 0F5E ADD.W R14, R15
- 000A14 FF900D00FDFF CMP.B #0xd, 0xfffd(R15)
- 000A1A 2520 JNE ??main_35
- 000A1C 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000A20 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 000A24 3EF0FF00 AND.W #0xff, R14
- 000A28 0F5E ADD.W R14, R15
- 000A2A CF93FCFF CMP.B #0x0, 0xfffc(R15)
- 000A2E 1B20 JNE ??main_35
- 000A30 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000A34 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 000A38 3EF0FF00 AND.W #0xff, R14
- 000A3C 0F5E ADD.W R14, R15
- 000A3E FF902300FBFF CMP.B #0x23, 0xfffb(R15)
- 000A44 1020 JNE ??main_35
- 000A46 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000A4A 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 000A4E 3EF0FF00 AND.W #0xff, R14
- 000A52 0F5E ADD.W R14, R15
- 000A54 FF90BA00FAFF CMP.B #0xba, 0xfffa(R15)
- 000A5A 0520 JNE ??main_35
- 546 {
- 547 CheckInvalidBlock();
- 000A5C B012.... CALL #CheckInvalidBlock
- 548 SoftUartTxOneFrame(0xff);
- 000A60 7C43 MOV.B #0xff, R12
- 000A62 B012.... CALL #SoftUartTxOneFrame
- 549 }
- 550
- 551 //PC set CSI and DIS
- 552 if ((aucSoftUartRxBuf[gucSoftUartRxCnt-1]==0x03)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-2]==0x10)&&
- 553 (aucSoftUartRxBuf[gucSoftUartRxCnt-7]==0x0e)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-8]==0x00)&&
- 554 (aucSoftUartRxBuf[gucSoftUartRxCnt-9]==0x23)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-10]==0xba))
- ??main_35:
- 000A66 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000A6A 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 000A6E 3EF0FF00 AND.W #0xff, R14
- 000A72 0F5E ADD.W R14, R15
- 000A74 FF900300FFFF CMP.B #0x3, 0xffff(R15)
- 000A7A .... JEQ $+6
- 000A7C 3040.... BR #??main_7
- 000A80 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000A84 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 000A88 3EF0FF00 AND.W #0xff, R14
- 000A8C 0F5E ADD.W R14, R15
- 000A8E FF901000FEFF CMP.B #0x10, 0xfffe(R15)
- 000A94 .... JEQ $+6
- 000A96 3040.... BR #??main_7
- 000A9A 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000A9E 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 000AA2 3EF0FF00 AND.W #0xff, R14
- 000AA6 0F5E ADD.W R14, R15
- 000AA8 FF900E00F9FF CMP.B #0xe, 0xfff9(R15)
- 000AAE .... JEQ $+6
- 000AB0 3040.... BR #??main_7
- 000AB4 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000AB8 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 000ABC 3EF0FF00 AND.W #0xff, R14
- 000AC0 0F5E ADD.W R14, R15
- 000AC2 CF93F8FF CMP.B #0x0, 0xfff8(R15)
- 000AC6 .... JEQ $+6
- 000AC8 3040.... BR #??main_7
- 000ACC 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000AD0 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 000AD4 3EF0FF00 AND.W #0xff, R14
- 000AD8 0F5E ADD.W R14, R15
- 000ADA FF902300F7FF CMP.B #0x23, 0xfff7(R15)
- 000AE0 .... JEQ $+6
- 000AE2 3040.... BR #??main_7
- 000AE6 3F40.... MOV.W #aucSoftUartRxBuf, R15
- 000AEA 5E42.... MOV.B &gucSoftUartRxCnt, R14
- 000AEE 3EF0FF00 AND.W #0xff, R14
- 000AF2 0F5E ADD.W R14, R15
- 000AF4 FF90BA00F6FF CMP.B #0xba, 0xfff6(R15)
- 000AFA .... JEQ $+6
- 000AFC 3040.... BR #??main_7
- 555 {
- 556 SetCSIandDIS();
- 000B00 B012.... CALL #SetCSIandDIS
- 557 DceResponsePc();
- 000B04 B012.... CALL #DceResponsePc
- 000B08 3040.... BR #??main_7
- 558
- 559 }
- 560 /* get new fax
- 561 if ((aucUartRxBuf[gucUartRxCnt-1]==0x03)&&(aucUartRxBuf[gucUartRxCnt-2]==0x10)&&
- 562 (aucUartRxBuf[gucUartRxCnt-3]==0x01)&&(aucUartRxBuf[gucUartRxCnt-4]==0x00)&&
- 563 (aucUartRxBuf[gucUartRxCnt-5]==0x23)&&(aucUartRxBuf[gucUartRxCnt-6]==0xba))
- 564 //;
- 565 //if (gucRxTxFlag == DTERX)
- 566 {
- 567 FaxData2PCFromSoftUart();//FaxRXProcess();//FaxData2PC(); //FaxTXProcess();
- 568 gucRxTxFlag = DTETX;
- 569 }
- 570 */
- 571 }//else over Modem active not active
- 572 }//while end Main circle over
- 573 }//main function over
- 574
- 575 /***************************************************************************
- 576
- 577 ***************************************************************************/
- 578 /***************************************************************************/
- 579
- 580 /*
- 581 #include "KeyScan.c"
- 582 #include "ViewData2Flash.c"
- 583 #include "LCDView.c"
- 584 #include "DTEcmdProcess.c"
- 585 #include "FaxRxBuf2Flash.c"
- 586 #include "IoInitial.c"
- 587 #include "Uart.c"
- 588 #include "SoftUart.c"
- 589 #include "ParameterSet.c"
- 590 #include "ATcmdSet.c"
- 591 #include "Flash.c"
- 592 #include "FaxPropertyTableManage.c"
- 593 #include "FaxFrontPointerManage.c"
- 594 #include "FaxRearPointerManage.c"
- 595 #include "FlashBadBlockProcess.c"
- 596 #include "FaxProcess.c"
- 597 //#include "FaxData2pc.c"
- 598 //#include "FaxRxBufRawdata2pc.c"
- 599 #include "Delay.c"
- 600
- 601 */
- Maximum stack usage in bytes:
- Function CSTACK
- -------- ------
- main 32
- -> IoInitial 30
- -> InitUART 30
- -> Flash_Reset 30
- -> FLASH_READ_ID 30
- -> Delay2000ms 30
- -> ReadLast16BytesFromFlashMemoryArea
- 30
- -> ViewCommunicationTX 30
- -> ATcmdDelay 30
- -> ATcmdDelay 30
- -> SendATcmd 30
- -> ATcmdDelay 30
- -> ATcmdDelay 30
- -> SendATcmdModemSoftReset 30
- -> ATcmdDelay 30
- -> ATcmdDelay 30
- -> ATcmdDelay 30
- -> SendATcmd 30
- -> ATcmdDelay 30
- -> ATcmdDelay 30
- -> SendATcmdModemSoftReset 30
- -> ATcmdDelay 30
- -> ATcmdDelay 30
- -> KeyScan 30
- -> ViewCommunicationTX 30
- -> FaxRXProcess 30
- -> ViewCommunicationTX 30
- -> FaxRxBufRawdata2PCFromSoftUart
- 30
- -> FaxRxBufRawdata2Flash 30
- -> ViewCommunicationTX 30
- -> ReadAndWriteViewDataMemory
- 30
- -> ATcmdDelay 30
- -> SendATcmdModemSoftReset 30
- -> ATcmdDelay 30
- -> ATcmdDelay 30
- -> SoftUartRxOneFrame 32
- -> DteGetModemBus 30
- -> SoftUartTxOneFrame 30
- -> DteReturnModemBus 30
- -> SoftUartTxOneFrame 30
- -> DteGetFaxList 30
- -> DteGetOneFax 30
- -> ViewCommunicationTX 30
- -> ReadAndWriteViewDataMemory
- 30
- -> ViewCommunicationTX 30
- -> FlashFormat 30
- -> CheckInvalidBlock 30
- -> SoftUartTxOneFrame 30
- -> SetCSIandDIS 30
- -> DceResponsePc 30
- Segment part sizes:
- Function/Label Bytes
- -------------- -----
- WDTCTL 2
- P1IN 1
- P1OUT 1
- P1DIR 1
- P6DIR 1
- main 2828
-
- 2 828 bytes in segment CODE
- 6 bytes in segment DATA16_AN
-
- 2 828 bytes of CODE memory
- 0 bytes of DATA memory (+ 6 bytes shared)
- Errors: none
- Warnings: none