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

传真(Fax)编程

开发平台:

C/C++

  1. ##############################################################################
  2. #                                                                            #
  3. # IAR MSP430 C/EC++ Compiler V2.10A/W32                23/Apr/2007  18:04:08 #
  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_070423 #
  12. #                     filesFaxData2pc.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_070423 #
  17. #                     DebugList -lA E:projectFaxProgramVson_Bryan_Fax_ #
  18. #                     Conexant_070423DebugList -o                         #
  19. #                     E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
  20. #                     DebugObj -z2 --no_cse --no_unroll --no_inline        #
  21. #                     --no_code_motion --debug -e                            #
  22. #                     E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
  23. #                     filesFaxData2pc.c                                     #
  24. #    List file     =  E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
  25. #                     DebugListFaxData2pc.lst                              #
  26. #    Object file   =  E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
  27. #                     DebugObjFaxData2pc.r43                               #
  28. #                                                                            #
  29. #                                                                            #
  30. ##############################################################################
  31. E:projectFaxProgramVson_Bryan_Fax_Conexant_070423filesFaxData2pc.c
  32.       1          /************************************************
  33.       2          Description: 
  34.       3                Send the received fax raw data to PC via MAX232
  35.       4                3G 2-dimensional Data Format Recommendation T.4
  36.       5          Input:
  37.       6                none
  38.       7          Output:
  39.       8                none
  40.       9          Update:
  41.      10                2006.11.02  Bryan      function header     create
  42.      11          ************************************************/
  43.      12          
  44.      13          #include "includeH.h"
  45.                                     In segment DATA16_AN, at 0x35
  46.       unsigned char volatile __data P6OUT
  47.                         P6OUT:
  48.       000000                        DS8 1
  49.      14          
  50.                                     In segment CODE, align 2, keep-with-next
  51.      15          void  FaxData2PCFromSoftUart(void) // send the received fax data to PC via MAX232
  52.                         FaxData2PCFromSoftUart:
  53.      16          {     
  54.       000000   0A12                 PUSH.W  R10
  55.       000002   0B12                 PUSH.W  R11
  56.       000004   0812                 PUSH.W  R8
  57.       000006   0912                 PUSH.W  R9
  58.       000008   0612                 PUSH.W  R6
  59.       00000A   0712                 PUSH.W  R7
  60.       00000C   0412                 PUSH.W  R4
  61.       00000E   0512                 PUSH.W  R5
  62.       000010   2183                 SUB.W   #0x2, SP
  63.      17                unsigned char ucFlashColumnAddCnt=0,
  64.       000012   4743                 MOV.B   #0x0, R7
  65.      18                              ucRxIndex=0,ucBlockCnt=0;
  66.       000014   4A43                 MOV.B   #0x0, R10
  67.       000016   4B43                 MOV.B   #0x0, R11
  68.      19                unsigned char ucGeneralCnt=0;
  69.       000018   4443                 MOV.B   #0x0, R4
  70.      20                unsigned int wNewFaxHead=0, wNewFaxRear=0,
  71.       00001A   81430000             MOV.W   #0x0, 0x0(SP)
  72.       00001E   0543                 MOV.W   #0x0, R5
  73.      21                             wNextPageAddress=0,wPageAddress=0,
  74.       000020   0843                 MOV.W   #0x0, R8
  75.       000022   0943                 MOV.W   #0x0, R9
  76.      22                             wGeneralCnt=0;
  77.       000024   0643                 MOV.W   #0x0, R6
  78.      23                //ucGeneralCnt=2;
  79.      24                //ZERO_ADDRESS();
  80.      25                //read rear pointer and read front pointer
  81.      26                //if RearAddress-FrontAddress!=0
  82.      27                //   transfer and front++
  83.      28                //else
  84.      29                //   transfer over
  85.      30                MODEM_BUS_CON_PORT |= SOFT_UART_2_PC;
  86.       000026   F2D010003500         BIS.B   #0x10, &0x35
  87.      31                ReadLastFaxRearPointer();//get gwRearPointerAddress and gwPageAddress
  88.       00002C   7E401200             MOV.B   #0x12, R14
  89.       000030   7C400F00             MOV.B   #0xf, R12
  90.       000034   B012....             CALL    #ReadLast16BytesFromFlashMemoryArea
  91.      32                //ReadLast16BytesFromFlashMemoryArea(cstFaxRearPointerTableStartBlockNum,cstFaxRearPointerTableOverBlockNum);
  92.      33                wNewFaxRear=gwPageAddress;
  93.       000038   1542....             MOV.W   &gwPageAddress, R5
  94.      34                ReadLastFaxFrontPointer();//get gwFrontPointerAddress, gwPageAddress, 
  95.       00003C   7E400E00             MOV.B   #0xe, R14
  96.       000040   7C400B00             MOV.B   #0xb, R12
  97.       000044   B012....             CALL    #ReadLast16BytesFromFlashMemoryArea
  98.      35                                          //gwFrontPointerAddress and gwColumnAddress
  99.      36                gwPageAddress++;           //add Dec.19, 2006
  100.       000048   9253....             ADD.W   #0x1, &gwPageAddress
  101.      37                do{
  102.      38              wNextPageAddress=gwPageAddress+64;
  103.                         ??FaxData2PCFromSoftUart_0:
  104.       00004C   3E404000             MOV.W   #0x40, R14
  105.       000050   1E52....             ADD.W   &gwPageAddress, R14
  106.       000054   084E                 MOV.W   R14, R8
  107.      39              wPageAddress=CalNextPageAddress(wPageAddress);
  108.       000056   0C49                 MOV.W   R9, R12
  109.       000058   B012....             CALL    #CalNextPageAddress
  110.       00005C   094C                 MOV.W   R12, R9
  111.      40           }while(wNextPageAddress==wPageAddress);
  112.       00005E   0899                 CMP.W   R9, R8
  113.       000060   F527                 JEQ     ??FaxData2PCFromSoftUart_0
  114.      41                wNewFaxHead=gwPageAddress;
  115.       000062   9142....0000         MOV.W   &gwPageAddress, 0x0(SP)
  116.      42                if (wNewFaxHead<wNewFaxRear)//(wNewFaxHead!=wNewFaxRear)//modify Dec.20,2006
  117.       000068   81950000             CMP.W   R5, 0x0(SP)
  118.       00006C   DD2C                 JC      ??FaxData2PCFromSoftUart_8
  119.      43                {
  120.      44                   
  121.      45                for (wPageAddress=wNewFaxHead;wPageAddress<=wNewFaxRear;)//wNewFaxHead
  122.       00006E   2941                 MOV.W   0x0(SP), R9
  123.                         ??FaxData2PCFromSoftUart_6:
  124.       000070   0599                 CMP.W   R9, R5
  125.       000072   DA28                 JNC     ??FaxData2PCFromSoftUart_8
  126.      46                {
  127.      47                  
  128.      48                  ROW_ADDRESS_LOW = wPageAddress & 0xff;
  129.       000074   C249....             MOV.B   R9, &ROW_ADDRESS_LOW
  130.      49                  ROW_ADDRESS_HIGH = (wPageAddress>>8) & 0xff;
  131.       000078   0E49                 MOV.W   R9, R14
  132.       00007A   8E10                 SWPB    R14
  133.       00007C   3EF0FF00             AND.W   #0xff, R14
  134.       000080   C24E....             MOV.B   R14, &ROW_ADDRESS_HIGH
  135.      50                  for (ucFlashColumnAddCnt = 0;ucFlashColumnAddCnt < 8;ucFlashColumnAddCnt++)//8*256=2048
  136.       000084   4743                 MOV.B   #0x0, R7
  137.                         ??FaxData2PCFromSoftUart_2:
  138.       000086   7792                 CMP.B   #0x8, R7
  139.       000088   3A2C                 JC      ??FaxData2PCFromSoftUart_9
  140.      51                  {
  141.      52               //8 * 256 == 2048 Bytes 2^4*2^8 12bit column address HighColumnAddr:0~8
  142.      53                      //total 8*256B+64B=2K+64B
  143.      54               COLUMN_ADDRESS_HIGH=ucFlashColumnAddCnt;
  144.       00008A   C247....             MOV.B   R7, &COLUMN_ADDRESS_HIGH
  145.      55               READ_256_BYTE();//read 256 Byte to aucUartRxBuf[256]
  146.       00008E   B012....             CALL    #READ_256_BYTE
  147.      56               for (wGeneralCnt=0;wGeneralCnt<256;wGeneralCnt++)//
  148.       000092   0643                 MOV.W   #0x0, R6
  149.                         ??FaxData2PCFromSoftUart_1:
  150.       000094   36900001             CMP.W   #0x100, R6
  151.       000098   1C2C                 JC      ??FaxData2PCFromSoftUart_10
  152.      57               {
  153.      58           SoftUartTxOneFrame(aucUartRxBuf[wGeneralCnt]);
  154.       00009A   5C46....             MOV.B   aucUartRxBuf(R6), R12
  155.       00009E   B012....             CALL    #SoftUartTxOneFrame
  156.      59           if (aucUartRxBuf[wGeneralCnt-1] == 0xfb && aucUartRxBuf[wGeneralCnt-2] == 0x13 && aucUartRxBuf[wGeneralCnt-3] == 0xff)
  157.       0000A2   3E40....             MOV.W   #aucUartRxBuf, R14
  158.       0000A6   0E56                 ADD.W   R6, R14
  159.       0000A8   FE90FB00FFFF         CMP.B   #0xfb, 0xffff(R14)
  160.       0000AE   0F20                 JNE     ??FaxData2PCFromSoftUart_11
  161.       0000B0   3E40....             MOV.W   #aucUartRxBuf, R14
  162.       0000B4   0E56                 ADD.W   R6, R14
  163.       0000B6   FE901300FEFF         CMP.B   #0x13, 0xfffe(R14)
  164.       0000BC   0820                 JNE     ??FaxData2PCFromSoftUart_11
  165.       0000BE   3E40....             MOV.W   #aucUartRxBuf, R14
  166.       0000C2   0E56                 ADD.W   R6, R14
  167.       0000C4   FE93FDFF             CMP.B   #0xff, 0xfffd(R14)
  168.       0000C8   0220                 JNE     ??FaxData2PCFromSoftUart_11
  169.      60             {_NOP();break;}             
  170.       0000CA   0343                 NOP
  171.       0000CC   023C                 JMP     ??FaxData2PCFromSoftUart_10
  172.      61               }//third for
  173.                         ??FaxData2PCFromSoftUart_11:
  174.       0000CE   1653                 ADD.W   #0x1, R6
  175.       0000D0   E13F                 JMP     ??FaxData2PCFromSoftUart_1
  176.      62               if (aucUartRxBuf[wGeneralCnt-1] == 0xfb && aucUartRxBuf[wGeneralCnt-2] == 0x13 && aucUartRxBuf[wGeneralCnt-3] == 0xff)
  177.                         ??FaxData2PCFromSoftUart_10:
  178.       0000D2   3E40....             MOV.W   #aucUartRxBuf, R14
  179.       0000D6   0E56                 ADD.W   R6, R14
  180.       0000D8   FE90FB00FFFF         CMP.B   #0xfb, 0xffff(R14)
  181.       0000DE   0D20                 JNE     ??FaxData2PCFromSoftUart_12
  182.       0000E0   3E40....             MOV.W   #aucUartRxBuf, R14
  183.       0000E4   0E56                 ADD.W   R6, R14
  184.       0000E6   FE901300FEFF         CMP.B   #0x13, 0xfffe(R14)
  185.       0000EC   0620                 JNE     ??FaxData2PCFromSoftUart_12
  186.       0000EE   3E40....             MOV.W   #aucUartRxBuf, R14
  187.       0000F2   0E56                 ADD.W   R6, R14
  188.       0000F4   FE93FDFF             CMP.B   #0xff, 0xfffd(R14)
  189.       0000F8   0224                 JEQ     ??FaxData2PCFromSoftUart_9
  190.      63             break;        
  191.      64                  }//second for
  192.                         ??FaxData2PCFromSoftUart_12:
  193.       0000FA   5753                 ADD.B   #0x1, R7
  194.       0000FC   C43F                 JMP     ??FaxData2PCFromSoftUart_2
  195.      65                  
  196.      66                 if (aucUartRxBuf[wGeneralCnt-1] == 0xfb && aucUartRxBuf[wGeneralCnt-2] == 0x13 && aucUartRxBuf[wGeneralCnt-3] == 0xff)//pageimage over
  197.                         ??FaxData2PCFromSoftUart_9:
  198.       0000FE   3E40....             MOV.W   #aucUartRxBuf, R14
  199.       000102   0E56                 ADD.W   R6, R14
  200.       000104   FE90FB00FFFF         CMP.B   #0xfb, 0xffff(R14)
  201.       00010A   7E20                 JNE     ??FaxData2PCFromSoftUart_13
  202.       00010C   3E40....             MOV.W   #aucUartRxBuf, R14
  203.       000110   0E56                 ADD.W   R6, R14
  204.       000112   FE901300FEFF         CMP.B   #0x13, 0xfffe(R14)
  205.       000118   7720                 JNE     ??FaxData2PCFromSoftUart_13
  206.       00011A   3E40....             MOV.W   #aucUartRxBuf, R14
  207.       00011E   0E56                 ADD.W   R6, R14
  208.       000120   FE93FDFF             CMP.B   #0xff, 0xfffd(R14)
  209.       000124   7120                 JNE     ??FaxData2PCFromSoftUart_13
  210.      67                    {                                                 
  211.      68                      ATcmdDelay();// a bug of Dec.23,2006 FF 10 00 0E // receive data delay(if not, can't receive 0x10 0x03)
  212.       000126   B012....             CALL    #ATcmdDelay
  213.      69                      if ((gwGeneralPageAddress>>6) >=cstFaxFrontPointerTableOverBlockNum)
  214.       00012A   1C42....             MOV.W   &gwGeneralPageAddress, R12
  215.       00012E   B012....             CALL    #?ShiftRight16u_6
  216.       000132   3C900E00             CMP.W   #0xe, R12
  217.       000136   1C28                 JNC     ??FaxData2PCFromSoftUart_14
  218.      70                     {
  219.      71                      for (ucBlockCnt=0;ucBlockCnt<4;ucBlockCnt++)
  220.       000138   4B43                 MOV.B   #0x0, R11
  221.                         ??FaxData2PCFromSoftUart_3:
  222.       00013A   6B92                 CMP.B   #0x4, R11
  223.       00013C   142C                 JC      ??FaxData2PCFromSoftUart_15
  224.      72                      {
  225.      73                           wPageAddress=(cstFaxFrontPointerTableStartBlockNum+ucBlockCnt)<<6;
  226.       00013E   4C4B                 MOV.B   R11, R12
  227.       000140   3CF0FF00             AND.W   #0xff, R12
  228.       000144   3C500B00             ADD.W   #0xb, R12
  229.       000148   B012....             CALL    #?ShiftLeft16_6
  230.       00014C   094C                 MOV.W   R12, R9
  231.      74                     ROW_ADDRESS_LOW=wPageAddress & 0XFF;
  232.       00014E   C249....             MOV.B   R9, &ROW_ADDRESS_LOW
  233.      75                     ROW_ADDRESS_HIGH=(wPageAddress>>8) & 0XFF; 
  234.       000152   0E49                 MOV.W   R9, R14
  235.       000154   8E10                 SWPB    R14
  236.       000156   3EF0FF00             AND.W   #0xff, R14
  237.       00015A   C24E....             MOV.B   R14, &ROW_ADDRESS_HIGH
  238.      76                     ERASE_ONE_BLOCK();
  239.       00015E   B012....             CALL    #ERASE_ONE_BLOCK
  240.      77                      }
  241.       000162   5B53                 ADD.B   #0x1, R11
  242.       000164   EA3F                 JMP     ??FaxData2PCFromSoftUart_3
  243.      78                      gwGeneralPageAddress=cstFaxFrontPointerTableStartPage;
  244.                         ??FaxData2PCFromSoftUart_15:
  245.       000166   B240C002....         MOV.W   #0x2c0, &gwGeneralPageAddress
  246.      79                      gwColumnAddress=0;
  247.       00016C   8243....             MOV.W   #0x0, &gwColumnAddress
  248.      80                     }
  249.      81                     
  250.      82                      
  251.      83                          
  252.      84                      ucRxIndex=0; //write Fax Rear Pointer
  253.                         ??FaxData2PCFromSoftUart_14:
  254.       000170   4A43                 MOV.B   #0x0, R10
  255.      85                      aucUartRxBuf[ucRxIndex++]=wPageAddress & 0xff;
  256.       000172   4E4A                 MOV.B   R10, R14
  257.       000174   3EF0FF00             AND.W   #0xff, R14
  258.       000178   CE49....             MOV.B   R9, aucUartRxBuf(R14)
  259.       00017C   5A53                 ADD.B   #0x1, R10
  260.      86                      aucUartRxBuf[ucRxIndex++]=(wPageAddress>>8) & 0xff;
  261.       00017E   4F4A                 MOV.B   R10, R15
  262.       000180   3FF0FF00             AND.W   #0xff, R15
  263.       000184   0E49                 MOV.W   R9, R14
  264.       000186   8E10                 SWPB    R14
  265.       000188   3EF0FF00             AND.W   #0xff, R14
  266.       00018C   CF4E....             MOV.B   R14, aucUartRxBuf(R15)
  267.       000190   5A53                 ADD.B   #0x1, R10
  268.      87                      for(ucGeneralCnt=0;ucGeneralCnt<14;ucGeneralCnt++)
  269.       000192   4443                 MOV.B   #0x0, R4
  270.                         ??FaxData2PCFromSoftUart_4:
  271.       000194   74900E00             CMP.B   #0xe, R4
  272.       000198   092C                 JC      ??FaxData2PCFromSoftUart_16
  273.      88                      {
  274.      89                        aucUartRxBuf[ucRxIndex++] = 0x55;
  275.       00019A   4E4A                 MOV.B   R10, R14
  276.       00019C   3EF0FF00             AND.W   #0xff, R14
  277.       0001A0   FE405500....         MOV.B   #0x55, aucUartRxBuf(R14)
  278.       0001A6   5A53                 ADD.B   #0x1, R10
  279.      90                      }
  280.       0001A8   5453                 ADD.B   #0x1, R4
  281.       0001AA   F43F                 JMP     ??FaxData2PCFromSoftUart_4
  282.      91                      Write16Bytes2FlashMemoryArea();
  283.                         ??FaxData2PCFromSoftUart_16:
  284.       0001AC   B012....             CALL    #Write16Bytes2FlashMemoryArea
  285.      92                      if (gwColumnAddress<2096)
  286.       0001B0   B2903008....         CMP.W   #0x830, &gwColumnAddress
  287.       0001B6   0C2C                 JC      ??FaxData2PCFromSoftUart_17
  288.      93                      {
  289.      94                      if (gwColumnAddress<2048)
  290.       0001B8   B2900008....         CMP.W   #0x800, &gwColumnAddress
  291.       0001BE   042C                 JC      ??FaxData2PCFromSoftUart_18
  292.      95            gwColumnAddress+=512;
  293.       0001C0   B2500002....         ADD.W   #0x200, &gwColumnAddress
  294.       0001C6   103C                 JMP     ??FaxData2PCFromSoftUart_19
  295.      96                      else
  296.      97            gwColumnAddress+=16;
  297.                         ??FaxData2PCFromSoftUart_18:
  298.       0001C8   B2501000....         ADD.W   #0x10, &gwColumnAddress
  299.       0001CE   0C3C                 JMP     ??FaxData2PCFromSoftUart_19
  300.      98                      }
  301.      99                      else
  302.     100                          {
  303.     101                           gwColumnAddress=0;
  304.                         ??FaxData2PCFromSoftUart_17:
  305.       0001D0   8243....             MOV.W   #0x0, &gwColumnAddress
  306.     102                           if (gwGeneralPageAddress<=959)gwGeneralPageAddress++;
  307.       0001D4   B290C003....         CMP.W   #0x3c0, &gwGeneralPageAddress
  308.       0001DA   032C                 JC      ??FaxData2PCFromSoftUart_20
  309.       0001DC   9253....             ADD.W   #0x1, &gwGeneralPageAddress
  310.       0001E0   033C                 JMP     ??FaxData2PCFromSoftUart_19
  311.     103                           else
  312.     104                             gwGeneralPageAddress=704;
  313.                         ??FaxData2PCFromSoftUart_20:
  314.       0001E2   B240C002....         MOV.W   #0x2c0, &gwGeneralPageAddress
  315.     105                          }
  316.     106                      wPageAddress++;
  317.                         ??FaxData2PCFromSoftUart_19:
  318.       0001E8   1953                 ADD.W   #0x1, R9
  319.     107                      if(wPageAddress==0)
  320.       0001EA   0993                 CMP.W   #0x0, R9
  321.       0001EC   0220                 JNE     ??FaxData2PCFromSoftUart_5
  322.     108                         wPageAddress+=2560;//Mar. 1, 20007
  323.       0001EE   3950000A             ADD.W   #0xa00, R9
  324.     109                      do{
  325.     110                 wNextPageAddress=wPageAddress+64;
  326.                         ??FaxData2PCFromSoftUart_5:
  327.       0001F2   3E404000             MOV.W   #0x40, R14
  328.       0001F6   0E59                 ADD.W   R9, R14
  329.       0001F8   084E                 MOV.W   R14, R8
  330.     111                 wPageAddress=CalNextPageAddress(wPageAddress);
  331.       0001FA   0C49                 MOV.W   R9, R12
  332.       0001FC   B012....             CALL    #CalNextPageAddress
  333.       000200   094C                 MOV.W   R12, R9
  334.     112                 }while(wNextPageAddress==wPageAddress);
  335.       000202   0899                 CMP.W   R9, R8
  336.       000204   F627                 JEQ     ??FaxData2PCFromSoftUart_5
  337.       000206   343F                 JMP     ??FaxData2PCFromSoftUart_6
  338.     113                       //ReadLastFaxFrontPointer();//read next write fax front pointer addr    //delete at Jan. 19, 2007
  339.     114                      continue;//break; a bug of Dec. 12,2006
  340.     115                    }
  341.     116                    wPageAddress++;
  342.                         ??FaxData2PCFromSoftUart_13:
  343.       000208   1953                 ADD.W   #0x1, R9
  344.     117                    if(wPageAddress==0)
  345.       00020A   0993                 CMP.W   #0x0, R9
  346.       00020C   0220                 JNE     ??FaxData2PCFromSoftUart_7
  347.     118                         wPageAddress+=2560;//Mar. 1, 20007
  348.       00020E   3950000A             ADD.W   #0xa00, R9
  349.     119                      do{
  350.     120                 wNextPageAddress=wPageAddress+64;//wNextPageAddress=gwPageAddress+64;
  351.                         ??FaxData2PCFromSoftUart_7:
  352.       000212   3E404000             MOV.W   #0x40, R14
  353.       000216   0E59                 ADD.W   R9, R14
  354.       000218   084E                 MOV.W   R14, R8
  355.     121                 wPageAddress=CalNextPageAddress(wPageAddress);
  356.       00021A   0C49                 MOV.W   R9, R12
  357.       00021C   B012....             CALL    #CalNextPageAddress
  358.       000220   094C                 MOV.W   R12, R9
  359.     122                 }while(wNextPageAddress==wPageAddress);             
  360.       000222   0899                 CMP.W   R9, R8
  361.       000224   F627                 JEQ     ??FaxData2PCFromSoftUart_7
  362.       000226   243F                 JMP     ??FaxData2PCFromSoftUart_6
  363.     123                 }//third for ----> next page
  364.     124                 
  365.     125                 }//if wNewFaxHead<wNewFaxRear
  366.     126                 MODEM_BUS_CON_PORT &= ~SOFT_UART_2_PC;
  367.                         ??FaxData2PCFromSoftUart_8:
  368.       000228   F2C010003500         BIC.B   #0x10, &0x35
  369.     127          }//function over  
  370.       00022E   2153                 ADD.W   #0x2, SP
  371.       000230   3040....             BR      #?Epilogue8
  372.     128          
  373.     129          /*
  374.     130          void  FaxData2PCFromUart(void) // send the received fax data to PC via MAX232
  375.     131          {     
  376.     132                unsigned char ucFlashColumnAddCnt=0,ucRxIndex=0,
  377.     133                              ucGeneralCnt=0;
  378.     134                unsigned int wNewFaxHead=0, wNewFaxRear=0,
  379.     135                             wNextPageAddress=0,wPageAddress=0;
  380.     136                //ucGeneralCnt=2;
  381.     137                //ZERO_ADDRESS();
  382.     138                //read rear pointer and read front pointer
  383.     139                //if RearAddress-FrontAddress!=0
  384.     140                //   transfer and front++
  385.     141                //else
  386.     142                //   transfer over
  387.     143                ReadLastFaxRearPointer();//get gwRearPointerAddress and gwPageAddress
  388.     144                wNewFaxRear=gwPageAddress;
  389.     145                ReadLastFaxFrontPointer();//get gwFrontPointerAddress, gwPageAddress, 
  390.     146                                          //gwFrontPointerAddress and gwColumnAddress
  391.     147                gwPageAddress++;           //add Dec.19, 2006
  392.     148                do{
  393.     149              wNextPageAddress=gwPageAddress+64;
  394.     150              wPageAddress=CalNextPageAddress(wPageAddress);
  395.     151           }while(wNextPageAddress==wPageAddress);
  396.     152                wNewFaxHead=gwPageAddress;
  397.     153                if (wNewFaxHead<wNewFaxRear)//(wNewFaxHead!=wNewFaxRear)//modify Dec.20,2006
  398.     154                {
  399.     155                   
  400.     156                for (wPageAddress=wNewFaxHead;wPageAddress<=wNewFaxRear;)//wNewFaxHead
  401.     157                {
  402.     158                  
  403.     159                  ROW_ADDRESS_LOW = wPageAddress & 0xff;
  404.     160                  ROW_ADDRESS_HIGH = (wPageAddress>>8) & 0xff;
  405.     161                  for (ucFlashColumnAddCnt = 0;ucFlashColumnAddCnt < 8;ucFlashColumnAddCnt++)//8*256=2048
  406.     162                  {
  407.     163                   //8 * 256 == 2048 Bytes 2^4*2^8 12bit column address HighColumnAddr:0~8
  408.     164                      //total 8*256B+64B=2K+64B
  409.     165                   COLUMN_ADDRESS_HIGH=ucFlashColumnAddCnt;
  410.     166                   READ_256_BYTE();//read 256 Byte to aucUartRxBuf[256]
  411.     167                   for (ucGeneralCnt=0;ucGeneralCnt<4;ucGeneralCnt++)//16*16Bytes send 16Bytes one time
  412.     168                                                                     //modify Dec.28,2006 4*64Bytes one time
  413.     169                   {
  414.     170                       Send64BytePageImageData(64,ucGeneralCnt);
  415.     171                       while(gucTxBufCnt!=0)//send over, gucTxBufCnt == 0
  416.     172                       { 
  417.     173                         ;
  418.     174                       }
  419.     175                       //ATcmdDelay();
  420.     176                       if (gwTxNum != 64 && TXBUF0==0xfb)
  421.     177                           break;
  422.     178                   }//third for
  423.     179                   if (gwTxNum != 64)
  424.     180                       break;
  425.     181                  }//second for
  426.     182                  
  427.     183                  if ((gwTxNum != 64) 
  428.     184                      || (aucUartTxBuf[gwTxNum-1] == 0xfb && aucUartTxBuf[gwTxNum-2] == 0x13 && aucUartTxBuf[gwTxNum-3] == 0xff)
  429.     185                      //(aucUartTxBuf[gwTxNum] == 0xfb && aucUartTxBuf[gwTxNum-1] == 0x13 && aucUartTxBuf[gwTxNum-2] == 0xff)//a bug of Jan.24, 2007 
  430.     186                      )//gwTxNum!=16, pageimage over
  431.     187                    {                                                 //(gwTxNum != 16) modify Dec.20,2006 
  432.     188                      ATcmdDelay();// a bug of Dec.23,2006 FF 10 00 0E // receive data delay(if not, can't receive 0x10 0x03)
  433.     189                      ucRxIndex=0; //write Fax Rear Pointer
  434.     190                      aucUartRxBuf[ucRxIndex++]=wPageAddress & 0xff;
  435.     191                      aucUartRxBuf[ucRxIndex++]=(wPageAddress>>8) & 0xff;
  436.     192                      aucUartRxBuf[ucRxIndex++]=0x55;
  437.     193                      aucUartRxBuf[ucRxIndex++]=0x55;
  438.     194                      WriteFaxFrontPointerTable();
  439.     195                      wPageAddress++;
  440.     196                      do{
  441.     197                 wNextPageAddress=wPageAddress+64;
  442.     198                 wPageAddress=CalNextPageAddress(wPageAddress);
  443.     199                 }while(wNextPageAddress==wPageAddress);
  444.     200                       //ReadLastFaxFrontPointer();//read next write fax front pointer addr    //delete at Jan. 19, 2007
  445.     201                      continue;//break; a bug of Dec. 12,2006
  446.     202                   }
  447.     203                    wPageAddress++;
  448.     204                      do{
  449.     205                 wNextPageAddress=wPageAddress+64;//wNextPageAddress=gwPageAddress+64;
  450.     206                 wPageAddress=CalNextPageAddress(wPageAddress);
  451.     207                 }while(wNextPageAddress==wPageAddress);             
  452.     208                 }//for ----> next page
  453.     209                 
  454.     210                 //ATcmdDelay();     // receive data delay(if not, can't receive 0x10 0x03)
  455.     211                 
  456.     212                 
  457.     213                 }//if RearPointer!=FrontPointer
  458.     214                 //gucRxTxFlag = DTETX;  // Del at Dec.25,2006
  459.     215          }   
  460.     216          */
  461.     217          /*
  462.     218          void Send64BytePageImageData(unsigned char ucTxDataNum,unsigned char ucGeneralCnt)
  463.     219          {   
  464.     220              unsigned char ucDataCnt = 0;
  465.     221                                        
  466.     222              gwTxNum=ucTxDataNum;
  467.     223              gpucTxBufPnt = 0;
  468.     224              for(ucDataCnt=0;ucDataCnt<64;ucDataCnt++) //ready data to TxdataBuf[]
  469.     225                {
  470.     226                  aucUartTxBuf[ucDataCnt]=aucUartRxBuf[64*ucGeneralCnt+ucDataCnt];
  471.     227                  gdwRxQueueFrontCnt++;
  472.     228                  //There is a bug. when a[255]==10 && a[0]==03 && a[1]==fb, it will be error. it should add Length Judge
  473.     229                  if (aucUartTxBuf[ucDataCnt] == 0xfb && aucUartTxBuf[ucDataCnt-1] == 0x13 && aucUartTxBuf[ucDataCnt-2] == 0xff)
  474.     230                  {
  475.     231                    gwTxNum = ucDataCnt+1;
  476.     232                    break;
  477.     233                  }       
  478.     234                }            
  479.     235              TXBUF0=aucUartTxBuf[0];    //start sent
  480.     236              gucTxBufCnt=1;             //aucUartTxBuf[0] is the first byte, next TX is the second.
  481.     237          } 
  482.     238          */ 
  483.    Maximum stack usage in bytes:
  484.      Function                       CSTACK
  485.      --------                       ------
  486.      FaxData2PCFromSoftUart            20
  487.        -> ReadLast16BytesFromFlashMemoryArea
  488.                                        20
  489.        -> ReadLast16BytesFromFlashMemoryArea
  490.                                        20
  491.        -> CalNextPageAddress           20
  492.        -> READ_256_BYTE                20
  493.        -> SoftUartTxOneFrame           20
  494.        -> ATcmdDelay                   20
  495.        -> ERASE_ONE_BLOCK              20
  496.        -> Write16Bytes2FlashMemoryArea
  497.                                        20
  498.        -> CalNextPageAddress           20
  499.        -> CalNextPageAddress           20
  500.    Segment part sizes:
  501.      Function/Label         Bytes
  502.      --------------         -----
  503.      P6OUT                     1
  504.      FaxData2PCFromSoftUart  564
  505.  
  506.  564 bytes in segment CODE
  507.    1 byte  in segment DATA16_AN
  508.  
  509.  564 bytes of CODE memory
  510.    0 bytes of DATA memory (+ 1 byte shared)
  511. Errors: none
  512. Warnings: none