main.s43
上传用户:xhjmsc
上传日期:2019-09-13
资源大小:389k
文件大小:56k
- NAME main
- RTMODEL "__double_size", "32"
- RTMODEL "__pic", "no"
- RTMODEL "__reg_r4", "free"
- RTMODEL "__reg_r5", "free"
- RTMODEL "__rt_version", "1"
- RSEG CSTACK:DATA:SORT:NOROOT(1)
- EXTERN ?Epilogue8
- EXTERN IoInitial
- FUNCTION IoInitial,0202H
- EXTERN InitUART
- FUNCTION InitUART,0202H
- EXTERN Flash_Reset
- FUNCTION Flash_Reset,0202H
- EXTERN FLASH_READ_ID
- FUNCTION FLASH_READ_ID,0202H
- EXTERN Delay2000ms
- FUNCTION Delay2000ms,0202H
- EXTERN ReadLast16BytesFromFlashMemoryArea
- FUNCTION ReadLast16BytesFromFlashMemoryArea,0202H
- EXTERN gucUartRxCnt
- EXTERN gucGeneralStatus
- EXTERN aucUartRxBuf
- EXTERN aucViewData
- EXTERN ViewCommunicationTX
- FUNCTION ViewCommunicationTX,0202H
- EXTERN ATcmdDelay
- FUNCTION ATcmdDelay,0202H
- EXTERN SendATcmd
- FUNCTION SendATcmd,0202H
- EXTERN SendATcmdModemSoftReset
- FUNCTION SendATcmdModemSoftReset,0202H
- EXTERN KeyScan
- FUNCTION KeyScan,0202H
- EXTERN gwTimeOverflowCount
- EXTERN gucTimeOverflowCount
- EXTERN gucFrhErrorStatus
- EXTERN FaxRXProcess
- FUNCTION FaxRXProcess,0202H
- EXTERN FaxRxBufRawdata2PCFromSoftUart
- FUNCTION FaxRxBufRawdata2PCFromSoftUart,0202H
- EXTERN FaxRxBufRawdata2Flash
- FUNCTION FaxRxBufRawdata2Flash,0202H
- EXTERN ReadAndWriteViewDataMemory
- FUNCTION ReadAndWriteViewDataMemory,0202H
- EXTERN gucSoftUartRxCnt
- EXTERN SoftUartRxOneFrame
- FUNCTION SoftUartRxOneFrame,0202H
- EXTERN aucSoftUartRxBuf
- EXTERN DteGetModemBus
- FUNCTION DteGetModemBus,0202H
- EXTERN SoftUartTxOneFrame
- FUNCTION SoftUartTxOneFrame,0202H
- EXTERN DteReturnModemBus
- FUNCTION DteReturnModemBus,0202H
- EXTERN DteGetFaxList
- FUNCTION DteGetFaxList,0202H
- EXTERN DteGetOneFax
- FUNCTION DteGetOneFax,0202H
- EXTERN FlashFormat
- FUNCTION FlashFormat,0202H
- EXTERN CheckInvalidBlock
- FUNCTION CheckInvalidBlock,0202H
- EXTERN SetCSIandDIS
- FUNCTION SetCSIandDIS,0202H
- EXTERN DceResponsePc
- FUNCTION DceResponsePc,0202H
- EXTERN ?longjmp_r4
- EXTERN ?longjmp_r5
- EXTERN ?setjmp_r4
- EXTERN ?setjmp_r5
- PUBWEAK ?setjmp_save_r4
- PUBWEAK ?setjmp_save_r5
- PUBWEAK P1DIR
- PUBWEAK P1IN
- PUBWEAK P1OUT
- PUBWEAK P6DIR
- PUBWEAK WDTCTL
- PUBLIC main
- FUNCTION main,021a03H
- LOCFRAME CSTACK, 32, STACK
-
- CFI Names cfiNames0
- CFI StackFrame CFA SP DATA
- CFI Resource PC:16, SP:16, SR:16, R4:16, R5:16, R6:16, R7:16, R8:16
- CFI Resource R9:16, R10:16, R11:16, R12:16, R13:16, R14:16, R15:16
- CFI EndNames cfiNames0
-
- CFI Common cfiCommon0 Using cfiNames0
- CFI CodeAlign 2
- CFI DataAlign 2
- CFI ReturnAddress PC CODE
- CFI CFA SP+2
- CFI PC Frame(CFA, -2)
- CFI SR Undefined
- CFI R4 SameValue
- CFI R5 SameValue
- CFI R6 SameValue
- CFI R7 SameValue
- CFI R8 SameValue
- CFI R9 SameValue
- CFI R10 SameValue
- CFI R11 SameValue
- CFI R12 Undefined
- CFI R13 Undefined
- CFI R14 Undefined
- CFI R15 Undefined
- CFI EndCommon cfiCommon0
-
- // E:projectFaxProgramVson_Bryan_Fax_Conexant_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"
- ASEGN DATA16_AN:DATA:NOROOT,0120H
- // unsigned short volatile __data WDTCTL
- WDTCTL:
- DS8 2
- ASEGN DATA16_AN:DATA:NOROOT,020H
- // unsigned char const volatile __data P1IN
- P1IN:
- DS8 1
- ASEGN DATA16_AN:DATA:NOROOT,021H
- // unsigned char volatile __data P1OUT
- P1OUT:
- DS8 1
- ASEGN DATA16_AN:DATA:NOROOT,022H
- // unsigned char volatile __data P1DIR
- P1DIR:
- DS8 1
- ASEGN DATA16_AN:DATA:NOROOT,036H
- // unsigned char volatile __data P6DIR
- P6DIR:
- 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
- RSEG CODE:CODE:NOROOT(1)
- // 77 void main(void)
- main:
- CFI Block cfiBlock0 Using cfiCommon0
- CFI Function main
- // 78 {
- FUNCALL main, IoInitial
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, InitUART
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, Flash_Reset
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, FLASH_READ_ID
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, Delay2000ms
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, ReadLast16BytesFromFlashMemoryArea
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, ViewCommunicationTX
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, ATcmdDelay
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, ATcmdDelay
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, SendATcmd
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, ATcmdDelay
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, ATcmdDelay
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, SendATcmdModemSoftReset
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, ATcmdDelay
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, ATcmdDelay
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, ATcmdDelay
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, SendATcmd
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, ATcmdDelay
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, ATcmdDelay
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, SendATcmdModemSoftReset
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, ATcmdDelay
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, ATcmdDelay
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, KeyScan
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, ViewCommunicationTX
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, FaxRXProcess
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, ViewCommunicationTX
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, FaxRxBufRawdata2PCFromSoftUart
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, FaxRxBufRawdata2Flash
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, ViewCommunicationTX
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, ReadAndWriteViewDataMemory
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, ATcmdDelay
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, SendATcmdModemSoftReset
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, ATcmdDelay
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, ATcmdDelay
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, SoftUartRxOneFrame
- LOCFRAME CSTACK, 32, STACK
- FUNCALL main, DteGetModemBus
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, SoftUartTxOneFrame
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, DteReturnModemBus
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, SoftUartTxOneFrame
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, DteGetFaxList
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, DteGetOneFax
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, ViewCommunicationTX
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, ReadAndWriteViewDataMemory
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, ViewCommunicationTX
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, FlashFormat
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, CheckInvalidBlock
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, SoftUartTxOneFrame
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, SetCSIandDIS
- LOCFRAME CSTACK, 30, STACK
- FUNCALL main, DceResponsePc
- LOCFRAME CSTACK, 30, 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 #0xc, SP
- CFI CFA SP+30
- // 79
- // 80
- // 81 unsigned int wGeneralCount = 0,
- MOV.W #0x0, 0x0(SP)
- // 82 wOKcount=0,
- MOV.W #0x0, 0x8(SP)
- // 83 wNotOKcount=0,
- MOV.W #0x0, 0xa(SP)
- // 84 wOneFaxHead=0,
- MOV.W #0x0, 0x2(SP)
- // 85 wOneFaxRear=0,
- MOV.W #0x0, 0x4(SP)
- // 86 wGeneralVar=0;
- MOV.W #0x0, R10
- // 87 unsigned char
- // 88 ucRxIndex3=0,ucRxIndex2=0,
- MOV.B #0x0, R5
- MOV.B #0x0, R4
- // 89 ucRxIndex1=0,ucRxIndex0=0,
- MOV.B #0x0, R11
- MOV.B #0x0, R8
- // 90 ucSoftUartRxCnt=0;
- MOV.B #0x0, R6
- // 91 //unsigned char ucGeneralCount=1;
- // 92 unsigned char ucGeneralCnt=0;
- MOV.B #0x0, 0x6(SP)
- // 93 unsigned char ucRingNum=0;
- MOV.B #0x0, R7
- // 94 unsigned char ucRxIndex=0;
- 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
- 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();
- CALL #IoInitial
- // 116 InitUART();
- CALL #InitUART
- // 117 Flash_Reset();
- CALL #Flash_Reset
- // 118 FLASH_READ_ID();
- CALL #FLASH_READ_ID
- // 119 //while (0) aucUartRxBuf[ucRxIndex++]=SoftUartRxOneFrame();
- // 120 SOFTUART_PORT_DIRECTION |= bitSOFTUARTTX;
- 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();
- CALL #Delay2000ms
- // 156
- // 157 ReadLastViewData();
- MOV.B #0x29, R14
- MOV.B #0x28, R12
- CALL #ReadLast16BytesFromFlashMemoryArea
- // 158 //ReadLast16BytesFromFlashMemoryArea(cstViewDataAreaStartBlockNum,cstViewDataAreaOverBlockNum);
- // 159
- // 160 ucRxIndex=gucUartRxCnt;
- MOV.B &gucUartRxCnt, R9
- // 161 if ((gucGeneralStatus & bitReadFlashMemoryOK) == bitReadFlashMemoryOK)
- BIT.B #0x20, &gucGeneralStatus
- JNC ??main_10
- // 162 {
- // 163 gucViewRingNum = aucUartRxBuf[ucRxIndex++];
- MOV.B R9, R14
- AND.W #0xff, R14
- MOV.B aucUartRxBuf(R14), &aucViewData + 0x6
- ADD.B #0x1, R9
- // 164 gucViewStaticStatus = aucUartRxBuf[ucRxIndex++];
- MOV.B R9, R14
- AND.W #0xff, R14
- MOV.B aucUartRxBuf(R14), &aucViewData + 0x7
- ADD.B #0x1, R9
- // 165 gucViewDynamicStatus = aucUartRxBuf[ucRxIndex++];
- MOV.B R9, R14
- AND.W #0xff, R14
- MOV.B aucUartRxBuf(R14), &aucViewData + 0x8
- ADD.B #0x1, R9
- // 166 gucViewDceNewFaxNum = aucUartRxBuf[ucRxIndex++];
- MOV.B R9, R14
- AND.W #0xff, R14
- MOV.B aucUartRxBuf(R14), &aucViewData + 0x9
- ADD.B #0x1, R9
- // 167 }
- // 168 ViewCommunicationTX(0);
- ??main_10:
- MOV.B #0x0, R12
- 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;
- BIS.B #0x40, &0x22
- // 188 ModemResetCon &= ~bitModemHardwareReset;
- BIC.B #0x40, &0x21
- // 189 ATcmdDelay();
- CALL #ATcmdDelay
- // 190 ModemResetPortDir &= ~bitModemHardwareReset;
- BIC.B #0x40, &0x22
- // 191 ModemResetCon |= bitModemHardwareReset;
- BIS.B #0x40, &0x21
- // 192 while (1)
- // 193 {
- // 194
- // 195 ATcmdDelay();
- ??main_0:
- CALL #ATcmdDelay
- // 196 SendATcmd();
- CALL #SendATcmd
- // 197 ATcmdDelay();
- CALL #ATcmdDelay
- // 198 ATcmdDelay();
- CALL #ATcmdDelay
- // 199 if ((0x0d!=aucUartRxBuf[ucRxIndex0])&&(0x4B!=aucUartRxBuf[ucRxIndex1]))
- MOV.B R8, R14
- AND.W #0xff, R14
- CMP.B #0xd, aucUartRxBuf(R14)
- JEQ ??main_0
- MOV.B R11, R14
- AND.W #0xff, R14
- CMP.B #0x4b, aucUartRxBuf(R14)
- JEQ ??main_0
- // 200 {
- // 201 SendATcmdModemSoftReset();
- CALL #SendATcmdModemSoftReset
- // 202 ATcmdDelay();
- CALL #ATcmdDelay
- // 203 ATcmdDelay();
- CALL #ATcmdDelay
- // 204
- // 205 ucRxIndex1=gucUartRxCnt-3;
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 206 ucRxIndex0=gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R8
- // 207 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
- MOV.B R8, R14
- AND.W #0xff, R14
- CMP.B #0xd, aucUartRxBuf(R14)
- JNE ??main_0
- MOV.B R11, R14
- AND.W #0xff, R14
- CMP.B #0x4b, aucUartRxBuf(R14)
- JNE ??main_0
- // 208 {break;}
- // 209 }
- // 210 }//while
- // 211 while (1)
- // 212 {
- // 213 ATcmdDelay();
- ??main_2:
- CALL #ATcmdDelay
- // 214 SendATcmd(); //a bug of Sep.22 If this AT is not added, the ring can't receive sometimes.
- CALL #SendATcmd
- // 215 ATcmdDelay();
- CALL #ATcmdDelay
- // 216 ATcmdDelay();
- CALL #ATcmdDelay
- // 217
- // 218 while (wGeneralCount++<0xffff)
- ??main_1:
- MOV.W 0x0(SP), R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, 0x0(SP)
- CMP.W #0xffff, R14
- JEQ ??main_11
- // 219 {
- // 220 ucRxIndex1=gucUartRxCnt-3;
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 221 ucRxIndex0=gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R8
- // 222 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
- AND.W #0xff, R8
- CMP.B #0xd, aucUartRxBuf(R8)
- JNE ??main_12
- AND.W #0xff, R11
- CMP.B #0x4b, aucUartRxBuf(R11)
- JNE ??main_12
- // 223 {wOKcount++;break;}
- ADD.W #0x1, 0x8(SP)
- JMP ??main_11
- // 224 if (wGeneralCount==0xffff)
- ??main_12:
- CMP.W #0xffff, 0x0(SP)
- JNE ??main_1
- // 225 {
- // 226 //wGeneralCount=0;
- // 227 wNotOKcount++;
- ADD.W #0x1, 0xa(SP)
- // 228 SendATcmdModemSoftReset();
- CALL #SendATcmdModemSoftReset
- // 229 ATcmdDelay();
- CALL #ATcmdDelay
- // 230 ATcmdDelay();
- CALL #ATcmdDelay
- JMP ??main_1
- // 231 }//if
- // 232 }//while
- // 233 ucRxIndex1=gucUartRxCnt-3;
- ??main_11:
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 234 ucRxIndex0=gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R8
- // 235 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
- AND.W #0xff, R8
- CMP.B #0xd, aucUartRxBuf(R8)
- JNE ??main_2
- AND.W #0xff, R11
- CMP.B #0x4b, aucUartRxBuf(R11)
- JNE ??main_2
- // 236 {wOKcount++;break;}
- ADD.W #0x1, 0x8(SP)
- // 237 }//while
- // 238
- // 239 _NOP();
- NOP
- // 240 gucGeneralStatus &= ~bitModemActive;
- 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:
- 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;
- MOV.B #0x0, R7
- // 260 if ((gucGeneralStatus & bitModemActive) == bitModemActive)
- BIT.B #0x2, &gucGeneralStatus
- JNC ??main_13
- // 261 {
- // 262 while (wGeneralCount++<0xffff)
- ??main_3:
- MOV.W 0x0(SP), R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, 0x0(SP)
- CMP.W #0xffff, R14
- JEQ ??main_14
- // 263 {
- // 264 ucRxIndex3=gucUartRxCnt-6;
- MOV.B #0xfa, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R5
- // 265 ucRxIndex2=gucUartRxCnt-5;
- MOV.B #0xfb, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R4
- // 266 ucRxIndex1=gucUartRxCnt-4;
- MOV.B #0xfc, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 267 ucRxIndex0=gucUartRxCnt-3;
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R8
- // 268 if ((aucUartRxBuf[ucRxIndex0]==0x47)&&(aucUartRxBuf[ucRxIndex1]==0x4e)&&
- // 269 (aucUartRxBuf[ucRxIndex2]==0x49)&&(aucUartRxBuf[ucRxIndex3]==0x52))
- AND.W #0xff, R8
- CMP.B #0x47, aucUartRxBuf(R8)
- JNE ??main_3
- AND.W #0xff, R11
- CMP.B #0x4e, aucUartRxBuf(R11)
- JNE ??main_3
- AND.W #0xff, R4
- CMP.B #0x49, aucUartRxBuf(R4)
- JNE ??main_3
- AND.W #0xff, R5
- CMP.B #0x52, aucUartRxBuf(R5)
- JNE ??main_3
- // 270 {
- // 271 gucUartRxCnt+=1;
- ADD.B #0x1, &gucUartRxCnt
- // 272 ucRingNum++;
- 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
- BIT.B #0x10, &aucViewData + 0x7
- JNC ??main_5
- // 284 {
- // 285 while (1)
- // 286 {
- // 287
- // 288 ucRxIndex3=gucUartRxCnt-6;
- ??main_4:
- MOV.B #0xfa, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R5
- // 289 ucRxIndex2=gucUartRxCnt-5;
- MOV.B #0xfb, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R4
- // 290 ucRxIndex1=gucUartRxCnt-4;
- MOV.B #0xfc, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 291 ucRxIndex0=gucUartRxCnt-3;
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R8
- // 292 if ((aucUartRxBuf[ucRxIndex0]==0x47)&&(aucUartRxBuf[ucRxIndex1]==0x4e)&&
- // 293 (aucUartRxBuf[ucRxIndex2]==0x49)&&(aucUartRxBuf[ucRxIndex3]==0x52))
- AND.W #0xff, R8
- CMP.B #0x47, aucUartRxBuf(R8)
- JNE ??main_15
- AND.W #0xff, R11
- CMP.B #0x4e, aucUartRxBuf(R11)
- JNE ??main_15
- AND.W #0xff, R4
- CMP.B #0x49, aucUartRxBuf(R4)
- JNE ??main_15
- AND.W #0xff, R5
- CMP.B #0x52, aucUartRxBuf(R5)
- JNE ??main_15
- // 294 {ucRingNum++;gucUartRxCnt++;}// pointer to next imcoming RING
- ADD.B #0x1, R7
- ADD.B #0x1, &gucUartRxCnt
- // 295 if (ucRingNum>=gucViewRingNum)
- ??main_15:
- CMP.B &aucViewData + 0x6, R7
- JNC ??main_16
- // 296 {gucGeneralStatus |= bitSendFaxSignalOK;break;}//OK
- BIS.B #0x10, &gucGeneralStatus
- JMP ??main_14
- // 297 //time overflow quit
- // 298 if (gwTimeOverflowCount++ == 0xffff)
- ??main_16:
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??main_17
- // 299 gucTimeOverflowCount++;
- ADD.B #0x1, &gucTimeOverflowCount
- // 300 if (gucTimeOverflowCount == 20)
- ??main_17:
- CMP.B #0x14, &gucTimeOverflowCount
- JNE ??main_4
- // 301 {gucGeneralStatus &= ~bitSendFaxSignalOK;gucTimeOverflowCount=0;gwTimeOverflowCount=0;break;}
- BIC.B #0x10, &gucGeneralStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- 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:
- ADD.B #0x1, &gucUartRxCnt
- // 310 ucRxIndex3=gucUartRxCnt-6;
- MOV.B #0xfa, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R5
- // 311 ucRxIndex2=gucUartRxCnt-5;
- MOV.B #0xfb, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R4
- // 312 ucRxIndex1=gucUartRxCnt-4;
- MOV.B #0xfc, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 313 ucRxIndex0=gucUartRxCnt-3;
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R8
- // 314 if ((aucUartRxBuf[ucRxIndex0]==0x47)&&(aucUartRxBuf[ucRxIndex1]==0x4e)&&
- // 315 (aucUartRxBuf[ucRxIndex2]==0x49)&&(aucUartRxBuf[ucRxIndex3]==0x52))
- AND.W #0xff, R8
- CMP.B #0x47, aucUartRxBuf(R8)
- JNE ??main_18
- AND.W #0xff, R11
- CMP.B #0x4e, aucUartRxBuf(R11)
- JNE ??main_18
- AND.W #0xff, R4
- CMP.B #0x49, aucUartRxBuf(R4)
- JNE ??main_18
- AND.W #0xff, R5
- CMP.B #0x52, aucUartRxBuf(R5)
- JNE ??main_18
- // 316 ucRingNum++;
- ADD.B #0x1, R7
- // 317 if (ucRingNum>10)//if RING is over 10, error
- ??main_18:
- CMP.B #0xb, R7
- JNC ??main_19
- // 318 {gucGeneralStatus &= ~bitSendFaxSignalOK;break;}//Not OK
- BIC.B #0x10, &gucGeneralStatus
- JMP ??main_14
- // 319 if ((KEY_PORT_IN & bitKeySendFaxSignal) != bitKeySendFaxSignal)
- ??main_19:
- BIT.B #0x10, &0x20
- JC ??main_5
- // 320 {gucGeneralStatus |= bitSendFaxSignalOK;break;}//OK
- 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:
- BIT.B #0x10, &gucGeneralStatus
- JNC ??main_20
- // 330 {
- // 331 gucGeneralStatus &= ~bitSendFaxSignalOK;
- BIC.B #0x10, &gucGeneralStatus
- // 332 //Driver Screen Flash Receiving
- // 333
- // 334 gucViewDynamicStatus |= bitViewReceiving;
- BIS.B #0x1, &aucViewData + 0x8
- // 335
- // 336 ViewCommunicationTX(0x01);
- MOV.B #0x1, R12
- CALL #ViewCommunicationTX
- // 337 //ViewCommunicationRX();
- // 338
- // 339
- // 340 gucUartRxCnt=0;//
- MOV.B #0x0, &gucUartRxCnt
- // 341 gucFrhErrorStatus=0x00;
- MOV.B #0x0, &gucFrhErrorStatus
- // 342 FaxRXProcess();
- CALL #FaxRXProcess
- // 343
- // 344 //Off Screen Flash Receiving
- // 345 gucViewDynamicStatus &= ~bitViewReceiving;
- BIC.B #0x1, &aucViewData + 0x8
- // 346 ViewCommunicationTX(0x01);
- MOV.B #0x1, R12
- CALL #ViewCommunicationTX
- // 347 //if receive is OK
- // 348 //write data to flash
- // 349 //FaxRawDataBuf2Flash();
- // 350 //gucRxTxFlag = DTERX;
- // 351
- // 352
- // 353 if (gucFrhErrorStatus!=3)
- CMP.B #0x3, &gucFrhErrorStatus
- JEQ ??main_21
- // 354 {
- // 355 FaxRxBufRawdata2PCFromSoftUart();
- CALL #FaxRxBufRawdata2PCFromSoftUart
- // 356 //FaxRxBufRawdata2PCFromUart();
- // 357 FaxRxBufRawdata2Flash();
- CALL #FaxRxBufRawdata2Flash
- // 358 //FaxData2PCFromSoftUart();
- // 359 gucViewStaticStatus |= bitViewNewFax;
- BIS.B #0x4, &aucViewData + 0x7
- // 360 gucViewDynamicStatus |= bitViewNewFax;
- BIS.B #0x4, &aucViewData + 0x8
- // 361 gucViewDceNewFaxNum++;
- ADD.B #0x1, &aucViewData + 0x9
- // 362 ViewCommunicationTX(0x01);
- MOV.B #0x1, R12
- CALL #ViewCommunicationTX
- // 363 ReadAndWriteViewDataMemory();
- CALL #ReadAndWriteViewDataMemory
- JMP ??main_20
- // 364
- // 365 }//if
- // 366 else
- // 367 {
- // 368 ModemResetPortDir |= bitModemHardwareReset;
- ??main_21:
- BIS.B #0x40, &0x22
- // 369 ModemResetCon &= ~bitModemHardwareReset;
- BIC.B #0x40, &0x21
- // 370 ATcmdDelay();
- CALL #ATcmdDelay
- // 371 ModemResetPortDir &= ~bitModemHardwareReset;
- BIC.B #0x40, &0x22
- // 372 ModemResetCon |= bitModemHardwareReset;
- BIS.B #0x40, &0x21
- // 373 //InitUART();
- // 374 while (1) //add at Apr. 13, 2007 can't receive RS232 Data
- // 375 {
- // 376 SendATcmdModemSoftReset();
- ??main_6:
- CALL #SendATcmdModemSoftReset
- // 377 ATcmdDelay();
- CALL #ATcmdDelay
- // 378 ATcmdDelay();
- CALL #ATcmdDelay
- // 379
- // 380 ucRxIndex1=gucUartRxCnt-3;
- MOV.B #0xfd, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R11
- // 381 ucRxIndex0=gucUartRxCnt-2;
- MOV.B #0xfe, R14
- ADD.B &gucUartRxCnt, R14
- MOV.B R14, R8
- // 382 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
- AND.W #0xff, R8
- CMP.B #0xd, aucUartRxBuf(R8)
- JNE ??main_6
- AND.W #0xff, R11
- CMP.B #0x4b, aucUartRxBuf(R11)
- 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:
- BIC.B #0x2, &gucGeneralStatus
- JMP ??main_7
- // 391 }//if modem active end
- // 392 else
- // 393 {
- // 394 //receive data from SoftUart
- // 395 ucSoftUartRxCnt=0;
- ??main_13:
- MOV.B #0x0, R6
- // 396 gucSoftUartRxCnt=0;
- MOV.B #0x0, &gucSoftUartRxCnt
- // 397 //ucGeneralCnt=0;
- // 398 while (1)
- // 399 {
- // 400 aucSoftUartRxBuf[ucSoftUartRxCnt++]=SoftUartRxOneFrame();//receive one Byte Data
- ??main_8:
- MOV.B R6, R14
- AND.W #0xff, R14
- PUSH.W R14
- CFI CFA SP+32
- CALL #SoftUartRxOneFrame
- POP.W R14
- CFI CFA SP+30
- MOV.B R12, aucSoftUartRxBuf(R14)
- ADD.B #0x1, R6
- // 401 if (ucSoftUartRxCnt>19)//17)//
- CMP.B #0x14, R6
- JNC ??main_22
- // 402 ucSoftUartRxCnt=0;//gucSoftUartRxCnt=0; 2-2=0
- MOV.B #0x0, R6
- // 403 if (aucSoftUartRxBuf[ucSoftUartRxCnt-1]==0x03 && aucSoftUartRxBuf[ucSoftUartRxCnt-2]==0x10)
- ??main_22:
- MOV.W #aucSoftUartRxBuf, R14
- MOV.B R6, R15
- AND.W #0xff, R15
- ADD.W R15, R14
- CMP.B #0x3, 0xffff(R14)
- JNE ??main_23
- MOV.W #aucSoftUartRxBuf, R14
- MOV.B R6, R15
- AND.W #0xff, R15
- ADD.W R15, R14
- CMP.B #0x10, 0xfffe(R14)
- JNE ??main_23
- // 404 {gucSoftUartRxCnt=ucSoftUartRxCnt;ucSoftUartRxCnt=0; break;}//{gucSoftUartRxCnt=0; break;} //bug of Apr. 03, 20007
- MOV.B R6, &gucSoftUartRxCnt
- MOV.B #0x0, R6
- JMP ??main_24
- // 405 if ((gucGeneralStatus & bitModemActive) == bitModemActive)//if modem active, over this while function
- ??main_23:
- BIT.B #0x2, &gucGeneralStatus
- 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)) //||
- BIT.B #0x1, &0x20
- JNC ??main_24
- BIT.B #0x2, &0x20
- JNC ??main_24
- BIT.B #0x4, &0x20
- JNC ??main_24
- BIT.B #0x8, &0x20
- 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:
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x3, 0xffff(R15)
- JNE ??main_25
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x10, 0xfffe(R15)
- JNE ??main_25
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x1, 0xfffd(R15)
- JNE ??main_25
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x0, 0xfffc(R15)
- JNE ??main_25
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x23, 0xfffb(R15)
- JNE ??main_25
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0xba, 0xfffa(R15)
- JNE ??main_25
- // 421 {
- // 422 DteGetModemBus();
- CALL #DteGetModemBus
- // 423 SoftUartTxOneFrame(0xff);
- MOV.B #0xff, R12
- 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:
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x3, 0xffff(R15)
- JNE ??main_26
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x10, 0xfffe(R15)
- JNE ??main_26
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x2, 0xfffd(R15)
- JNE ??main_26
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x0, 0xfffc(R15)
- JNE ??main_26
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x23, 0xfffb(R15)
- JNE ??main_26
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0xba, 0xfffa(R15)
- JNE ??main_26
- // 430 {
- // 431 DteReturnModemBus();
- CALL #DteReturnModemBus
- // 432 SoftUartTxOneFrame(0xff);
- MOV.B #0xff, R12
- 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:
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x3, 0xffff(R15)
- JNE ??main_27
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x10, 0xfffe(R15)
- JNE ??main_27
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x3, 0xfffd(R15)
- JNE ??main_27
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x0, 0xfffc(R15)
- JNE ??main_27
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x23, 0xfffb(R15)
- JNE ??main_27
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0xba, 0xfffa(R15)
- JNE ??main_27
- // 439 {
- // 440 DteGetFaxList();
- 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:
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x3, 0xffff(R15)
- JNE ??main_28
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x10, 0xfffe(R15)
- JNE ??main_28
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x4, 0xfff9(R15)
- JNE ??main_28
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x0, 0xfff8(R15)
- JNE ??main_28
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x23, 0xfff7(R15)
- JNE ??main_28
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0xba, 0xfff6(R15)
- JNE ??main_28
- // 447 {
- // 448
- // 449 if (gucFrhErrorStatus==0)
- CMP.B #0x0, &gucFrhErrorStatus
- JNE ??main_28
- // 450 {
- // 451 ucRxIndex1=gucSoftUartRxCnt-6;//Low Byte
- MOV.B #0xfa, R14
- ADD.B &gucSoftUartRxCnt, R14
- MOV.B R14, R11
- // 452 ucRxIndex0=gucSoftUartRxCnt-5;//High Byte
- MOV.B #0xfb, R14
- ADD.B &gucSoftUartRxCnt, R14
- MOV.B R14, R8
- // 453 wGeneralVar=aucSoftUartRxBuf[ucRxIndex0];
- MOV.B R8, R14
- AND.W #0xff, R14
- MOV.B aucSoftUartRxBuf(R14), R14
- AND.W #0xff, R14
- MOV.W R14, R10
- // 454 wOneFaxHead=(wGeneralVar<<8) | aucSoftUartRxBuf[ucRxIndex1];
- MOV.W R10, R15
- AND.W #0xff, R15
- SWPB R15
- MOV.B R11, R14
- AND.W #0xff, R14
- MOV.B aucSoftUartRxBuf(R14), R14
- AND.W #0xff, R14
- BIS.W R14, R15
- MOV.W R15, 0x2(SP)
- // 455
- // 456 ucRxIndex1=gucSoftUartRxCnt-4;//Low Byte
- MOV.B #0xfc, R14
- ADD.B &gucSoftUartRxCnt, R14
- MOV.B R14, R11
- // 457 ucRxIndex0=gucSoftUartRxCnt-3;//High Byte
- MOV.B #0xfd, R14
- ADD.B &gucSoftUartRxCnt, R14
- MOV.B R14, R8
- // 458 wGeneralVar=aucSoftUartRxBuf[ucRxIndex0];
- MOV.B R8, R14
- AND.W #0xff, R14
- MOV.B aucSoftUartRxBuf(R14), R14
- AND.W #0xff, R14
- MOV.W R14, R10
- // 459 wOneFaxRear=(wGeneralVar<<8) | aucSoftUartRxBuf[ucRxIndex1];
- MOV.W R10, R15
- AND.W #0xff, R15
- SWPB R15
- MOV.B R11, R14
- AND.W #0xff, R14
- MOV.B aucSoftUartRxBuf(R14), R14
- AND.W #0xff, R14
- BIS.W R14, R15
- MOV.W R15, 0x4(SP)
- // 460
- // 461 DteGetOneFax(wOneFaxHead, wOneFaxRear);
- MOV.W 0x4(SP), R14
- MOV.W 0x2(SP), R12
- CALL #DteGetOneFax
- // 462 if (gucViewDceNewFaxNum>0)
- CMP.B #0x1, &aucViewData + 0x9
- JNC ??main_29
- // 463 {
- // 464 gucViewDceNewFaxNum--;// for DCE check the new fax
- ADD.B #0xff, &aucViewData + 0x9
- // 465 gucViewStaticStatus |= bitViewNewFax;
- BIS.B #0x4, &aucViewData + 0x7
- // 466 gucViewDynamicStatus |= bitViewNewFax;
- BIS.B #0x4, &aucViewData + 0x8
- JMP ??main_30
- // 467 }
- // 468 else
- // 469 {gucViewStaticStatus &= ~bitViewNewFax;}
- ??main_29:
- BIC.B #0x4, &aucViewData + 0x7
- // 470
- // 471 ViewCommunicationTX(0x01);
- ??main_30:
- MOV.B #0x1, R12
- CALL #ViewCommunicationTX
- // 472 ReadAndWriteViewDataMemory();
- 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:
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x3, 0xffff(R15)
- JNE ??main_31
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x10, 0xfffe(R15)
- JNE ??main_31
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x5, 0xfff9(R15)
- JNE ??main_31
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x0, 0xfff8(R15)
- JNE ??main_31
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x23, 0xfff7(R15)
- JNE ??main_31
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0xba, 0xfff6(R15)
- JNE ??main_31
- // 480 {
- // 481
- // 482 if (gucFrhErrorStatus==0)
- CMP.B #0x0, &gucFrhErrorStatus
- JNE ??main_31
- // 483 {
- // 484 ucRxIndex1=gucSoftUartRxCnt-6;//Low Byte
- MOV.B #0xfa, R14
- ADD.B &gucSoftUartRxCnt, R14
- MOV.B R14, R11
- // 485 ucRxIndex0=gucSoftUartRxCnt-5;//High Byte
- MOV.B #0xfb, R14
- ADD.B &gucSoftUartRxCnt, R14
- MOV.B R14, R8
- // 486 wGeneralVar=aucSoftUartRxBuf[ucRxIndex0];
- MOV.B R8, R14
- AND.W #0xff, R14
- MOV.B aucSoftUartRxBuf(R14), R14
- AND.W #0xff, R14
- MOV.W R14, R10
- // 487 wOneFaxHead=(wGeneralVar<<8) | aucSoftUartRxBuf[ucRxIndex1];
- MOV.W R10, R15
- AND.W #0xff, R15
- SWPB R15
- MOV.B R11, R14
- AND.W #0xff, R14
- MOV.B aucSoftUartRxBuf(R14), R14
- AND.W #0xff, R14
- BIS.W R14, R15
- MOV.W R15, 0x2(SP)
- // 488
- // 489 ucRxIndex1=gucSoftUartRxCnt-4;//Low Byte
- MOV.B #0xfc, R14
- ADD.B &gucSoftUartRxCnt, R14
- MOV.B R14, R11
- // 490 ucRxIndex0=gucSoftUartRxCnt-3;//High Byte
- MOV.B #0xfd, R14
- ADD.B &gucSoftUartRxCnt, R14
- MOV.B R14, R8
- // 491 wGeneralVar=aucSoftUartRxBuf[ucRxIndex0];
- MOV.B R8, R14
- AND.W #0xff, R14
- MOV.B aucSoftUartRxBuf(R14), R14
- AND.W #0xff, R14
- MOV.W R14, R10
- // 492 wOneFaxRear=(wGeneralVar<<8) | aucSoftUartRxBuf[ucRxIndex1];
- AND.W #0xff, R10
- SWPB R10
- AND.W #0xff, R11
- MOV.B aucSoftUartRxBuf(R11), R14
- AND.W #0xff, R14
- BIS.W R14, R10
- 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:
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x3, 0xffff(R15)
- JNE ??main_32
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x10, 0xfffe(R15)
- JNE ??main_32
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0xb, 0xfff6(R15)
- JNE ??main_32
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x0, 0xfff5(R15)
- JNE ??main_32
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x23, 0xfff4(R15)
- JNE ??main_32
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0xba, 0xfff3(R15)
- JNE ??main_32
- // 510 {
- // 511
- // 512 if (gucFrhErrorStatus==0)
- CMP.B #0x0, &gucFrhErrorStatus
- 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;
- MOV.B #0xf8, R14
- ADD.B &gucSoftUartRxCnt, R14
- MOV.B R14, R9
- // 521 for (ucGeneralCnt = 0; ucGeneralCnt < 6; ucGeneralCnt++)
- MOV.B #0x0, 0x6(SP)
- ??main_9:
- CMP.B #0x6, 0x6(SP)
- JC ??main_33
- // 522 {
- // 523 aucViewData[cstViewSecondIndex] = aucUartRxBuf[ucRxIndex++];//second
- MOV.B R9, R14
- AND.W #0xff, R14
- MOV.B aucUartRxBuf(R14), &aucViewData + 0x2
- ADD.B #0x1, R9
- // 524 aucViewData[cstViewMinuteIndex] = aucUartRxBuf[ucRxIndex++];//minute
- MOV.B R9, R14
- AND.W #0xff, R14
- MOV.B aucUartRxBuf(R14), &aucViewData + 0x1
- ADD.B #0x1, R9
- // 525 aucViewData[cstViewHourIndex] = aucUartRxBuf[ucRxIndex++];//hour
- MOV.B R9, R14
- AND.W #0xff, R14
- MOV.B aucUartRxBuf(R14), &aucViewData
- ADD.B #0x1, R9
- // 526 aucViewData[cstViewDateIndex] = aucUartRxBuf[ucRxIndex++];//date
- MOV.B R9, R14
- AND.W #0xff, R14
- MOV.B aucUartRxBuf(R14), &aucViewData + 0x4
- ADD.B #0x1, R9
- // 527 aucViewData[cstViewMonthIndex] = aucUartRxBuf[ucRxIndex++];//month
- MOV.B R9, R14
- AND.W #0xff, R14
- MOV.B aucUartRxBuf(R14), &aucViewData + 0x3
- ADD.B #0x1, R9
- // 528 aucViewData[cstViewYearIndex] = aucUartRxBuf[ucRxIndex++];//Year
- MOV.B R9, R14
- AND.W #0xff, R14
- MOV.B aucUartRxBuf(R14), &aucViewData + 0x5
- ADD.B #0x1, R9
- // 529 }
- ADD.B #0x1, 0x6(SP)
- JMP ??main_9
- // 530 ViewCommunicationTX(0x00);
- ??main_33:
- MOV.B #0x0, R12
- 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:
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x3, 0xffff(R15)
- JNE ??main_34
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x10, 0xfffe(R15)
- JNE ??main_34
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0xc, 0xfffd(R15)
- JNE ??main_34
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x0, 0xfffc(R15)
- JNE ??main_34
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x23, 0xfffb(R15)
- JNE ??main_34
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0xba, 0xfffa(R15)
- JNE ??main_34
- // 538 {
- // 539 FlashFormat();
- 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:
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x3, 0xffff(R15)
- JNE ??main_35
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x10, 0xfffe(R15)
- JNE ??main_35
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0xd, 0xfffd(R15)
- JNE ??main_35
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x0, 0xfffc(R15)
- JNE ??main_35
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x23, 0xfffb(R15)
- JNE ??main_35
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0xba, 0xfffa(R15)
- JNE ??main_35
- // 546 {
- // 547 CheckInvalidBlock();
- CALL #CheckInvalidBlock
- // 548 SoftUartTxOneFrame(0xff);
- MOV.B #0xff, R12
- 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:
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x3, 0xffff(R15)
- JEQ $+6
- BR #??main_7
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x10, 0xfffe(R15)
- JEQ $+6
- BR #??main_7
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0xe, 0xfff9(R15)
- JEQ $+6
- BR #??main_7
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x0, 0xfff8(R15)
- JEQ $+6
- BR #??main_7
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0x23, 0xfff7(R15)
- JEQ $+6
- BR #??main_7
- MOV.W #aucSoftUartRxBuf, R15
- MOV.B &gucSoftUartRxCnt, R14
- AND.W #0xff, R14
- ADD.W R14, R15
- CMP.B #0xba, 0xfff6(R15)
- JEQ $+6
- BR #??main_7
- // 555 {
- // 556 SetCSIandDIS();
- CALL #SetCSIandDIS
- // 557 DceResponsePc();
- CALL #DceResponsePc
- BR #??main_7
- CFI EndBlock cfiBlock0
- // 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
- 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
- // 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 */
- //
- // 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