Browse Source

warning / AGC 양수 처리 /

PYJ 4 years ago
parent
commit
a654b31e6a
4 changed files with 38 additions and 114 deletions
  1. 2 2
      .settings/language.settings.xml
  2. 28 111
      Bluecell_Src/Bluecell_operate.c
  3. 1 1
      Inc/main.h
  4. 7 0
      Src/main.c

+ 2 - 2
.settings/language.settings.xml

@@ -4,7 +4,7 @@
4
 		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
4
 		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
5
 			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
5
 			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
6
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
6
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
7
-			<provider class="com.atollic.truestudio.mbs.GCCSpecsDetectorAtollicArm" console="false" env-hash="775637718743193950" id="com.atollic.truestudio.mbs.provider" keep-relative-paths="false" name="Atollic ARM Tools Language Settings" parameter="${COMMAND} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
7
+			<provider class="com.atollic.truestudio.mbs.GCCSpecsDetectorAtollicArm" console="false" env-hash="-1353771282093943304" id="com.atollic.truestudio.mbs.provider" keep-relative-paths="false" name="Atollic ARM Tools Language Settings" parameter="${COMMAND} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
8
 				<language-scope id="org.eclipse.cdt.core.gcc"/>
8
 				<language-scope id="org.eclipse.cdt.core.gcc"/>
9
 				<language-scope id="org.eclipse.cdt.core.g++"/>
9
 				<language-scope id="org.eclipse.cdt.core.g++"/>
10
 			</provider>
10
 			</provider>
@@ -14,7 +14,7 @@
14
 		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
14
 		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
15
 			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
15
 			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
16
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
16
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
17
-			<provider class="com.atollic.truestudio.mbs.GCCSpecsDetectorAtollicArm" console="false" env-hash="775637718743193950" id="com.atollic.truestudio.mbs.provider" keep-relative-paths="false" name="Atollic ARM Tools Language Settings" parameter="${COMMAND} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
17
+			<provider class="com.atollic.truestudio.mbs.GCCSpecsDetectorAtollicArm" console="false" env-hash="-1353771282093943304" id="com.atollic.truestudio.mbs.provider" keep-relative-paths="false" name="Atollic ARM Tools Language Settings" parameter="${COMMAND} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
18
 				<language-scope id="org.eclipse.cdt.core.gcc"/>
18
 				<language-scope id="org.eclipse.cdt.core.gcc"/>
19
 				<language-scope id="org.eclipse.cdt.core.g++"/>
19
 				<language-scope id="org.eclipse.cdt.core.g++"/>
20
 			</provider>
20
 			</provider>

+ 28 - 111
Bluecell_Src/Bluecell_operate.c

@@ -123,6 +123,8 @@ void Temp_Shutdown_ONOFF(uint8_t val);
123
 
123
 
124
 void UL_Path_OnOff(uint8_t Index,uint8_t value,uint8_t* path,uint8_t* PrevAtten,uint8_t* retrycnt,uint8_t* PrevRetryCnt);
124
 void UL_Path_OnOff(uint8_t Index,uint8_t value,uint8_t* path,uint8_t* PrevAtten,uint8_t* retrycnt,uint8_t* PrevRetryCnt);
125
 int16_t Temperature_Offset_Get(int8_t* Temp_Table,int8_t CurrTemp);
125
 int16_t Temperature_Offset_Get(int8_t* Temp_Table,int8_t CurrTemp);
126
+int Bluecell_RoundCalc(double data);
127
+
126
 
128
 
127
 /***************************************************************************************/
129
 /***************************************************************************************/
128
 /*                                  Valuable                                           */
130
 /*                                  Valuable                                           */
