|
@@ -123,6 +123,8 @@ void Temp_Shutdown_ONOFF(uint8_t val);
|
123
|
123
|
|
124
|
124
|
void UL_Path_OnOff(uint8_t Index,uint8_t value,uint8_t* path,uint8_t* PrevAtten,uint8_t* retrycnt,uint8_t* PrevRetryCnt);
|
125
|
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
|
130
|
/* Valuable */
|
|
@@ -3109,19 +3111,19 @@ void HFR_TypeInit(){
|
3109
|
3111
|
// printf("3: %d \r\n",HAL_GPIO_ReadPin(UNIT_ID3_GPIO_Port,UNIT_ID3_Pin));
|
3110
|
3112
|
// printf("ret : %x \r\n",type);
|
3111
|
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
|
3127
|
// default : printf("Type %x Ready....\r\n",bluecell_Currdatastatus.Type);break;
|
3126
|
3128
|
}
|
3127
|
3129
|
// printf("Type %x Ready....\r\n",bluecell_Currdatastatus.Type);
|
|
@@ -3236,6 +3238,7 @@ uint32_t MBIC_DataSend(uint8_t* data){
|
3236
|
3238
|
uint32_t HeaderLength = 0;//80;
|
3237
|
3239
|
|
3238
|
3240
|
|
|
3241
|
+
|
3239
|
3242
|
|
3240
|
3243
|
/*ALARM BIT LIST*/
|
3241
|
3244
|
data[MBIC_PAYLOADSTART + i++] = MBIC_AID;
|
|
@@ -3736,6 +3739,7 @@ uint32_t MBIC_DataSend(uint8_t* data){
|
3736
|
3739
|
data[MBIC_PAYLOADSTART + i++] = bluecell_Currdatastatus.Freq_ID;
|
3737
|
3740
|
|
3738
|
3741
|
|
|
3742
|
+
|
3739
|
3743
|
/*Carrier_ID*/
|
3740
|
3744
|
data[MBIC_PAYLOADSTART + i++] = MBIC_AID;
|
3741
|
3745
|
data[MBIC_PAYLOADSTART + i++] = Carrier_ID;
|
|
@@ -4986,7 +4990,7 @@ void Temp_Shutdown_ONOFF(uint8_t val){
|
4986
|
4990
|
#define ALARM_REPORT_LENGTH 42
|
4987
|
4991
|
//uint8_t AlarmReport_History[Alarm_type_IndexMax] = {0,};
|
4988
|
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
|
4994
|
// if(AlarmReport_History[Alarm_type] != true){
|
4991
|
4995
|
// return;
|
4992
|
4996
|
// }
|
|
@@ -5276,7 +5280,9 @@ bool MBIC_Operate(uint8_t* data){
|
5276
|
5280
|
Initialize = true;
|
5277
|
5281
|
|
5278
|
5282
|
}
|
5279
|
|
- HFR_TypeInit();
|
|
5283
|
+ HFR_TypeInit();
|
|
5284
|
+
|
|
5285
|
+
|
5280
|
5286
|
data[MBIC_CMD_0] = 0x80;//MBIC_ERRRESPONSE;
|
5281
|
5287
|
Length = MBIC_DataSend(data);
|
5282
|
5288
|
}
|
|
@@ -6094,6 +6100,7 @@ void DET_LevelAlarmCheck(){
|
6094
|
6100
|
double ret = 0;
|
6095
|
6101
|
int16_t Res_Up_DL_dBm[DET_Alarm_DL_Index_MAX] = {0,};
|
6096
|
6102
|
int16_t Res_Down_DL_dBm[DET_Alarm_DL_Index_MAX] = {0,};
|
|
6103
|
+ float temp_val = 0;
|
6097
|
6104
|
int16_t Res_Up_UL_dBm[DET_Alarm_UL_Index_MAX] = {0,};
|
6098
|
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
|
6311
|
for(int i = 0 ; i < DET_Alarm_DL_Shutdown_Index_MAX; i++){
|
6305
|
|
-// if(i == 0) continue;
|
|
6312
|
+// if(i != 0) continue;
|
6306
|
6313
|
if( Res_Down_DL_dBm[DET_Alarm_DL1_Index + i] > 0 ){
|
6307
|
6314
|
if(DL_PathStatus[DET_Alarm_DL1_Shutdown_Index + i] == true
|
6308
|
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
|
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
|
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
|
8814
|
if(bluecell_Currdatastatus.DLI_FRBT_Status == FRBT_IDEL){
|
8871
|
8815
|
int16_t Ref_A = Limitdata - CurrAtten;
|
8872
|
8816
|
float Ref_Ret = 0;
|
|
@@ -8893,9 +8837,11 @@ void AGC_Package_Operate(uint8_t* Threshold,uint8_t* DL_MainAtten,uint8_t Tablei
|
8893
|
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
|
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
|
8867
|
DL_MainAtten[DLI_AGC_H] = ((((IwillgiveAtten) * 10) & 0xFF00) >> 8) ;
|
8949
|
8868
|
DL_MainAtten[DLI_AGC_L] = ((((IwillgiveAtten) * 10) & 0x00FF));
|
8950
|
8869
|
CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);
|
8951
|
8870
|
|
8952
|
|
-#endif // PYJ.2020.10.30_END --
|
8953
|
8871
|
}
|
8954
|
8872
|
else if(bluecell_Currdatastatus.DLI_FRBT_Status != FRBT_IDEL && (ResdBm + CurrAtten) > Limitdata && DL_PrevIwillgiveAtten[Tableindex] > IwillgiveAtten){
|
8955
|
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
|
8895
|
CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);
|
8978
|
8896
|
}
|
8979
|
8897
|
}
|
8980
|
|
-
|
8981
|
|
-
|
8982
|
8898
|
}
|
8983
|
8899
|
#endif // PYJ.2020.06.27_END --
|
8984
|
8900
|
|
|
@@ -9121,7 +9037,7 @@ void AGC_Function(){//DL
|
9121
|
9037
|
&bluecell_Currdatastatus.DLI_Level1_H,
|
9122
|
9038
|
&Det_DL1.Table_Det5_dBm_H ,
|
9123
|
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
|
9041
|
AGC_Package_Operate(&bluecell_Currdatastatus.DLI_AGC_Threshold_H,
|
9126
|
9042
|
&bluecell_Currdatastatus.ATT_DL2_H,
|
9127
|
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
|
9280
|
*path = true;
|
9365
|
9281
|
MainAtten[DL_Shutdown_H] = 0xFF;
|
9366
|
9282
|
MainAtten[DL_Shutdown_L] = 0xFF;
|
|
9283
|
+ PrevMBIC_DL_ShutdownCount[index] = MBIC_DL_ShutdownCount[index];
|
9367
|
9284
|
CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);
|
9368
|
9285
|
}
|
9369
|
9286
|
if(DET_DL_Shutdown_On_AlarmTimerCnt[index] >= MBIC_ON_SHUTDOWN_MAINTAIN_SEC)
|