Quellcode durchsuchen

DET Table Offset 기능 구현 (실제 적용 안함)

PYJ vor 5 Jahren
Ursprung
Commit
6166e9d2ee
2 geänderte Dateien mit 46 neuen und 19 gelöschten Zeilen
  1. 8 6
      Bluecell_Inc/Bluecell_operate.h
  2. 38 13
      Bluecell_Src/Bluecell_operate.c

+ 8 - 6
Bluecell_Inc/Bluecell_operate.h

@@ -627,7 +627,12 @@ enum DATATYPE
627 627
     Bluecell_CarrierOnOff,
628 628
     Bluecell_PCBVersionSet,
629 629
     Bluecell_SerialNumberSet,
630
-    Bluecell_ManufactureDateSet,    
630
+    Bluecell_ManufactureDateSet,  
631
+    Bluecell_DL_Det_ALL_Offset,
632
+    Bluecell_UL_Det_Path1_Offset,    
633
+    Bluecell_UL_Det_Path2_Offset,    
634
+    Bluecell_UL_Det_Path3_Offset,    
635
+    Bluecell_UL_Det_Path4_Offset,        
631 636
 };
632 637
 typedef enum{    
633 638
 	DLI_P1_Level_Table_Number = 0x00,
@@ -1036,11 +1041,8 @@ typedef struct{
1036 1041
     int8_t MBIC_TEMP_UL_P2_Level_Table_Length;
1037 1042
     int8_t MBIC_TEMP_UL_P3_Level_Table_Length;
1038 1043
     int8_t MBIC_TEMP_UL_P4_Level_Table_Length;
1039
-    uint8_t DL_ALL_Offset;
1040
-    uint8_t UL_P1_Offset;
1041
-    uint8_t UL_P2_Offset;
1042
-    uint8_t UL_P3_Offset;
1043
-    uint8_t UL_P4_Offset;
1044
+    uint8_t DL_Det_ALL_Offset;
1045
+    int8_t UL_Det_Path_Offset[4];
1044 1046
     uint8_t bluecell_crc_H;
1045 1047
     uint8_t bluecell_crc_L;
1046 1048
     uint8_t bluecell_etx;

+ 38 - 13
Bluecell_Src/Bluecell_operate.c

@@ -2955,11 +2955,31 @@ bool Bluecell_Operate(uint8_t* data){
2955 2955
          
2956 2956
         break;
2957 2957
     case Bluecell_ManufactureDateSet:
2958
-    for(int i = 0; i < 3; i++){
2959
-//        printf("Manufacture_Date : %d \r\n",data[BLUECELL_DATA + i]);
2960
-        bluecell_Currdatastatus.Manufacture_Date[i] = data[BLUECELL_DATA + i]; 
2961
-    }
2962
-    break;
2958
+        for(int i = 0; i < 3; i++){
2959
+    //        printf("Manufacture_Date : %d \r\n",data[BLUECELL_DATA + i]);
2960
+            bluecell_Currdatastatus.Manufacture_Date[i] = data[BLUECELL_DATA + i]; 
2961
+        }
2962
+        break;
2963
+    case Bluecell_DL_Det_ALL_Offset:   
2964
+        bluecell_Currdatastatus.DL_Det_ALL_Offset = data[BLUECELL_DATA]; 
2965
+//        printf("DL_Det_ALL_Offset : %d \r\n",bluecell_Currdatastatus.DL_Det_ALL_Offset);
2966
+        break;
2967
+    case Bluecell_UL_Det_Path1_Offset: 
2968
+        bluecell_Currdatastatus.UL_Det_Path_Offset[0] = data[BLUECELL_DATA]; 
2969
+//        printf("Bluecell_UL_Det_Path1_Offset : %d \r\n",bluecell_Currdatastatus.UL_Det_Path_Offset[0]);
2970
+        break; 
2971
+    case Bluecell_UL_Det_Path2_Offset:   
2972
+        bluecell_Currdatastatus.UL_Det_Path_Offset[1] = data[BLUECELL_DATA]; 
2973
+//        printf("Bluecell_UL_Det_Path2_Offset : %d \r\n",bluecell_Currdatastatus.UL_Det_Path_Offset[1]);        
2974
+        break;
2975
+    case Bluecell_UL_Det_Path3_Offset:    
2976
+        bluecell_Currdatastatus.UL_Det_Path_Offset[2] = data[BLUECELL_DATA]; 
2977
+//        printf("Bluecell_UL_Det_Path3_Offset : %d \r\n",bluecell_Currdatastatus.UL_Det_Path_Offset[2]);        
2978
+        break;
2979
+    case Bluecell_UL_Det_Path4_Offset:
2980
+        bluecell_Currdatastatus.UL_Det_Path_Offset[3] = data[BLUECELL_DATA]; 
2981
+//        printf("Bluecell_UL_Det_Path4_Offset : %d \r\n",bluecell_Currdatastatus.UL_Det_Path_Offset[3]);        
2982
+        break;
2963 2983
   }
2964 2984
   
2965 2985
   if(datatype != Bluecell_StatusReq
@@ -6217,11 +6237,11 @@ int16_t ALC_Calc(uint8_t num,double CurrAtten ,int8_t threshold,double CurrDet){
6217 6237
 #define UL_DL_DATASEND_MULTIPLE 10
6218 6238
 void ALC_Alarm_TimerSet(uint8_t num,int16_t threshold,int16_t CurrDet,int16_t Atten,int16_t MainAtten){
6219 6239
     int16_t ret =0;
6220
-    int16_t CurrAtten = 0;
6240
+    int16_t CurrAtten = 0; 
6221 6241
     int16_t M_Atten = 0;
6222 6242
     M_Atten = (MainAtten * 0.1);
6223 6243
 //    printf("MainAtten : %d \r\n",MainAtten);
6224
-    CurrAtten = Atten * 0.1;
6244
+    CurrAtten = Atten * 0.1; // ALC ATTEN
6225 6245
         if(CurrAtten + M_Atten >= -18){
6226 6246
             ALC_AlarmSet[num] = false;
6227 6247
 //            printf("Alarm 3 \r\n");                
@@ -6230,10 +6250,10 @@ void ALC_Alarm_TimerSet(uint8_t num,int16_t threshold,int16_t CurrDet,int16_t At
6230 6250
             ret = CurrDet - threshold ;
6231 6251
             ret = Bluecell_TestPro(ret +( CurrAtten * 0.1 * -1));
6232 6252
             ret *= -1;  
6233
-//            printf("CurrAtten : %d   M_Atten : %d \r\n",CurrAtten,M_Atten);
6253
+            printf("CurrAtten : %d   M_Atten : %d \r\n",CurrAtten,M_Atten);
6234 6254
             if(CurrAtten + M_Atten <= -20){
6235 6255
                 ALC_AlarmSet[num] = true;
6236
-//                printf("Alarm 1 \r\n");
6256
+                printf("Alarm 1 \r\n");
6237 6257
             }
6238 6258
         }
6239 6259
         else if(threshold -2 > CurrDet){
@@ -6322,7 +6342,7 @@ void ALC_Package_Operate(uint8_t*ULO_ADC_Level,uint8_t* ULO_Level,DET_TABLEUL_st
6322 6342
 //    printf("ORIGIN ResdBm : %f  %d\r\n",ResdBm,Main_Atten);
6323 6343
 //    printf("After ResdBm : %f \r\n",ResdBm);
6324 6344
 
6325
-    ResdBm = HFR_CntUpCalc(ResdBm);
6345
+    ResdBm = HFR_CntUpCalc(ResdBm); //+ bluecell_Currdatastatus.UL_Det_Path_Offset[TableIndex];;
6326 6346
     ResultData = ResdBm;
6327 6347
 //    printf("HFR CALC RET : %d \r\n",ResultData);
6328 6348
     ULO_Level[ULO_ALC_H] = (ResultData & 0xFF00) >> 8;
@@ -6339,7 +6359,6 @@ void ALC_Package_Operate(uint8_t*ULO_ADC_Level,uint8_t* ULO_Level,DET_TABLEUL_st
6339 6359
             IwillGiveAtten += 10;
6340 6360
         }
6341 6361
     }
6342
-
6343 6362
     GiveAttenPlusULAtten = IwillGiveAtten + (Main_Atten );
6344 6363
     if(GiveAttenPlusULAtten <= - 200){
6345 6364
         IwillGiveAtten = -200 + ((Main_Atten * -1));
@@ -6375,7 +6394,7 @@ int16_t ResultData = 0;
6375 6394
     //ret 현재 Voltage 값 출력
6376 6395
     //ret 에 따른 현재 DBM 구현
6377 6396
     ResdBm = HFR_CntUpCalc(ResdBm);
6378
-    ResultData = ResdBm;
6397
+    ResultData = ResdBm;// + bluecell_Currdatastatus.UL_Det_Path_Offset[TableIndex];
6379 6398
 //    printf("HFR CALC RET : %d \r\n",ResultData);
6380 6399
     ULO_Level[ULO_ALC_H] = (ResultData & 0xFF00) >> 8;
6381 6400
     ULO_Level[ULO_ALC_L] = (ResultData & 0x00FF);  
@@ -6438,6 +6457,7 @@ void ALC_Function(){ //DL
6438 6457
                             &bluecell_Currdatastatus.ATT_UL1_H,
6439 6458
                             &bluecell_Currdatastatus.bluecell_User_UL1_H,
6440 6459
                             &bluecell_Currdatastatus.ULO_Shutdown_Retry_Count1);
6460
+#if 1 // PYJ.2020.07.16_BEGIN -- 
6441 6461
         ALC_Package_Operate(&bluecell_Currdatastatus.ULO_P2_Level2_H,
6442 6462
                             &bluecell_Currdatastatus.ULO_Level2_H,
6443 6463
                             &Det_UL2.Table_Det_15_dBm_H,
@@ -6462,11 +6482,13 @@ void ALC_Function(){ //DL
6462 6482
                             &bluecell_Currdatastatus.ATT_UL4_H,
6463 6483
                             &bluecell_Currdatastatus.bluecell_User_UL4_H,
6464 6484
                             &bluecell_Currdatastatus.ULO_Shutdown_Retry_Count4);
6485
+#endif // PYJ.2020.07.16_END -- 
6465 6486
         
6466 6487
 //                 HAL_Delay(1000);
6467 6488
             //}
6468 6489
             ALCTimerCnt = 0;
6469
-        }else{
6490
+        }
6491
+        else{
6470 6492
 
6471 6493
 
6472 6494
 
@@ -6582,6 +6604,7 @@ void AGC_Package_Operate(uint8_t* Threshold,uint8_t* DL_MainAtten,uint8_t Tablei
6582 6604
         CurrAtten = (int16_t)(DL_MainAtten[DLI_AGC_H] << 8 |  DL_MainAtten[DLI_AGC_L]);
6583 6605
         CurrAtten *= 0.1;
6584 6606
         ResdBm = (int8_t)Bluecell_TestPro(AGC_AutoControl_ADC_Compare(ret,&DL_Table->Table_Det5_dBm_H,DL_Table->Table_Length,AGC_Table));
6607
+//        ResdBm += bluecell_Currdatastatus.DL_Det_ALL_Offset;
6585 6608
         DLI_Level[DLI_AGC_H] = ((int16_t)ResdBm & 0xFF00) >> 8;
6586 6609
         DLI_Level[DLI_AGC_L] = ((int16_t)ResdBm & 0x00FF);
6587 6610
         for(i = 0; i < sizeof(AGC_dBm_t); i++){
@@ -6639,6 +6662,8 @@ void DL_Det_Function(uint8_t Table_Num,uint8_t* CurrADC_Level,DET_TABLEDL_st* DL
6639 6662
     ret = (((CurrADC_Level[DL_Level_H] << 8) | CurrADC_Level[DL_Level_L]) * 0.001);
6640 6663
 //    printf("DL_Table->Table_Length : %d \r\n",DL_Table->Table_Length);                
6641 6664
     Levelret = (int16_t)Bluecell_TestPro(AGC_AutoControl_ADC_Compare(ret,&DL_Table->Table_Det5_dBm_H,DL_Table->Table_Length,AGC_Table));
6665
+//    Levelret += bluecell_Currdatastatus.DL_Det_ALL_Offset;
6666
+
6642 6667
 //    printf("Levelret %d : %d \r\n",Table_Num + 1,Levelret);
6643 6668
     Level[DL_Level_H] = (Levelret & 0xFF00) >> 8;
6644 6669
     Level[DL_Level_L] = (Levelret & 0x00FF);