@@ -3109,19 +3111,19 @@ void HFR_TypeInit(){
3109
 //    printf("3: %d \r\n",HAL_GPIO_ReadPin(UNIT_ID3_GPIO_Port,UNIT_ID3_Pin));   
3111
 //    printf("3: %d \r\n",HAL_GPIO_ReadPin(UNIT_ID3_GPIO_Port,UNIT_ID3_Pin));   
3110
 //    printf("ret : %x \r\n",type);
3112
 //    printf("ret : %x \r\n",type);
3111
     switch(type){
3113
     switch(type){
3112
-        case BLUECELL_3_7G: bluecell_Currdatastatus.Type = 0x80;bluecell_Currdatastatus.Carrier_ID = 0x01;break;//printf("Type BLUECELL_3_7G  Ready....\r\n"); break;
3113
-        case BLUECELL_3_8G: bluecell_Currdatastatus.Type = 0x81;bluecell_Currdatastatus.Carrier_ID = 0x02;break; //printf("Type BLUECELL_3_8G  Ready....\r\n");break;
3114
-        case BLUECELL_3_9G: bluecell_Currdatastatus.Type = 0x82;bluecell_Currdatastatus.Carrier_ID = 0x04;break;//printf("Type BLUECELL_3_9G  Ready....\r\n"); break;
3115
-        case BLUECELL_4_0G: bluecell_Currdatastatus.Type = 0x83;bluecell_Currdatastatus.Carrier_ID = 0x03;break;// printf("Type BLUECELL_4_0G  Ready....\r\n");break;
3116
-        case BLUECELL_4_1G: bluecell_Currdatastatus.Type = 0x84;bluecell_Currdatastatus.Carrier_ID = 0x02;break;//printf("Type BLUECELL_4_1G  Ready....\r\n");break;
3117
-        case BLUECELL_4_6G: bluecell_Currdatastatus.Type = 0x85;bluecell_Currdatastatus.Carrier_ID = 0x01;break;// printf("Type BLUECELL_4_6G  Ready....\r\n");break;
3118
-        case BLUECELL_4_7G: bluecell_Currdatastatus.Type = 0x86;bluecell_Currdatastatus.Carrier_ID = 0x00;break;// printf("Type BLUECELL_4_7G  Ready....\r\n");break;
3119
-        case BLUECELL_4_8G: bluecell_Currdatastatus.Type = 0x87;bluecell_Currdatastatus.Carrier_ID = 0x00;break;// printf("Type BLUECELL_4_8G  Ready....\r\n");break;
3120
-        case BLUECELL_4_9G: bluecell_Currdatastatus.Type = 0x88;bluecell_Currdatastatus.Carrier_ID = 0x00;break;// printf("Type BLUECELL_4_9G  Ready....\r\n");break;
3121
-        case BLUECELL_5_0G: bluecell_Currdatastatus.Type = 0x89;bluecell_Currdatastatus.Carrier_ID = 0x00;break;// printf("Type BLUECELL_5_0G  Ready....\r\n");break;
3122
-        case BLUECELL_DCM : bluecell_Currdatastatus.Type = 0x8A;bluecell_Currdatastatus.Carrier_ID = 0x01;break;//printf("Type BLUECELL_DCM  Ready....\r\n"); break;
3123
-        case BLUECELL_SBM : bluecell_Currdatastatus.Type = 0x8B;bluecell_Currdatastatus.Carrier_ID = 0x03;break; //printf("Type BLUECELL_SBM  Ready....\r\n");break;
3124
-        case BLUECELL_KDDI: bluecell_Currdatastatus.Type = 0x8C;bluecell_Currdatastatus.Carrier_ID = 0x02;break;//printf("Type BLUECELL_KDDI  Ready....\r\n"); break;
3114
+        case BLUECELL_3_7G: bluecell_Currdatastatus.Freq_ID = bluecell_Currdatastatus.Type = 0x80;bluecell_Currdatastatus.Carrier_ID = 0x01;break;//printf("Type BLUECELL_3_7G  Ready....\r\n"); break;
3115
+        case BLUECELL_3_8G: bluecell_Currdatastatus.Freq_ID = bluecell_Currdatastatus.Type = 0x81;bluecell_Currdatastatus.Carrier_ID = 0x02;break; //printf("Type BLUECELL_3_8G  Ready....\r\n");break;
3116
+        case BLUECELL_3_9G: bluecell_Currdatastatus.Freq_ID = bluecell_Currdatastatus.Type = 0x82;bluecell_Currdatastatus.Carrier_ID = 0x04;break;//printf("Type BLUECELL_3_9G  Ready....\r\n"); break;
3117
+        case BLUECELL_4_0G: bluecell_Currdatastatus.Freq_ID = bluecell_Currdatastatus.Type = 0x83;bluecell_Currdatastatus.Carrier_ID = 0x03;break;// printf("Type BLUECELL_4_0G  Ready....\r\n");break;
3118
+        case BLUECELL_4_1G: bluecell_Currdatastatus.Freq_ID = bluecell_Currdatastatus.Type = 0x84;bluecell_Currdatastatus.Carrier_ID = 0x02;break;//printf("Type BLUECELL_4_1G  Ready....\r\n");break;
3119
+        case BLUECELL_4_6G: bluecell_Currdatastatus.Freq_ID = bluecell_Currdatastatus.Type = 0x85;bluecell_Currdatastatus.Carrier_ID = 0x01;break;// printf("Type BLUECELL_4_6G  Ready....\r\n");break;
3120
+        case BLUECELL_4_7G: bluecell_Currdatastatus.Freq_ID = bluecell_Currdatastatus.Type = 0x86;bluecell_Currdatastatus.Carrier_ID = 0x00;break;// printf("Type BLUECELL_4_7G  Ready....\r\n");break;
3121
+        case BLUECELL_4_8G: bluecell_Currdatastatus.Freq_ID = bluecell_Currdatastatus.Type = 0x87;bluecell_Currdatastatus.Carrier_ID = 0x00;break;// printf("Type BLUECELL_4_8G  Ready....\r\n");break;
3122
+        case BLUECELL_4_9G: bluecell_Currdatastatus.Freq_ID = bluecell_Currdatastatus.Type = 0x88;bluecell_Currdatastatus.Carrier_ID = 0x00;break;// printf("Type BLUECELL_4_9G  Ready....\r\n");break;
3123
+        case BLUECELL_5_0G: bluecell_Currdatastatus.Freq_ID = bluecell_Currdatastatus.Type = 0x89;bluecell_Currdatastatus.Carrier_ID = 0x00;break;// printf("Type BLUECELL_5_0G  Ready....\r\n");break;
3124
+        case BLUECELL_DCM : bluecell_Currdatastatus.Freq_ID = bluecell_Currdatastatus.Type = 0x8A;bluecell_Currdatastatus.Carrier_ID = 0x01;break;//printf("Type BLUECELL_DCM  Ready....\r\n"); break;
3125
+        case BLUECELL_KDDI: bluecell_Currdatastatus.Freq_ID = bluecell_Currdatastatus.Type = 0x8B;bluecell_Currdatastatus.Carrier_ID = 0x02;break; //printf("Type BLUECELL_KDDI  Ready....\r\n");break;
3126
+        case BLUECELL_SBM:  bluecell_Currdatastatus.Freq_ID = bluecell_Currdatastatus.Type = 0x8C;bluecell_Currdatastatus.Carrier_ID = 0x03;break;//printf("Type BLUECELL_SBM  Ready....\r\n"); break;
3125
 //        default : printf("Type %x  Ready....\r\n",bluecell_Currdatastatus.Type);break;
3127
 //        default : printf("Type %x  Ready....\r\n",bluecell_Currdatastatus.Type);break;
3126
     }
3128
     }
3127
 //    printf("Type %x  Ready....\r\n",bluecell_Currdatastatus.Type);
3129
 //    printf("Type %x  Ready....\r\n",bluecell_Currdatastatus.Type);
@@ -3236,6 +3238,7 @@ uint32_t MBIC_DataSend(uint8_t* data){
3236
      uint32_t HeaderLength = 0;//80;
3238
      uint32_t HeaderLength = 0;//80;
3237
 	
3239
 	
3238
 
3240
 
3241
+
3239
     
3242
     
3240
     /*ALARM BIT LIST*/
3243
     /*ALARM BIT LIST*/
3241
     data[MBIC_PAYLOADSTART + i++] = MBIC_AID;
3244
     data[MBIC_PAYLOADSTART + i++] = MBIC_AID;
@@ -3736,6 +3739,7 @@ uint32_t MBIC_DataSend(uint8_t* data){
3736
     data[MBIC_PAYLOADSTART + i++] = bluecell_Currdatastatus.Freq_ID;
3739
     data[MBIC_PAYLOADSTART + i++] = bluecell_Currdatastatus.Freq_ID;
3737
 
3740
 
3738
 
3741
 
3742
+
3739
      /*Carrier_ID*/
3743
      /*Carrier_ID*/
3740
     data[MBIC_PAYLOADSTART + i++] = MBIC_AID;
3744
     data[MBIC_PAYLOADSTART + i++] = MBIC_AID;
3741
     data[MBIC_PAYLOADSTART + i++] = Carrier_ID;
3745
     data[MBIC_PAYLOADSTART + i++] = Carrier_ID;
@@ -4986,7 +4990,7 @@ void Temp_Shutdown_ONOFF(uint8_t val){
4986
 #define ALARM_REPORT_LENGTH 42
4990
 #define ALARM_REPORT_LENGTH 42
4987
 //uint8_t AlarmReport_History[Alarm_type_IndexMax] = {0,};
4991
 //uint8_t AlarmReport_History[Alarm_type_IndexMax] = {0,};
4988
 volatile uint8_t Alarm_ReportData[40 + 2 + 22 + 3] = {0,}; // 40 Alarm Data + 2 UNIT ID, 21 Header , 3 Tail
4992
 volatile uint8_t Alarm_ReportData[40 + 2 + 22 + 3] = {0,}; // 40 Alarm Data + 2 UNIT ID, 21 Header , 3 Tail
4989
-uint8_t* Alarm_Report_Send(uint16_t Alarm_type,uint8_t val){
4993
+void Alarm_Report_Send(uint16_t Alarm_type,uint8_t val){
4990
 //    if(AlarmReport_History[Alarm_type] != true){
4994
 //    if(AlarmReport_History[Alarm_type] != true){
4991
 //        return;
4995
 //        return;
4992
 //    }
4996
 //    }
@@ -5276,7 +5280,9 @@ bool MBIC_Operate(uint8_t* data){
5276
             Initialize = true;
5280
             Initialize = true;
5277
 
5281
 
5278
         }
5282
         }
5279
-        HFR_TypeInit();        
5283
+        HFR_TypeInit();      
5284
+
5285
+        
5280
         data[MBIC_CMD_0] = 0x80;//MBIC_ERRRESPONSE;
5286
         data[MBIC_CMD_0] = 0x80;//MBIC_ERRRESPONSE;
5281
         Length = MBIC_DataSend(data);
5287
         Length = MBIC_DataSend(data);
5282
     }
5288
     }
@@ -6094,6 +6100,7 @@ void DET_LevelAlarmCheck(){
6094
     double ret = 0;
6100
     double ret = 0;
6095
     int16_t Res_Up_DL_dBm[DET_Alarm_DL_Index_MAX] = {0,};
6101
     int16_t Res_Up_DL_dBm[DET_Alarm_DL_Index_MAX] = {0,};
6096
     int16_t Res_Down_DL_dBm[DET_Alarm_DL_Index_MAX] = {0,};
6102
     int16_t Res_Down_DL_dBm[DET_Alarm_DL_Index_MAX] = {0,};
6103
+    float temp_val = 0;
6097
     int16_t Res_Up_UL_dBm[DET_Alarm_UL_Index_MAX] = {0,};    
6104
     int16_t Res_Up_UL_dBm[DET_Alarm_UL_Index_MAX] = {0,};    
6098
     int16_t Res_Down_UL_dBm[DET_Alarm_UL_Index_MAX] = {0,};    
6105
     int16_t Res_Down_UL_dBm[DET_Alarm_UL_Index_MAX] = {0,};    
6099
     
6106
     
@@ -6302,7 +6309,7 @@ void DET_LevelAlarmCheck(){
6302
 
6309
 
6303
 
6310
 
6304
     for(int i = 0 ; i < DET_Alarm_DL_Shutdown_Index_MAX; i++){
6311
     for(int i = 0 ; i < DET_Alarm_DL_Shutdown_Index_MAX; i++){
6305
-//        if(i == 0) continue;
6312
+//        if(i != 0) continue;
6306
         if( Res_Down_DL_dBm[DET_Alarm_DL1_Index + i] > 0 ){
6313
         if( Res_Down_DL_dBm[DET_Alarm_DL1_Index + i] > 0 ){
6307
             if(DL_PathStatus[DET_Alarm_DL1_Shutdown_Index + i] == true
6314
             if(DL_PathStatus[DET_Alarm_DL1_Shutdown_Index + i] == true
6308
                 && (LimitData_DL_Shutdown - 2 >= Res_Up_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i])
6315
                 && (LimitData_DL_Shutdown - 2 >= Res_Up_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i])
@@ -8802,71 +8809,8 @@ void AGC_Package_Operate(uint8_t* Threshold,uint8_t* DL_MainAtten,uint8_t Tablei
8802
             FRBT_UserCtrl_Set(true);
8809
             FRBT_UserCtrl_Set(true);
8803
         }
8810
         }
8804
 
8811
 
8805
-#endif // PYJ.2020.10.23_END -- 
8806
-#if 0 // PYJ.2020.10.29_BEGIN -- 
8807
-        if(bluecell_Currdatastatus.DLI_FRBT_Status == FRBT_IDEL){
8808
-            ResdBm = Round_ResdBm_Ret = Bluecell_RoundCalc(Temp_ResdBm);
8809
-            IwillgiveAtten = New_AGC_Calc(Limitdata,ResdBm);
8810
-//            if(IwillgiveAtten )
8811
-
8812
-#if AGC_PRINT // PYJ.2020.10.23_BEGIN -- 
8813
-            printf("222 WILL GIVE YOU ATTEN  : %d\r\n",IwillgiveAtten);
8814
-
8815
-            printf("Round_ResdBm_Ret : %d \r\n",Round_ResdBm_Ret);
8816
-            printf("RefValue : %d \r\n",RefValue[Tableindex]);            
8817
 #endif // PYJ.2020.10.23_END -- 
8812
 #endif // PYJ.2020.10.23_END -- 
8818
 
8813
 
8819
-            if(Round_ResdBm_Ret < RefValue[Tableindex] + 0.5 && RefValue[Tableindex] != 0){
8820
-                
8821
-                
8822
-            }else{
8823
-#if AGC_PRINT // PYJ.2020.10.23_BEGIN -- 
8824
-                printf("1Curr ATTEN %d \r\n",CurrAtten );
8825
-                printf("Current DL% ADC VALUE : %f \r\n",Tableindex+1,ret);
8826
-                printf("Temp_ResdBm : DL%d : %f \r\n",Tableindex+1,Temp_ResdBm);
8827
-                printf("I WILL GIVE YOU ATTEN  : %d\r\n",IwillgiveAtten);
8828
-                printf("AGC  : %d\r\n",Limitdata);
8829
-#endif // PYJ.2020.10.23_END -- 
8830
-                RefValue[Tableindex] = Round_ResdBm_Ret;
8831
-                return;
8832
-            }
8833
-            if(Round_ResdBm_Ret > RefValue[Tableindex] - 1.5  && RefValue[Tableindex] != 0){
8834
-                if(CurrAtten < (IwillgiveAtten * -1)){
8835
-                    if(((Limitdata + (CurrAtten * -1)) - 1.5) <= Temp_ResdBm){
8836
-//                        IwillgiveAtten = HFR_AGC_Calc(Limitdata,Temp_ResdBm);
8837
-#if AGC_PRINT // PYJ.2020.10.23_BEGIN -- 
8838
-                        printf("4Curr ATTEN %d \r\n",CurrAtten );
8839
-                        printf("Current DL% ADC VALUE : %f \r\n",Tableindex+1,ret);
8840
-                        printf("Temp_ResdBm : DL%d : %f \r\n",Tableindex+1,Temp_ResdBm);
8841
-                        printf("I WILL GIVE YOU ATTEN  : %d\r\n",IwillgiveAtten* -1);
8842
-                        printf("AGC  : %d\r\n",Limitdata);
8843
-#endif // PYJ.2020.10.23_END --                           
8844
-                        return;
8845
-                    }
8846
-                }                
8847
-            }
8848
-            else
8849
-            {
8850
-#if AGC_PRINT // PYJ.2020.10.23_BEGIN -- 
8851
-                printf("2Curr ATTEN %d \r\n",CurrAtten );
8852
-                printf("Current DL% ADC VALUE : %f \r\n",Tableindex+1,ret);
8853
-                printf("Temp_ResdBm : DL%d : %f \r\n",Tableindex+1,Temp_ResdBm);
8854
-                printf("I WILL GIVE YOU ATTEN  : %d\r\n",IwillgiveAtten);
8855
-                printf("AGC  : %d\r\n",Limitdata);
8856
-#endif // PYJ.2020.10.23_END --                 
8857
-                RefValue[Tableindex] = Round_ResdBm_Ret;
8858
-                return;
8859
-            }
8860
-
8861
-            if(Limitdata == ResdBm){
8862
-                IwillgiveAtten = CurrAtten;
8863
-            }
8864
-            if(IwillgiveAtten == CurrAtten)
8865
-                    IwillgiveAtten = 0;            
8866
-//            RefValue = Round_ResdBm_Ret;
8867
-        }
8868
-#else
8869
-
8870
         if(bluecell_Currdatastatus.DLI_FRBT_Status == FRBT_IDEL){
8814
         if(bluecell_Currdatastatus.DLI_FRBT_Status == FRBT_IDEL){
8871
             int16_t Ref_A = Limitdata - CurrAtten;
8815
             int16_t Ref_A = Limitdata - CurrAtten;
8872
             float Ref_Ret = 0;
8816
             float Ref_Ret = 0;
@@ -8893,9 +8837,11 @@ void AGC_Package_Operate(uint8_t* Threshold,uint8_t* DL_MainAtten,uint8_t Tablei
8893
 #endif
8837
 #endif
8894
                 }
8838
                 }
8895
             }
8839
             }
8840
+            if(IwillgiveAtten > 0){
8841
+                IwillgiveAtten = 0;
8842
+            }
8896
         }
8843
         }
8897
 
8844
 
8898
-#endif // PYJ.2020.10.29_END -- 
8899
        
8845
        
8900
        
8846
        
8901
           
8847
           
@@ -8918,38 +8864,10 @@ void AGC_Package_Operate(uint8_t* Threshold,uint8_t* DL_MainAtten,uint8_t Tablei
8918
 
8864
 
8919
             
8865
             
8920
         if(bluecell_Currdatastatus.DLI_FRBT_Status == FRBT_IDEL && bluecell_Currdatastatus.DLI_FRBT_D_Day == 0){
8866
         if(bluecell_Currdatastatus.DLI_FRBT_Status == FRBT_IDEL && bluecell_Currdatastatus.DLI_FRBT_D_Day == 0){
8921
-#if 0 // PYJ.2020.10.30_BEGIN -- 
8922
-             if(Limitdata != ResdBm){
8923
-//                if(CurrAtten + ResdBm <= Limitdata - 1)
8924
-//                    IwillgiveAtten = ((CurrAtten) + 1);
8925
-                if(CurrAtten == 0)
8926
-                    if(IwillgiveAtten > 0)
8927
-                        IwillgiveAtten = 0;
8928
-//                IwillgiveAtten = ((CurrAtten) + 1);
8929
-//                printf("DLI_FRBT_Status == FRBT_IDEL\r\n");
8930
-                DL_PrevIwillgiveAtten[Tableindex] = IwillgiveAtten;
8931
-                DL_MainAtten[DLI_AGC_H] = ((((IwillgiveAtten)  * 10) & 0xFF00) >> 8) ;
8932
-                DL_MainAtten[DLI_AGC_L] = ((((IwillgiveAtten) * 10) & 0x00FF));  
8933
-                printf("Apply 2 Curr ATTEN %d \r\n", (int16_t)(DL_MainAtten[DLI_AGC_H] << 8 |  DL_MainAtten[DLI_AGC_L]));
8934
-                CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);            
8935
-            }
8936
-
8937
-            else{
8938
-                if(Limitdata == ResdBm){
8939
-                    IwillgiveAtten = 0;
8940
-                    DL_MainAtten[DLI_AGC_H] = ((((IwillgiveAtten)  * 10) & 0xFF00) >> 8) ;
8941
-                    DL_MainAtten[DLI_AGC_L] = ((((IwillgiveAtten) * 10) & 0x00FF));      
8942
-                    CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);                       
8943
-                }            
8944
-                
8945
-
8946
-            }
8947
-#else 
8948
             DL_MainAtten[DLI_AGC_H] = ((((IwillgiveAtten)  * 10) & 0xFF00) >> 8) ;
8867
             DL_MainAtten[DLI_AGC_H] = ((((IwillgiveAtten)  * 10) & 0xFF00) >> 8) ;
8949
             DL_MainAtten[DLI_AGC_L] = ((((IwillgiveAtten) * 10) & 0x00FF));      
8868
             DL_MainAtten[DLI_AGC_L] = ((((IwillgiveAtten) * 10) & 0x00FF));      
8950
             CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);  
8869
             CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);  
8951
 
8870
 
8952
-#endif // PYJ.2020.10.30_END -- 
8953
         }
8871
         }
8954
         else if(bluecell_Currdatastatus.DLI_FRBT_Status != FRBT_IDEL && (ResdBm + CurrAtten) > Limitdata &&  DL_PrevIwillgiveAtten[Tableindex] > IwillgiveAtten){
8872
         else if(bluecell_Currdatastatus.DLI_FRBT_Status != FRBT_IDEL && (ResdBm + CurrAtten) > Limitdata &&  DL_PrevIwillgiveAtten[Tableindex] > IwillgiveAtten){
8955
 //            printf("IwillgiveAtten : %d \r\n",IwillgiveAtten);
8873
 //            printf("IwillgiveAtten : %d \r\n",IwillgiveAtten);
@@ -8977,8 +8895,6 @@ void AGC_Package_Operate(uint8_t* Threshold,uint8_t* DL_MainAtten,uint8_t Tablei
8977
                 CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);            
8895
                 CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);            
8978
             }
8896
             }
8979
         }
