FaxPropertyTableManage.lst
上传用户:xhjmsc
上传日期:2019-09-13
资源大小:389k
文件大小:9k
源码类别:

传真(Fax)编程

开发平台:

C/C++

  1. ##############################################################################
  2. #                                                                            #
  3. # IAR MSP430 C/EC++ Compiler V2.10A/W32                12/Apr/2007  16:53:12 #
  4. # Copyright 1996-2003 IAR Systems. All rights reserved.                      #
  5. #                                                                            #
  6. #    __rt_version  =  1                                                      #
  7. #    __double_size =  32                                                     #
  8. #    __reg_r4      =  free                                                   #
  9. #    __reg_r5      =  free                                                   #
  10. #    __pic         =  no                                                     #
  11. #    Source file   =  E:projectFaxProgramVson_Bryan_Fax_Conexant_070412 #
  12. #                     filesFaxPropertyTableManage.c                         #
  13. #    Command line  =  -I "C:Program FilesIAR SystemsEmbedded Workbench    #
  14. #                     3.2430INC" -I "C:Program FilesIAR                 #
  15. #                     SystemsEmbedded Workbench 3.2430INCCLIB" -lCN     #
  16. #                     E:projectFaxProgramVson_Bryan_Fax_Conexant_070412 #
  17. #                     DebugList -lA E:projectFaxProgramVson_Bryan_Fax_ #
  18. #                     Conexant_070412DebugList -o                         #
  19. #                     E:projectFaxProgramVson_Bryan_Fax_Conexant_070412 #
  20. #                     DebugObj -z2 --no_cse --no_unroll --no_inline        #
  21. #                     --no_code_motion --debug -e                            #
  22. #                     E:projectFaxProgramVson_Bryan_Fax_Conexant_070412 #
  23. #                     filesFaxPropertyTableManage.c                         #
  24. #    List file     =  E:projectFaxProgramVson_Bryan_Fax_Conexant_070412 #
  25. #                     DebugListFaxPropertyTableManage.lst                  #
  26. #    Object file   =  E:projectFaxProgramVson_Bryan_Fax_Conexant_070412 #
  27. #                     DebugObjFaxPropertyTableManage.r43                   #
  28. #                                                                            #
  29. #                                                                            #
  30. ##############################################################################
  31. E:projectFaxProgramVson_Bryan_Fax_Conexant_070412filesFaxPropertyTableManage.c
  32.       1          /***************************************
  33.       2          Program:     Fax Property Table Manage
  34.       3          Author:      Bryan Cai
  35.       4          Date:        2006.12.13
  36.       5          ***************************************/
  37.       6          
  38.       7          #include "includeH.h"
  39.       8          
  40.       9          unsigned int  gwFaxPropertyAddress=64;
  41.      10          
  42.      11          void WriteFaxPropertyTable(void)
  43.      12          {
  44.      13          
  45.      14           unsigned char ucFlashSttsOverflowCnt=0,ucFaxPropertyLenCnt=0,
  46.      15                         ucRxIndex=0;
  47.      16          
  48.      17             COMMAND_VAL=cFlashWriteCmd;
  49.      18             COMMAND_LATCH_INTO();
  50.      19          //ADDRESS
  51.      20             
  52.      21             ADDRESS_VALUE=gwColumnAddress & 0xff;//COLUMN_ADDRESS_LOW;
  53.      22             ADDRESS_LATCH_INTO();
  54.      23          
  55.      24             ADDRESS_VALUE=(gwColumnAddress>>8) & 0XFF;//COLUMN_ADDRESS_HIGH;
  56.      25             ADDRESS_LATCH_INTO();
  57.      26          
  58.      27             ADDRESS_VALUE=gwFaxPropertyAddress & 0xff;
  59.      28             ADDRESS_LATCH_INTO();
  60.      29          
  61.      30             ADDRESS_VALUE=(gwFaxPropertyAddress>>8) & 0XFF;
  62.      31             ADDRESS_LATCH_INTO();
  63.      32             FLASH_CON_PORT_OUT &=~ ALE;
  64.      33          
  65.      34             DATA_PORT_OUT_INITIAL;
  66.      35             for (ucFaxPropertyLenCnt=0;ucFaxPropertyLenCnt<16;ucFaxPropertyLenCnt++)
  67.      36             {
  68.      37             FLASH_CON_PORT_OUT&=~WE;
  69.      38               DATA_PORT_OUT=aucUartRxBuf[ucRxIndex++];
  70.      39               FLASH_CON_PORT_OUT |= WE;
  71.      40             }
  72.      41          
  73.      42             COMMAND_VAL=cFlashWriteInitiateCmd; //10H INITIATES PROGRAM
  74.      43             COMMAND_LATCH_INTO();
  75.      44          
  76.      45             READ_STATUS();
  77.      46             ucFlashSttsOverflowCnt=0;
  78.      47             if(FLASH_STATUS==1&&(ucFlashSttsOverflowCnt++)<2)
  79.      48             {;}
  80.      49          }
  81.      50          void ReadLastFaxProperty(void)//find last fax property recorder
  82.      51          {
  83.      52           unsigned int wPageAddress=0, wBlockAddress=0,
  84.      53                        wColumnAddress=0,wNextPageAddress=0,
  85.      54                        wRearPntCnt=0;
  86.      55           unsigned char ucRxIndex=0,
  87.      56                         ucGeneralCnt=0,ucFaxPropertyLenCnt,
  88.      57                         ucRxIndex3=0,ucRxIndex2=0,
  89.      58                         ucRxIndex0=0,ucRxIndex1=0;
  90.      59          
  91.      60          
  92.      61            for (wBlockAddress=cFaxPropertyTableStartBlockNum;
  93.      62                wBlockAddress<=cFaxPropertyTableOverBlockNum;wBlockAddress++)
  94.      63           {
  95.      64          
  96.      65           for (wPageAddress=(wBlockAddress<<6);wPageAddress<((wBlockAddress<<6)+64);wPageAddress++)
  97.      66           {
  98.      67                do{
  99.      68               wNextPageAddress=wPageAddress+64;
  100.      69               wPageAddress=CalNextPageAddress(wPageAddress);
  101.      70                }while(wNextPageAddress==wPageAddress);
  102.      71                
  103.      72                wColumnAddress=0;
  104.      73                ROW_ADDRESS_LOW=wPageAddress & 0XFF;
  105.      74                ROW_ADDRESS_HIGH=(wPageAddress>>8) & 0XFF;
  106.      75                
  107.      76                for (ucGeneralCnt=0;ucGeneralCnt<8;ucGeneralCnt++)
  108.      77                {
  109.      78          //COMMAND
  110.      79             COMMAND_VAL=0x00; //#0X00 //00H READ1 0-2111BYTE
  111.      80             COMMAND_LATCH_INTO();
  112.      81          //ADDRESS
  113.      82          
  114.      83             ADDRESS_VALUE=wColumnAddress & 0xff;//COLUMN_ADDRESS_LOW;
  115.      84             ADDRESS_LATCH_INTO();
  116.      85          
  117.      86             ADDRESS_VALUE=(wColumnAddress>>8) & 0XFF;//COLUMN_ADDRESS_HIGH;
  118.      87             ADDRESS_LATCH_INTO();
  119.      88          
  120.      89             ADDRESS_VALUE=ROW_ADDRESS_LOW;
  121.      90             ADDRESS_LATCH_INTO();
  122.      91          
  123.      92             ADDRESS_VALUE=ROW_ADDRESS_HIGH;
  124.      93             ADDRESS_LATCH_INTO();
  125.      94             FLASH_CON_PORT_OUT &=~ ALE;
  126.      95          
  127.      96             COMMAND_VAL=0X30;
  128.      97             COMMAND_LATCH_INTO();
  129.      98             //ATcmdDelay();
  130.      99             while((FLASH_CON_PORT_IN & RB)==0);
  131.     100             DATA_PORT_IN_INITIAL;
  132.     101             for (ucFaxPropertyLenCnt=0;ucFaxPropertyLenCnt<16;ucFaxPropertyLenCnt++)
  133.     102             {
  134.     103               FLASH_CON_PORT_OUT &=~ RE; //RE IS LOW,ENABLE READ DATA
  135.     104               aucUartRxBuf[ucRxIndex++]=DATA_PORT_IN;
  136.     105               FLASH_CON_PORT_OUT |= RE;
  137.     106             }
  138.     107             wRearPntCnt++;
  139.     108             ucRxIndex3=ucRxIndex-4;
  140.     109                ucRxIndex2=ucRxIndex-3;
  141.     110                ucRxIndex1=ucRxIndex-2;
  142.     111                ucRxIndex0=ucRxIndex-1;
  143.     112               if (0xff == aucUartRxBuf[ucRxIndex0] && 0xff == aucUartRxBuf[ucRxIndex1] &&
  144.     113                  0xff == aucUartRxBuf[ucRxIndex2] && 0xff == aucUartRxBuf[ucRxIndex3])
  145.     114                {
  146.     115                break;  //next rear   
  147.     116                }//if
  148.     117             if (ucGeneralCnt<4)
  149.     118            wColumnAddress+=512;
  150.     119                    else
  151.     120            wColumnAddress+=16;
  152.     121             }//for read next rear pointer
  153.     122             
  154.     123             //ucRxIndex3=gucUartRxCnt-4;
  155.     124              //ucRxIndex2=gucUartRxCnt-3;
  156.     125              //ucRxIndex1=gucUartRxCnt-2;
  157.     126              //ucRxIndex0=gucUartRxCnt-1;
  158.     127             if (0xff == aucUartRxBuf[ucRxIndex0] && 0xff == aucUartRxBuf[ucRxIndex1] &&
  159.     128                0xff == aucUartRxBuf[ucRxIndex2] && 0xff == aucUartRxBuf[ucRxIndex3])
  160.     129               {break;}
  161.     130             }//for next page
  162.     131          
  163.     132             //ucRxIndex3=gucUartRxCnt-4;
  164.     133              //ucRxIndex2=gucUartRxCnt-3;
  165.     134              //ucRxIndex1=gucUartRxCnt-2;
  166.     135              //ucRxIndex0=gucUartRxCnt-1;
  167.     136             if (0xff == aucUartRxBuf[ucRxIndex0] && 0xff == aucUartRxBuf[ucRxIndex1] &&
  168.     137                0xff == aucUartRxBuf[ucRxIndex2] && 0xff == aucUartRxBuf[ucRxIndex3])
  169.     138               {break;}
  170.     139           }//for next block
  171.     140           gwFaxPropertyAddress=wPageAddress; //for write Fax property record
  172.     141            gwColumnAddress=wColumnAddress; //
  173.     142          }
  174. Errors: 6
  175. Warnings: none