FaxPropertyTableManage.lst
上传用户:xhjmsc
上传日期:2019-09-13
资源大小:389k
文件大小:9k
- ##############################################################################
- # #
- # IAR MSP430 C/EC++ Compiler V2.10A/W32 12/Apr/2007 16:53:12 #
- # 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_070412 #
- # filesFaxPropertyTableManage.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_070412 #
- # DebugList -lA E:projectFaxProgramVson_Bryan_Fax_ #
- # Conexant_070412DebugList -o #
- # E:projectFaxProgramVson_Bryan_Fax_Conexant_070412 #
- # DebugObj -z2 --no_cse --no_unroll --no_inline #
- # --no_code_motion --debug -e #
- # E:projectFaxProgramVson_Bryan_Fax_Conexant_070412 #
- # filesFaxPropertyTableManage.c #
- # List file = E:projectFaxProgramVson_Bryan_Fax_Conexant_070412 #
- # DebugListFaxPropertyTableManage.lst #
- # Object file = E:projectFaxProgramVson_Bryan_Fax_Conexant_070412 #
- # DebugObjFaxPropertyTableManage.r43 #
- # #
- # #
- ##############################################################################
- E:projectFaxProgramVson_Bryan_Fax_Conexant_070412filesFaxPropertyTableManage.c
- 1 /***************************************
- 2 Program: Fax Property Table Manage
- 3 Author: Bryan Cai
- 4 Date: 2006.12.13
- 5 ***************************************/
- 6
- 7 #include "includeH.h"
- 8
- 9 unsigned int gwFaxPropertyAddress=64;
- 10
- 11 void WriteFaxPropertyTable(void)
- 12 {
- 13
- 14 unsigned char ucFlashSttsOverflowCnt=0,ucFaxPropertyLenCnt=0,
- 15 ucRxIndex=0;
- 16
- 17 COMMAND_VAL=cFlashWriteCmd;
- 18 COMMAND_LATCH_INTO();
- 19 //ADDRESS
- 20
- 21 ADDRESS_VALUE=gwColumnAddress & 0xff;//COLUMN_ADDRESS_LOW;
- 22 ADDRESS_LATCH_INTO();
- 23
- 24 ADDRESS_VALUE=(gwColumnAddress>>8) & 0XFF;//COLUMN_ADDRESS_HIGH;
- 25 ADDRESS_LATCH_INTO();
- 26
- 27 ADDRESS_VALUE=gwFaxPropertyAddress & 0xff;
- 28 ADDRESS_LATCH_INTO();
- 29
- 30 ADDRESS_VALUE=(gwFaxPropertyAddress>>8) & 0XFF;
- 31 ADDRESS_LATCH_INTO();
- 32 FLASH_CON_PORT_OUT &=~ ALE;
- 33
- 34 DATA_PORT_OUT_INITIAL;
- 35 for (ucFaxPropertyLenCnt=0;ucFaxPropertyLenCnt<16;ucFaxPropertyLenCnt++)
- 36 {
- 37 FLASH_CON_PORT_OUT&=~WE;
- 38 DATA_PORT_OUT=aucUartRxBuf[ucRxIndex++];
- 39 FLASH_CON_PORT_OUT |= WE;
- 40 }
- 41
- 42 COMMAND_VAL=cFlashWriteInitiateCmd; //10H INITIATES PROGRAM
- 43 COMMAND_LATCH_INTO();
- 44
- 45 READ_STATUS();
- 46 ucFlashSttsOverflowCnt=0;
- 47 if(FLASH_STATUS==1&&(ucFlashSttsOverflowCnt++)<2)
- 48 {;}
- 49 }
- 50 void ReadLastFaxProperty(void)//find last fax property recorder
- 51 {
- 52 unsigned int wPageAddress=0, wBlockAddress=0,
- 53 wColumnAddress=0,wNextPageAddress=0,
- 54 wRearPntCnt=0;
- 55 unsigned char ucRxIndex=0,
- 56 ucGeneralCnt=0,ucFaxPropertyLenCnt,
- 57 ucRxIndex3=0,ucRxIndex2=0,
- 58 ucRxIndex0=0,ucRxIndex1=0;
- 59
- 60
- 61 for (wBlockAddress=cFaxPropertyTableStartBlockNum;
- 62 wBlockAddress<=cFaxPropertyTableOverBlockNum;wBlockAddress++)
- 63 {
- 64
- 65 for (wPageAddress=(wBlockAddress<<6);wPageAddress<((wBlockAddress<<6)+64);wPageAddress++)
- 66 {
- 67 do{
- 68 wNextPageAddress=wPageAddress+64;
- 69 wPageAddress=CalNextPageAddress(wPageAddress);
- 70 }while(wNextPageAddress==wPageAddress);
- 71
- 72 wColumnAddress=0;
- 73 ROW_ADDRESS_LOW=wPageAddress & 0XFF;
- 74 ROW_ADDRESS_HIGH=(wPageAddress>>8) & 0XFF;
- 75
- 76 for (ucGeneralCnt=0;ucGeneralCnt<8;ucGeneralCnt++)
- 77 {
- 78 //COMMAND
- 79 COMMAND_VAL=0x00; //#0X00 //00H READ1 0-2111BYTE
- 80 COMMAND_LATCH_INTO();
- 81 //ADDRESS
- 82
- 83 ADDRESS_VALUE=wColumnAddress & 0xff;//COLUMN_ADDRESS_LOW;
- 84 ADDRESS_LATCH_INTO();
- 85
- 86 ADDRESS_VALUE=(wColumnAddress>>8) & 0XFF;//COLUMN_ADDRESS_HIGH;
- 87 ADDRESS_LATCH_INTO();
- 88
- 89 ADDRESS_VALUE=ROW_ADDRESS_LOW;
- 90 ADDRESS_LATCH_INTO();
- 91
- 92 ADDRESS_VALUE=ROW_ADDRESS_HIGH;
- 93 ADDRESS_LATCH_INTO();
- 94 FLASH_CON_PORT_OUT &=~ ALE;
- 95
- 96 COMMAND_VAL=0X30;
- 97 COMMAND_LATCH_INTO();
- 98 //ATcmdDelay();
- 99 while((FLASH_CON_PORT_IN & RB)==0);
- 100 DATA_PORT_IN_INITIAL;
- 101 for (ucFaxPropertyLenCnt=0;ucFaxPropertyLenCnt<16;ucFaxPropertyLenCnt++)
- 102 {
- 103 FLASH_CON_PORT_OUT &=~ RE; //RE IS LOW,ENABLE READ DATA
- 104 aucUartRxBuf[ucRxIndex++]=DATA_PORT_IN;
- 105 FLASH_CON_PORT_OUT |= RE;
- 106 }
- 107 wRearPntCnt++;
- 108 ucRxIndex3=ucRxIndex-4;
- 109 ucRxIndex2=ucRxIndex-3;
- 110 ucRxIndex1=ucRxIndex-2;
- 111 ucRxIndex0=ucRxIndex-1;
- 112 if (0xff == aucUartRxBuf[ucRxIndex0] && 0xff == aucUartRxBuf[ucRxIndex1] &&
- 113 0xff == aucUartRxBuf[ucRxIndex2] && 0xff == aucUartRxBuf[ucRxIndex3])
- 114 {
- 115 break; //next rear
- 116 }//if
- 117 if (ucGeneralCnt<4)
- 118 wColumnAddress+=512;
- 119 else
- 120 wColumnAddress+=16;
- 121 }//for read next rear pointer
- 122
- 123 //ucRxIndex3=gucUartRxCnt-4;
- 124 //ucRxIndex2=gucUartRxCnt-3;
- 125 //ucRxIndex1=gucUartRxCnt-2;
- 126 //ucRxIndex0=gucUartRxCnt-1;
- 127 if (0xff == aucUartRxBuf[ucRxIndex0] && 0xff == aucUartRxBuf[ucRxIndex1] &&
- 128 0xff == aucUartRxBuf[ucRxIndex2] && 0xff == aucUartRxBuf[ucRxIndex3])
- 129 {break;}
- 130 }//for next page
- 131
- 132 //ucRxIndex3=gucUartRxCnt-4;
- 133 //ucRxIndex2=gucUartRxCnt-3;
- 134 //ucRxIndex1=gucUartRxCnt-2;
- 135 //ucRxIndex0=gucUartRxCnt-1;
- 136 if (0xff == aucUartRxBuf[ucRxIndex0] && 0xff == aucUartRxBuf[ucRxIndex1] &&
- 137 0xff == aucUartRxBuf[ucRxIndex2] && 0xff == aucUartRxBuf[ucRxIndex3])
- 138 {break;}
- 139 }//for next block
- 140 gwFaxPropertyAddress=wPageAddress; //for write Fax property record
- 141 gwColumnAddress=wColumnAddress; //
- 142 }
- Errors: 6
- Warnings: none