8897
         }
8980
-        
8981
-
8982
 }
8898
 }
8983
 #endif // PYJ.2020.06.27_END -- 
8899
 #endif // PYJ.2020.06.27_END -- 
8984
 
8900
 
@@ -9121,7 +9037,7 @@ void AGC_Function(){//DL
9121
                             &bluecell_Currdatastatus.DLI_Level1_H,
9037
                             &bluecell_Currdatastatus.DLI_Level1_H,
9122
                             &Det_DL1.Table_Det5_dBm_H                        ,
9038
                             &Det_DL1.Table_Det5_dBm_H                        ,
9123
                             &bluecell_Currdatastatus.DLI_FRBT_Atten1_H);
9039
                             &bluecell_Currdatastatus.DLI_FRBT_Atten1_H);
9124
-#if 1// PYJ.2020.09.15_BEGIN -- 
9040
+#if (AGC_PRINT == 0)// PYJ.2020.09.15_BEGIN -- 
9125
         AGC_Package_Operate(&bluecell_Currdatastatus.DLI_AGC_Threshold_H,
9041
         AGC_Package_Operate(&bluecell_Currdatastatus.DLI_AGC_Threshold_H,
9126
                             &bluecell_Currdatastatus.ATT_DL2_H,
9042
                             &bluecell_Currdatastatus.ATT_DL2_H,
9127
                             AGC_Alarm_DL2_Index,
9043
                             AGC_Alarm_DL2_Index,
@@ -9364,6 +9280,7 @@ void DL_Shutdown_Operate(uint8_t index,uint8_t* path,uint8_t* retrycnt,uint8_t*
9364
         *path = true;            
9280
         *path = true;            
9365
         MainAtten[DL_Shutdown_H] = 0xFF;
9281
         MainAtten[DL_Shutdown_H] = 0xFF;
9366
         MainAtten[DL_Shutdown_L] = 0xFF;
9282
         MainAtten[DL_Shutdown_L] = 0xFF;
9283
+        PrevMBIC_DL_ShutdownCount[index] = MBIC_DL_ShutdownCount[index];        
9367
         CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus); 
9284
         CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus); 
9368
     }                  
