FaxFrontPointerManage.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 #
- # filesFaxFrontPointerManage.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 #
- # filesFaxFrontPointerManage.c #
- # List file = E:projectFaxProgramVson_Bryan_Fax_Conexant_070412 #
- # DebugListFaxFrontPointerManage.lst #
- # Object file = E:projectFaxProgramVson_Bryan_Fax_Conexant_070412 #
- # DebugObjFaxFrontPointerManage.r43 #
- # #
- # #
- ##############################################################################
- E:projectFaxProgramVson_Bryan_Fax_Conexant_070412filesFaxFrontPointerManage.c
- 1 /***************************************
- 2 Program: FlashManage
- 3 Author: Bryan Cai
- 4 Date: 2006.12.12
- 5 ***************************************/
- 6
- 7
- 8 #include "includeH.h"
- 9
- 10
- 11 void WriteFaxFrontPointerTable(void)
- 12 {
- 13
- 14 unsigned char ucFlashSttsOverflowCnt=0,ucFaxPointerLenCnt=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=gwFrontPointerAddress & 0xff;
- 28 ADDRESS_LATCH_INTO();
- 29
- 30 ADDRESS_VALUE=(gwFrontPointerAddress>>8) & 0XFF;
- 31 ADDRESS_LATCH_INTO();
- 32 FLASH_CON_PORT_OUT &=~ ALE;
- 33
- 34 DATA_PORT_OUT_INITIAL;
- 35 for (ucFaxPointerLenCnt=0;ucFaxPointerLenCnt<4;ucFaxPointerLenCnt++)
- 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 ReadLastFaxFrontPointer(void)//find last fax front pointer
- 51 {
- 52 unsigned int wPageAddress=0, wBlockAddress=0,
- 53 wColumnAddress=0,wNextPageAddress=0,
- 54 wRearPntCnt=0;
- 55 unsigned char ucRxIndex=0,
- 56 ucRxIndex3=0,ucRxIndex2=0,
- 57 ucRxIndex0=0,ucRxIndex1=0,
- 58 ucGeneralCnt=0,ucFaxRearLenCnt;
- 59
- 60
- 61 for (wBlockAddress=cFaxFrontPointerTableStartBlockNum;
- 62 wBlockAddress<=cFaxFrontPointerTableOverBlockNum;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 (ucFaxRearLenCnt=0;ucFaxRearLenCnt<4;ucFaxRearLenCnt++)
- 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
- 109 ucRxIndex3=ucRxIndex-4;
- 110 ucRxIndex2=ucRxIndex-3;
- 111 ucRxIndex1=ucRxIndex-2;
- 112 ucRxIndex0=ucRxIndex-1;
- 113 if (0xff == aucUartRxBuf[ucRxIndex0] && 0xff == aucUartRxBuf[ucRxIndex1] &&
- 114 0xff == aucUartRxBuf[ucRxIndex2] && 0xff == aucUartRxBuf[ucRxIndex3])
- 115 {
- 116 break; //next front
- 117 }//if
- 118 if (ucGeneralCnt<4)
- 119 wColumnAddress+=512;
- 120 else
- 121 wColumnAddress+=16;
- 122 }//for read next front pointer
- 123
- 124 if (0xff == aucUartRxBuf[ucRxIndex0] && 0xff == aucUartRxBuf[ucRxIndex1] &&
- 125 0xff == aucUartRxBuf[ucRxIndex2] && 0xff == aucUartRxBuf[ucRxIndex3])
- 126 {break;}
- 127 }//for next page
- 128
- 129 if (0xff == aucUartRxBuf[ucRxIndex0] && 0xff == aucUartRxBuf[ucRxIndex1] &&
- 130 0xff == aucUartRxBuf[ucRxIndex2] && 0xff == aucUartRxBuf[ucRxIndex3])
- 131 {break;}
- 132 }//for next block
- 133 gwFrontPointerAddress=wPageAddress; //for write Fax front pointer
- 134 gwColumnAddress=wColumnAddress; //read next front pointer address, for write next front pointer
- 135 if (wRearPntCnt>1)
- 136 {
- 137 ucRxIndex1=ucRxIndex-8;
- 138 ucRxIndex0=ucRxIndex-7;
- 139 wPageAddress=aucUartRxBuf[ucRxIndex0];
- 140 gwPageAddress=(wPageAddress<<8) | aucUartRxBuf[ucRxIndex1];
- 141 }
- 142 else
- 143 gwPageAddress=cstFaxContentStartPage-1;//2559;//1279;//read data start address(1280)
- 144 }
- Errors: 8
- Warnings: none