C51 COMPILER V9.52.0.0   HALL                                                              09/21/2018 10:50:00 PAGE 1   


C51 COMPILER V9.52.0.0, COMPILATION OF MODULE HALL
OBJECT MODULE PLACED IN .\Output\HALL.obj
COMPILER INVOKED BY: F:\keil\C51\BIN\C51.EXE ..\User\Source\Function\HALL.c LARGE OMF2 WARNINGLEVEL(0) BROWSE INCDIR(..\
                    -Library\FU68xx_Hardware_Driver\Include;..\User\Include) DEBUG PRINT(.\Listing\HALL.lst) OBJECT(.\Output\HALL.obj)

line level    source

   1          /**************************** (C) COPYRIGHT 2017 Fortiortech shenzhen *****************************
   2          * File Name          : AddFunction.c
   3          * Author             : Vina Peng,Fortiortech  Appliction Team
   4          * Version            : V1.0
   5          * Date               : 10-Apr-2017
   6          * Description        : This file contains MDU initial function used for Motor Control.
   7          ***************************************************************************************************
   8          * All Rights Reserved
   9          **************************************************************************************************/
  10          
  11          
  12          /* Includes -------------------------------------------------------------------------------------*/
  13          #include <FU68xx_2.h>
  14          #include <Myproject.h>
  15          
  16          
  17          //HALL 笴綴毀萇雄岊25僅
  18          //#define       HallDetaAngle                    _Q15(10.0/180.0)                                       // HALL閉ヶ+麼氪笴綴-褒  ccw60
  19          // 齊嫌睿毀萇雄岊憤俶眈肮   //5->1->3->2->6->4   0～->60～->120～->180～->240～->300～
  20          int16 xdata Hall_Angle_Arr[6] = {_Q15(91.6/180.0),_Q15(211.6/180.0),_Q15(151.6/180.0),_Q15(331.6/180.0),_Q
             -15(31.6/180.0),_Q15(271.6/180.0)};    
  21          
  22          extern  int Test2;
  23          extern  int tTest3;
  24          
  25                  
  26          /*---------------------------------------------------------------------------*/
  27          /* Name         :       uint8  HallCommutation(uint8 GivenFR_Status ,uint8 Hall_Status_Result )
  28          /* Input        :       GivenFR_Status 絞ヶ源砃ㄛHall_Status_Result絞ヶhall陓瘍
  29          /* Output       :       Hall_Status_Next 狟珨祭hall陓瘍
  30          /* Description: 
  31          /*---------------------------------------------------------------------------*/
  32          uint8  HallCommutation(uint8 GivenFR_Status ,uint8 Hall_Status_Result)
  33          {
  34   1              static uint8 Hall_Status_Next = 0;
  35   1              //CW  5->1->3->2->6->4
  36   1                      if(GivenFR_Status == CW)
  37   1                      {       
  38   2                                      switch(Hall_Status_Result)
  39   2                                      {
  40   3                                              case 1:
  41   3                                                      Hall_Status_Next = 3;
  42   3                                                      break;
  43   3                                              case 2:
  44   3                                                      Hall_Status_Next = 6;
  45   3                                                      break;
  46   3                                              case 3:
  47   3                                                      Hall_Status_Next = 2;
  48   3                                                      break;
  49   3                                              case 4:
  50   3                                                      Hall_Status_Next = 5;
  51   3                                                      break;
  52   3                                              case 5:
  53   3                                                      Hall_Status_Next = 1;
C51 COMPILER V9.52.0.0   HALL                                                              09/21/2018 10:50:00 PAGE 2   

  54   3                                                      break;
  55   3                                              case 6:
  56   3                                                      Hall_Status_Next = 4;
  57   3                                                      break;
  58   3                                              default:
  59   3                                                      break;
  60   3                                       }
  61   2                       }               
  62   1                      //CCW 5->4->6->2->3->1
  63   1                      if(GivenFR_Status == CCW)
  64   1                      {
  65   2                              switch(Hall_Status_Result)
  66   2                              {
  67   3                                      case 1:
  68   3                                        Hall_Status_Next = 5;
  69   3                                              break;
  70   3                                      case 2:
  71   3                                        Hall_Status_Next = 3;
  72   3                                              break;
  73   3                                      case 3:
  74   3                                        Hall_Status_Next = 1;
  75   3                                              break;
  76   3                                      case 4:
  77   3                                        Hall_Status_Next = 6;
  78   3                                              break;
  79   3                                      case 5:
  80   3                                        Hall_Status_Next = 4;
  81   3                                              break;
  82   3                                      case 6:
  83   3                                        Hall_Status_Next = 2;
  84   3                                              break;
  85   3                                      default:
  86   3                                              break;
  87   3                              }
  88   2                      }
  89   1                      return Hall_Status_Next;
  90   1      }
  91          
  92          
  93          void HallStatus_CaptureFilter(void)
  94          {
  95   1      
  96   1              mcHall.HallStatus_Filter2    = mcHall.HallStatus_Filter1;       
  97   1      
  98   1              #if (HallFilterlingEnable)
                      {
                              mcHall.HallStatus_Filter1    = HALLSignalDisposeFilter(mcHall.HallCommutationCount,mcHall.GivenFRStatus,
             -HALLA,HALLB,HALLC);  
                      }
                      #else
 103   1              {
 104   2                      mcHall.HallStatus_Filter1    = HALLSignalDisposeWithoutFilter(mcHall.HallCommutationCount,mcHall.GivenFR
             -Status,HALLA,HALLB,HALLC);  
 105   2        }
 106   1              #endif
 107   1              
 108   1               if((mcHall.HallStatus_Filter1  == mcHall.HallStatus_Filter2) && (mcHall.HallStatus_Filter2 != 0))
 109   1               {
 110   2                       mcHall.HallStatus_Result = mcHall.HallStatus_Filter2;
 111   2               }
 112   1         else if(mcHall.HallStatus_Filter2==0)
 113   1               {
C51 COMPILER V9.52.0.0   HALL                                                              09/21/2018 10:50:00 PAGE 3   

 114   2                       mcHall.HallStatus_Result = mcHall.HallStatus_Filter1;
 115   2         }             
 116   1      }
 117          
 118          void HallTimeCapture(void)
 119          {
 120   1              Hall_RTHESTEP_Capture();  //厒僅數呾摯褒厒僅揭燴 27us
 121   1                      
 122   1              Hall_THETA_Capture();       //褒僅揭燴 14.6us   
 123   1              
 124   1      }
 125          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    227    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =     13    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
   EDATA SIZE       =   ----    ----
   HDATA SIZE       =   ----    ----
   XDATA CONST SIZE =   ----    ----
   FAR CONST SIZE   =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)