9285
     }                  
9369
     if(DET_DL_Shutdown_On_AlarmTimerCnt[index] >= MBIC_ON_SHUTDOWN_MAINTAIN_SEC)
9286
     if(DET_DL_Shutdown_On_AlarmTimerCnt[index] >= MBIC_ON_SHUTDOWN_MAINTAIN_SEC)

+ 1 - 1
Inc/main.h

@@ -185,7 +185,7 @@ extern I2C_HandleTypeDef hi2c2;
185
 #define MBIC_ON_MAINTAIN_SEC 3000
185
 #define MBIC_ON_MAINTAIN_SEC 3000
186
 #define MBIC_ON_SHUTDOWN_MAINTAIN_SEC 5000//5
186
 #define MBIC_ON_SHUTDOWN_MAINTAIN_SEC 5000//5
187
 #define MBIC_RECOVERY_SHUTDOWN_MAINTAIN_SEC 20000//30
187
 #define MBIC_RECOVERY_SHUTDOWN_MAINTAIN_SEC 20000//30
188
-#define MBIC_RECOVERY_LAST_SHUTDOWN_MAINTAIN_SEC 52000 * 5 //5min
188
+#define MBIC_RECOVERY_LAST_SHUTDOWN_MAINTAIN_SEC  52000 * 5 //5min
189
 #define MBIC_RECOVERY_SELFTEST_TIMER_SEC 1800000 //30min
189
 #define MBIC_RECOVERY_SELFTEST_TIMER_SEC 1800000 //30min
190
 
190
 
191
 
191
 

+ 7 - 0
Src/main.c

@@ -171,6 +171,13 @@ static void MX_NVIC_Init(void);
171
 extern void Booting_LedInit(void);
171
 extern void Booting_LedInit(void);
172
 extern void Bluecell_AttenInitialize();
172
 extern void Bluecell_AttenInitialize();
173
 extern void DET_LevelAlarmCheck();
173
 extern void DET_LevelAlarmCheck();
174
+extern void Alarm_Check();
175
+extern void SelfTestTimer_Operate();
176
+extern void FRBT_Operate();
177
+extern void AlarmLog_Report();
178
+extern void Flash_InitRead();
179
+extern void HFR_TypeInit();
180
+
174
 
181
 
175
 /* USER CODE END PFP */
182
 /* USER CODE END PFP */
176
 
183