|
@@ -113,7 +113,7 @@ double TableAtteGuarantee(uint8_t* Table,double AttenValue);
|
113
|
113
|
double PE43711_Double(uint8_t high_bit,uint8_t low_bit);
|
114
|
114
|
double Bluecell_TestPro(double value );
|
115
|
115
|
double AGC_AutoControl_ADC_Compare(double CurrentAdc,uint8_t* CompareAdc,uint8_t size,int8_t* RefTable_Data);
|
116
|
|
-void ALC_Alarm_TimerSet(uint8_t num,int16_t threshold,int16_t CurrDet,int16_t CurrAtten,int16_t MainAtten);
|
|
116
|
+void ALC_Alarm_TimerSet(uint8_t num,int16_t threshold,double CurrDet,int16_t CurrAtten,int16_t MainAtten);
|
117
|
117
|
void Carrier_ONOFF(uint8_t val);
|
118
|
118
|
void DL_Path_OnOff(uint8_t Index,uint8_t value,uint8_t* path,uint8_t* PrevAtten,uint8_t* retrycnt,uint8_t* PrevRetryCnt);
|
119
|
119
|
void Factory_Set();
|
|
@@ -3093,27 +3093,29 @@ void DataStatusSet(void){
|
3093
|
3093
|
}
|
3094
|
3094
|
|
3095
|
3095
|
void HFR_TypeInit(){
|
3096
|
|
- bluecell_Currdatastatus.Type = HAL_GPIO_ReadPin(UNIT_ID0_GPIO_Port,UNIT_ID0_Pin);
|
3097
|
|
- bluecell_Currdatastatus.Type += HAL_GPIO_ReadPin(UNIT_ID1_GPIO_Port,UNIT_ID1_Pin) << 1;
|
3098
|
|
- bluecell_Currdatastatus.Type += HAL_GPIO_ReadPin(UNIT_ID2_GPIO_Port,UNIT_ID2_Pin) << 2;
|
3099
|
|
- bluecell_Currdatastatus.Type += HAL_GPIO_ReadPin(UNIT_ID3_GPIO_Port,UNIT_ID3_Pin) << 3;
|
|
3096
|
+ uint8_t type = 0;
|
|
3097
|
+ type = HAL_GPIO_ReadPin(UNIT_ID0_GPIO_Port,UNIT_ID0_Pin);
|
|
3098
|
+ type += HAL_GPIO_ReadPin(UNIT_ID1_GPIO_Port,UNIT_ID1_Pin) << 1;
|
|
3099
|
+ type += HAL_GPIO_ReadPin(UNIT_ID2_GPIO_Port,UNIT_ID2_Pin) << 2;
|
|
3100
|
+ type += HAL_GPIO_ReadPin(UNIT_ID3_GPIO_Port,UNIT_ID3_Pin) << 3;
|
3100
|
3101
|
// printf("0: %d \r\n",HAL_GPIO_ReadPin(UNIT_ID0_GPIO_Port,UNIT_ID0_Pin));
|
3101
|
3102
|
// printf("1: %d \r\n",HAL_GPIO_ReadPin(UNIT_ID1_GPIO_Port,UNIT_ID1_Pin));
|
3102
|
3103
|
// printf("2: %d \r\n",HAL_GPIO_ReadPin(UNIT_ID2_GPIO_Port,UNIT_ID2_Pin));
|
3103
|
3104
|
// printf("3: %d \r\n",HAL_GPIO_ReadPin(UNIT_ID3_GPIO_Port,UNIT_ID3_Pin));
|
3104
|
|
- switch(bluecell_Currdatastatus.Type){
|
3105
|
|
- case BLUECELL_3_7G: bluecell_Currdatastatus.Type = 0x80;bluecell_Currdatastatus.Carrier_ID = 0x01 ;break;//printf("Type BLUECELL_3_7G Ready....\r\n"); break;
|
3106
|
|
- case BLUECELL_3_8G: bluecell_Currdatastatus.Type = 0x81;bluecell_Currdatastatus.Carrier_ID = 0x02;break;// printf("Type BLUECELL_3_8G Ready....\r\n");break;
|
|
3105
|
+// printf("ret : %x \r\n",type);
|
|
3106
|
+ switch(type){
|
|
3107
|
+ case BLUECELL_3_7G: bluecell_Currdatastatus.Type = 0x80;bluecell_Currdatastatus.Carrier_ID = 0x01;break;//printf("Type BLUECELL_3_7G Ready....\r\n"); break;
|
|
3108
|
+ case BLUECELL_3_8G: bluecell_Currdatastatus.Type = 0x81;bluecell_Currdatastatus.Carrier_ID = 0x02;break; //printf("Type BLUECELL_3_8G Ready....\r\n");break;
|
3107
|
3109
|
case BLUECELL_3_9G: bluecell_Currdatastatus.Type = 0x82;bluecell_Currdatastatus.Carrier_ID = 0x04;break;//printf("Type BLUECELL_3_9G Ready....\r\n"); break;
|
3108
|
3110
|
case BLUECELL_4_0G: bluecell_Currdatastatus.Type = 0x83;bluecell_Currdatastatus.Carrier_ID = 0x03;break;// printf("Type BLUECELL_4_0G Ready....\r\n");break;
|
3109
|
|
- case BLUECELL_4_1G: bluecell_Currdatastatus.Type = 0x84;bluecell_Currdatastatus.Carrier_ID = 0x02;break; //printf("Type BLUECELL_4_1G Ready....\r\n");break;
|
|
3111
|
+ case BLUECELL_4_1G: bluecell_Currdatastatus.Type = 0x84;bluecell_Currdatastatus.Carrier_ID = 0x02;break;//printf("Type BLUECELL_4_1G Ready....\r\n");break;
|
3110
|
3112
|
case BLUECELL_4_6G: bluecell_Currdatastatus.Type = 0x85;bluecell_Currdatastatus.Carrier_ID = 0x01;break;// printf("Type BLUECELL_4_6G Ready....\r\n");break;
|
3111
|
3113
|
case BLUECELL_4_7G: bluecell_Currdatastatus.Type = 0x86;bluecell_Currdatastatus.Carrier_ID = 0x00;break;// printf("Type BLUECELL_4_7G Ready....\r\n");break;
|
3112
|
3114
|
case BLUECELL_4_8G: bluecell_Currdatastatus.Type = 0x87;bluecell_Currdatastatus.Carrier_ID = 0x00;break;// printf("Type BLUECELL_4_8G Ready....\r\n");break;
|
3113
|
3115
|
case BLUECELL_4_9G: bluecell_Currdatastatus.Type = 0x88;bluecell_Currdatastatus.Carrier_ID = 0x00;break;// printf("Type BLUECELL_4_9G Ready....\r\n");break;
|
3114
|
3116
|
case BLUECELL_5_0G: bluecell_Currdatastatus.Type = 0x89;bluecell_Currdatastatus.Carrier_ID = 0x00;break;// printf("Type BLUECELL_5_0G Ready....\r\n");break;
|
3115
|
3117
|
case BLUECELL_DCM : bluecell_Currdatastatus.Type = 0x8A;bluecell_Currdatastatus.Carrier_ID = 0x01;break;//printf("Type BLUECELL_DCM Ready....\r\n"); break;
|
3116
|
|
- case BLUECELL_SBM : bluecell_Currdatastatus.Type = 0x8B;bluecell_Currdatastatus.Carrier_ID = 0x03;break;// printf("Type BLUECELL_SBM Ready....\r\n");break;
|
|
3118
|
+ case BLUECELL_SBM : bluecell_Currdatastatus.Type = 0x8B;bluecell_Currdatastatus.Carrier_ID = 0x03;break; //printf("Type BLUECELL_SBM Ready....\r\n");break;
|
3117
|
3119
|
case BLUECELL_KDDI: bluecell_Currdatastatus.Type = 0x8C;bluecell_Currdatastatus.Carrier_ID = 0x02;break;//printf("Type BLUECELL_KDDI Ready....\r\n"); break;
|
3118
|
3120
|
// default : printf("Type %x Ready....\r\n",bluecell_Currdatastatus.Type);break;
|
3119
|
3121
|
}
|
|
@@ -3136,7 +3138,7 @@ void HFR_TypeInit(){
|
3136
|
3138
|
PrevMBIC_DL_ShutdownCount[i] = 0xFF;
|
3137
|
3139
|
}
|
3138
|
3140
|
#if 1 // PYJ.2020.06.17_BEGIN --
|
3139
|
|
- printf("bluecell_Currdatastatus.Path_TempSave_Bit : %x \r\n",bluecell_Currdatastatus.Path_TempSave_Bit);
|
|
3141
|
+// printf("bluecell_Currdatastatus.Path_TempSave_Bit : %x \r\n",bluecell_Currdatastatus.Path_TempSave_Bit);
|
3140
|
3142
|
if(bluecell_Currdatastatus.Path_TempSave_Bit & 0x80)
|
3141
|
3143
|
bluecell_Currdatastatus.ATT_DL1_PATH = true;
|
3142
|
3144
|
else
|
|
@@ -8208,10 +8210,11 @@ int16_t ALC_Calc(uint8_t num,double CurrAtten ,int8_t threshold,double CurrDet){
|
8208
|
8210
|
return result * 10;
|
8209
|
8211
|
}
|
8210
|
8212
|
#define UL_DL_DATASEND_MULTIPLE 10
|
8211
|
|
-void ALC_Alarm_TimerSet(uint8_t num,int16_t threshold,int16_t CurrDet,int16_t Atten,int16_t MainAtten){
|
|
8213
|
+void ALC_Alarm_TimerSet(uint8_t num,int16_t threshold,double CurrDet,int16_t Atten,int16_t MainAtten){
|
8212
|
8214
|
int16_t ret =0;
|
8213
|
8215
|
int16_t CurrAtten = 0;
|
8214
|
8216
|
int16_t M_Atten = 0;
|
|
8217
|
+ uint8_t* AlarmStatus = &bluecell_Currdatastatus.ULO_ALC_Alarm1;
|
8215
|
8218
|
M_Atten = (MainAtten * 0.1);
|
8216
|
8219
|
// printf("MainAtten : %d \r\n",MainAtten);
|
8217
|
8220
|
CurrAtten = Atten * 0.1; // ALC ATTEN
|
|
@@ -8220,23 +8223,28 @@ void ALC_Alarm_TimerSet(uint8_t num,int16_t threshold,int16_t CurrDet,int16_t At
|
8220
|
8223
|
// printf("Alarm 3 \r\n");
|
8221
|
8224
|
}
|
8222
|
8225
|
else if(threshold <= CurrDet){
|
8223
|
|
- ret = CurrDet - threshold ;
|
|
8226
|
+ ret = (int)CurrDet - threshold ;
|
8224
|
8227
|
ret = Bluecell_TestPro(ret +( CurrAtten * 0.1 * -1));
|
8225
|
8228
|
ret *= -1;
|
8226
|
|
-// printf("CurrDet : %d CurrAtten : %d M_Atten : %d \r\n",CurrDet,CurrAtten,M_Atten);
|
|
8229
|
+// printf("CurrDet : %f CurrAtten : %d M_Atten : %d \r\n",CurrDet,CurrAtten,M_Atten);
|
|
8230
|
+
|
8227
|
8231
|
if(CurrAtten + M_Atten <= -20){
|
8228
|
|
- if(threshold + 0.5 <= CurrDet){
|
8229
|
|
- ALC_AlarmSet[num] = true;
|
8230
|
|
-// printf("Alarm 1 ON \r\n");
|
8231
|
|
- }else{
|
8232
|
|
- ALC_AlarmSet[num] = false;
|
8233
|
|
-// printf("Alarm 1 OFF \r\n");
|
8234
|
|
-
|
|
8232
|
+ if(AlarmStatus[num] == false){
|
|
8233
|
+ if(threshold + 0.1 <= CurrDet){
|
|
8234
|
+ ALC_AlarmSet[num] = true;
|
|
8235
|
+// printf("Alarm 1 ON \r\n");
|
|
8236
|
+ }else{
|
|
8237
|
+ ALC_AlarmSet[num] = false;
|
|
8238
|
+// printf("Alarm 1 OFF \r\n");
|
|
8239
|
+ }
|
8235
|
8240
|
}
|
8236
|
|
- }else{
|
8237
|
|
- ALC_AlarmSet[num] = false;
|
|
8241
|
+ }
|
|
8242
|
+#if 0 // PYJ.2020.10.19_BEGIN --
|
|
8243
|
+ else{
|
|
8244
|
+// ALC_AlarmSet[num] = false;
|
8238
|
8245
|
// printf("Alarm 1 OFF\r\n");
|
8239
|
8246
|
}
|
|
8247
|
+#endif // PYJ.2020.10.19_END --
|
8240
|
8248
|
}
|
8241
|
8249
|
else if(threshold -2 > CurrDet){
|
8242
|
8250
|
if(CurrAtten < 0){
|
|
@@ -8265,7 +8273,7 @@ double HFR_CntUpCalc(double ret){
|
8265
|
8273
|
// printf("2. ret : %f \r\n",ret);
|
8266
|
8274
|
|
8267
|
8275
|
|
8268
|
|
- if(calctmp >= 5){
|
|
8276
|
+ if(calctmp >= 6){
|
8269
|
8277
|
// printf("minus return \r\n");
|
8270
|
8278
|
origin = (origin -1) + (calctmp * 0.1);
|
8271
|
8279
|
}else{
|
|
@@ -8290,6 +8298,7 @@ void ALC_Package_Operate(uint8_t*ULO_ADC_Level,uint8_t* ULO_Level,DET_TABLEUL_st
|
8290
|
8298
|
double CurrentATTENVALUE = 0;
|
8291
|
8299
|
int16_t Limitdata = 0;
|
8292
|
8300
|
double ResdBm = 0;
|
|
8301
|
+ double Temp_ResdBm = 0;
|
8293
|
8302
|
int16_t ResultData = 0;
|
8294
|
8303
|
int16_t IwillGiveAtten = 0;
|
8295
|
8304
|
int16_t UL_Atten = 0;
|
|
@@ -8321,32 +8330,50 @@ void ALC_Package_Operate(uint8_t*ULO_ADC_Level,uint8_t* ULO_Level,DET_TABLEUL_st
|
8321
|
8330
|
|
8322
|
8331
|
CurrentATTENVALUE = PE43711_Double(ALC_Atten[ULO_ALC_H],ALC_Atten[ULO_ALC_L]);
|
8323
|
8332
|
|
8324
|
|
-// printf("=============ALC ON =====START================\r\n");
|
8325
|
|
-// printf("Current UL ADC VALUE : %f \r\n",ret);
|
8326
|
|
-// printf("ResdBm : UL%d : %f \r\n",TableIndex + 1,ResdBm);
|
8327
|
|
-// printf("ORIGIN ResdBm : %f %d\r\n",ResdBm,Main_Atten);
|
8328
|
|
-// printf("After ResdBm : %f \r\n",ResdBm);
|
|
8333
|
+#if 0 // PYJ.2020.10.19_BEGIN --
|
|
8334
|
+ printf("=============ALC ON =====START================\r\n");
|
|
8335
|
+ printf("Current UL ADC VALUE : %f \r\n",ret);
|
|
8336
|
+ printf("ResdBm : UL%d : %f \r\n",TableIndex + 1,ResdBm);
|
|
8337
|
+ printf("ORIGIN ResdBm : %f %d\r\n",ResdBm,Main_Atten);
|
|
8338
|
+ printf("After ResdBm : %f \r\n",ResdBm);
|
|
8339
|
+#endif // PYJ.2020.10.19_END --
|
|
8340
|
+
|
|
8341
|
+ ResultData = HFR_CntUpCalc(ResdBm);
|
|
8342
|
+ int HFR_Dot5 = ((int)(ResdBm * 10) % 10);
|
8329
|
8343
|
|
8330
|
|
- ResdBm = HFR_CntUpCalc(ResdBm);
|
8331
|
|
- ResultData = ResdBm;
|
|
8344
|
+
|
|
8345
|
+ Temp_ResdBm = ResultData;
|
8332
|
8346
|
// printf("HFR CALC RET : %d \r\n",ResultData);
|
8333
|
8347
|
ULO_Level[ULO_ALC_H] = (ResultData & 0xFF00) >> 8;
|
8334
|
8348
|
ULO_Level[ULO_ALC_L] = (ResultData & 0x00FF);
|
8335
|
8349
|
Limitdata += (Main_Atten * 0.1);
|
|
8350
|
+ if(Limitdata < ResultData){
|
|
8351
|
+ if(HFR_Dot5 == -5){
|
|
8352
|
+ ResultData--;
|
|
8353
|
+ Temp_ResdBm--;
|
|
8354
|
+ }
|
|
8355
|
+ }
|
8336
|
8356
|
// printf("Limitdata : %d | ResultData : %d \r\n",Limitdata,ResultData);
|
8337
|
|
- ALC_Alarm_TimerSet(TableIndex,Limitdata,ResultData,UL_Atten,Main_Atten);
|
8338
|
|
- IwillGiveAtten = ALC_Calc(TableIndex,CurrentATTENVALUE,Limitdata,ResdBm);
|
|
8357
|
+ ALC_Alarm_TimerSet(TableIndex,Limitdata,ResdBm,UL_Atten,Main_Atten);
|
|
8358
|
+ IwillGiveAtten = ALC_Calc(TableIndex,CurrentATTENVALUE,Limitdata,Temp_ResdBm);
|
|
8359
|
+
|
|
8360
|
+
|
8339
|
8361
|
// printf("STEP 1 : I WILL GIVE ATTEN %d \r\n",IwillGiveAtten);
|
8340
|
8362
|
IwillGiveAtten += UL_Atten;
|
8341
|
8363
|
// printf("STEP 2 : I WILL GIVE ATTEN PLUS ALC ATTEN %d \r\n",IwillGiveAtten);
|
8342
|
|
- if(ResdBm <= (Limitdata - 1)){
|
|
8364
|
+// printf("STEP 3 :ResdBm : %f (Limitdata - 1) : %d HFR_Dot5 %d \r\n",ResdBm,(Limitdata - 1),HFR_Dot5);
|
|
8365
|
+
|
|
8366
|
+ if((ResultData <= (Limitdata - 1)) ) {
|
8343
|
8367
|
if(IwillGiveAtten <= -10){
|
8344
|
8368
|
IwillGiveAtten += 10;
|
8345
|
8369
|
}
|
|
8370
|
+// printf("1 I WILL GIVE ATTEN : %d \r\n", IwillGiveAtten);
|
8346
|
8371
|
}
|
8347
|
8372
|
GiveAttenPlusULAtten = IwillGiveAtten + (Main_Atten );
|
8348
|
|
- if(GiveAttenPlusULAtten <= - 200){
|
|
8373
|
+// printf("1 I WILL GIVE ATTEN : %d \r\n", IwillGiveAtten);
|
|
8374
|
+ if(GiveAttenPlusULAtten <= - 200 ){
|
8349
|
8375
|
IwillGiveAtten = -200 + ((Main_Atten * -1));
|
|
8376
|
+// printf("3 I WILL GIVE ATTEN : %d \r\n", IwillGiveAtten);
|
8350
|
8377
|
}
|
8351
|
8378
|
if(IwillGiveAtten <= -200){
|
8352
|
8379
|
IwillGiveAtten = -200;
|
|
@@ -8354,9 +8381,11 @@ void ALC_Package_Operate(uint8_t*ULO_ADC_Level,uint8_t* ULO_Level,DET_TABLEUL_st
|
8354
|
8381
|
if(IwillGiveAtten >= 0){
|
8355
|
8382
|
IwillGiveAtten = 0;
|
8356
|
8383
|
}
|
8357
|
|
-// printf(" UL_Atten: %d I WILL GIVE ATTEN : %d \r\n", UL_Atten,IwillGiveAtten);
|
8358
|
|
-// printf("ADC : %f CURR ATT : %f Threas : %d : I WILL GIVE ATTEN : %d \r\n",ret,ResdBm , Limitdata,IwillGiveAtten);
|
8359
|
|
-// printf("==================END================\r\n");
|
|
8384
|
+#if 0 // PYJ.2020.10.19_BEGIN --
|
|
8385
|
+ printf(" UL_Atten: %d I WILL GIVE ATTEN : %d \r\n", UL_Atten,IwillGiveAtten);
|
|
8386
|
+ printf("ADC : %f CURR ATT : %f Threas : %d : I WILL GIVE ATTEN : %d \r\n",ret,ResdBm , Limitdata,IwillGiveAtten);
|
|
8387
|
+ printf("==================END================\r\n");
|
|
8388
|
+#endif // PYJ.2020.10.19_END --
|
8360
|
8389
|
|
8361
|
8390
|
// if( (IwillGiveAtten > 0) || (CurrentATTENVALUE >= (IwillGiveAtten))){
|
8362
|
8391
|
// IwillGiveAtten *= 10;
|
|
@@ -8461,7 +8490,7 @@ void ALC_Function(){ //DL
|
8461
|
8490
|
&bluecell_Currdatastatus.ATT_UL1_H,
|
8462
|
8491
|
&bluecell_Currdatastatus.bluecell_User_UL1_H,
|
8463
|
8492
|
&bluecell_Currdatastatus.ULO_Shutdown_Retry_Count1);
|
8464
|
|
-#if 0 // PYJ.2020.07.16_BEGIN --
|
|
8493
|
+#if 1 // PYJ.2020.07.16_BEGIN --
|
8465
|
8494
|
ALC_Package_Operate(&bluecell_Currdatastatus.ULO_P2_Level2_H,
|
8466
|
8495
|
&bluecell_Currdatastatus.ULO_Level2_H,
|
8467
|
8496
|
&Det_UL2.Table_Det_15_dBm_H,
|
|
@@ -8593,7 +8622,7 @@ void AGC_Alarm_Check(uint8_t Path_Index,double AGC_Det,uint8_t* AGC_Table,uint16
|
8593
|
8622
|
void AGC_Package_Operate(uint8_t* Threshold,uint8_t* DL_MainAtten,uint8_t Tableindex,uint8_t* DLI_ADC_Level,uint8_t* DLI_Level,DET_TABLEDL_st* DL_Table,uint8_t* FRBT){
|
8594
|
8623
|
double ret = 0;
|
8595
|
8624
|
int16_t ResdBm = 0;
|
8596
|
|
-
|
|
8625
|
+ double Temp_ResdBm = 0;
|
8597
|
8626
|
int16_t CurrAtten = 0;
|
8598
|
8627
|
int16_t Levelret = 0;
|
8599
|
8628
|
int i = 0;
|
|
@@ -8620,7 +8649,9 @@ void AGC_Package_Operate(uint8_t* Threshold,uint8_t* DL_MainAtten,uint8_t Tablei
|
8620
|
8649
|
CurrAtten = (int16_t)(DL_MainAtten[DLI_AGC_H] << 8 | DL_MainAtten[DLI_AGC_L]);
|
8621
|
8650
|
CurrAtten *= 0.1;
|
8622
|
8651
|
ResdBm = (int16_t)(DLI_Level[DLI_AGC_H] << 8 | DLI_Level[DLI_AGC_L]) * 10;//(int8_t)Bluecell_TestPro(AGC_AutoControl_ADC_Compare(ret,&DL_Table->Table_Det5_dBm_H,DL_Table->Table_Length,AGC_Table));
|
8623
|
|
- ResdBm = (int16_t)Bluecell_TestPro( ResdBm / 10);
|
|
8652
|
+ Temp_ResdBm = ResdBm *0.01 ;
|
|
8653
|
+// printf("ResdBm %d \r\n",ResdBm);
|
|
8654
|
+ ResdBm = (int16_t)Bluecell_TestPro(ResdBm/10);
|
8624
|
8655
|
// DLI_Level[DLI_AGC_H] = ((int16_t)ResdBm & 0xFF00) >> 8;
|
8625
|
8656
|
// DLI_Level[DLI_AGC_L] = ((int16_t)ResdBm & 0x00FF);
|
8626
|
8657
|
for(i = 0; i < sizeof(AGC_dBm_t); i++){
|
|
@@ -8633,7 +8664,16 @@ void AGC_Package_Operate(uint8_t* Threshold,uint8_t* DL_MainAtten,uint8_t Tablei
|
8633
|
8664
|
|
8634
|
8665
|
|
8635
|
8666
|
}
|
|
8667
|
+
|
8636
|
8668
|
if(bluecell_Currdatastatus.DLI_FRBT_Status == FRBT_IDEL){
|
|
8669
|
+ if(Limitdata < ResdBm){
|
|
8670
|
+ int HFR_Dot5 = ((int)(Temp_ResdBm * 10) % 10);
|
|
8671
|
+ if(HFR_Dot5 == -5){
|
|
8672
|
+ ResdBm = Limitdata + (CurrAtten * -1);
|
|
8673
|
+ }
|
|
8674
|
+ }
|
|
8675
|
+// printf("3ResdBm : DL%d : %d \r\n",Tableindex+1,ResdBm);
|
|
8676
|
+
|
8637
|
8677
|
IwillgiveAtten = New_AGC_Calc(Limitdata,ResdBm);
|
8638
|
8678
|
if(Limitdata == ResdBm){
|
8639
|
8679
|
IwillgiveAtten = CurrAtten;
|
|
@@ -8645,13 +8685,15 @@ void AGC_Package_Operate(uint8_t* Threshold,uint8_t* DL_MainAtten,uint8_t Tablei
|
8645
|
8685
|
|
8646
|
8686
|
IwillgiveAtten *= -1;
|
8647
|
8687
|
#if 0// PYJ.2020.09.14_BEGIN --
|
8648
|
|
- printf("==================================\r\n");
|
|
8688
|
+ printf("==================================\r\n");
|
8649
|
8689
|
printf("Curr ATTEN %d \r\n",CurrAtten );
|
8650
|
8690
|
printf("Current DL% ADC VALUE : %f \r\n",Tableindex+1,ret);
|
8651
|
|
- printf("ResdBm : DL%d : %d \r\n",Tableindex+1,ResdBm);
|
|
8691
|
+ printf("Temp_ResdBm : DL%d : %f \r\n",Tableindex+1,Temp_ResdBm);
|
8652
|
8692
|
printf("I WILL GIVE YOU ATTEN : %d\r\n",IwillgiveAtten);
|
8653
|
8693
|
printf("AGC : %d\r\n",Limitdata);
|
8654
|
8694
|
#endif // PYJ.2020.09.14_END --
|
|
8695
|
+
|
|
8696
|
+
|
8655
|
8697
|
if(bluecell_Currdatastatus.DLI_FRBT_Status != FRBT_IDEL && (CurrAtten) < IwillgiveAtten){
|
8656
|
8698
|
IwillgiveAtten = (CurrAtten );
|
8657
|
8699
|
|
|
@@ -8662,6 +8704,7 @@ void AGC_Package_Operate(uint8_t* Threshold,uint8_t* DL_MainAtten,uint8_t Tablei
|
8662
|
8704
|
|
8663
|
8705
|
if(bluecell_Currdatastatus.DLI_FRBT_Status == FRBT_IDEL){
|
8664
|
8706
|
if(Limitdata != ResdBm){
|
|
8707
|
+
|
8665
|
8708
|
if(CurrAtten + ResdBm <= Limitdata - 1)
|
8666
|
8709
|
IwillgiveAtten = ((CurrAtten) + 1);
|
8667
|
8710
|
if(CurrAtten == 0)
|
|
@@ -8672,7 +8715,7 @@ void AGC_Package_Operate(uint8_t* Threshold,uint8_t* DL_MainAtten,uint8_t Tablei
|
8672
|
8715
|
DL_PrevIwillgiveAtten[Tableindex] = IwillgiveAtten;
|
8673
|
8716
|
DL_MainAtten[DLI_AGC_H] = ((((IwillgiveAtten) * 10) & 0xFF00) >> 8) ;
|
8674
|
8717
|
DL_MainAtten[DLI_AGC_L] = ((((IwillgiveAtten) * 10) & 0x00FF));
|
8675
|
|
-// printf("Apply 2 Curr ATTEN %d \r\n", (int16_t)(DL_MainAtten[DLI_AGC_H] << 8 | DL_MainAtten[DLI_AGC_L]));
|
|
8718
|
+ printf("Apply 2 Curr ATTEN %d \r\n", (int16_t)(DL_MainAtten[DLI_AGC_H] << 8 | DL_MainAtten[DLI_AGC_L]));
|
8676
|
8719
|
CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);
|
8677
|
8720
|
}else{
|
8678
|
8721
|
if(Limitdata == ResdBm){
|
|
@@ -8791,6 +8834,7 @@ void AGC_Function(){//DL
|
8791
|
8834
|
static int8_t* AGC_Table;// = &DL_DET_Table_ref[MBIC_Table_DL1_INDEX][TABLE_MAX_VALUE];*/
|
8792
|
8835
|
|
8793
|
8836
|
int16_t Limitdata = 0;
|
|
8837
|
+ uint8_t* AGC_AlarmStatus = &bluecell_Currdatastatus.DLI_AGC_Alarm1;
|
8794
|
8838
|
int16_t DL_Curr_Atten[AGC_Alarm_DL_Index_MAX] = {
|
8795
|
8839
|
bluecell_Currdatastatus.ATT_DL1_H << 8 | bluecell_Currdatastatus.ATT_DL1_L,
|
8796
|
8840
|
bluecell_Currdatastatus.ATT_DL2_H << 8 | bluecell_Currdatastatus.ATT_DL2_L,
|
|
@@ -8812,16 +8856,37 @@ void AGC_Function(){//DL
|
8812
|
8856
|
bluecell_Currdatastatus.ATT_DL3_H << 8 | bluecell_Currdatastatus.ATT_DL3_L;
|
8813
|
8857
|
DL_Curr_Atten[AGC_Alarm_DL4_Index] =
|
8814
|
8858
|
bluecell_Currdatastatus.ATT_DL4_H << 8 | bluecell_Currdatastatus.ATT_DL4_L;
|
|
8859
|
+
|
|
8860
|
+ uint8_t* DLI_Level = &bluecell_Currdatastatus.DLI_Level1_H;
|
|
8861
|
+ int16_t ResdBm = 0;
|
|
8862
|
+
|
|
8863
|
+
|
8815
|
8864
|
for(int k = 0; k < AGC_Alarm_DL_Index_MAX; k++){
|
|
8865
|
+// if(k != 0) continue;
|
|
8866
|
+ ResdBm = (int16_t)(DLI_Level[DLI_AGC_H + (k * 2)] << 8 | DLI_Level[DLI_AGC_L + ((k * 2))]) * 10;
|
|
8867
|
+
|
|
8868
|
+// printf("Limitdata : %d ResdBm : %d \r\n",Limitdata * 100,ResdBm);
|
8816
|
8869
|
if(DL_Curr_Atten[AGC_Alarm_DL1_Index+k] <= -150)
|
8817
|
8870
|
DL_Curr_Atten[AGC_Alarm_DL1_Index+k] = -150;
|
8818
|
8871
|
// printf("DL_Curr_Atten%d : %d \r\n",k+1,DL_Curr_Atten[AGC_Alarm_DL1_Index+k] * 0.1);
|
8819
|
|
- if((DL_Curr_Atten[AGC_Alarm_DL1_Index+k] * 0.1) <= -15 ){
|
|
8872
|
+ if(((DL_Curr_Atten[AGC_Alarm_DL1_Index+k] * 0.1) <= -15) && ((Limitdata * 100) < ResdBm - 1500) ){
|
8820
|
8873
|
// printf("DL_Curr_Atten%d : %d Alarm TRue\r\n",k+1,DL_Curr_Atten[AGC_Alarm_DL1_Index+k]);
|
8821
|
8874
|
AGC_AlarmSet[AGC_Alarm_DL1_Index+k] = true;
|
8822
|
8875
|
}else{
|
8823
|
|
- AGC_AlarmSet[AGC_Alarm_DL1_Index+k] = false;
|
|
8876
|
+ if(AGC_AlarmStatus[AGC_Alarm_DL1_Index+k] == true){
|
|
8877
|
+ if((DL_Curr_Atten[AGC_Alarm_DL1_Index+k] * 0.1) >= -13 ){
|
|
8878
|
+ AGC_AlarmSet[AGC_Alarm_DL1_Index+k] = false;
|
|
8879
|
+// printf("AGC FALSE 1 DL_Curr_Atten %f \r\n",(DL_Curr_Atten[AGC_Alarm_DL1_Index+k] * 0.1));
|
|
8880
|
+ }else{
|
|
8881
|
+ AGC_AlarmSet[AGC_Alarm_DL1_Index+k] = true;
|
|
8882
|
+// printf("AGC TRUE 2\r\n");
|
|
8883
|
+ }
|
|
8884
|
+ }else{
|
|
8885
|
+ AGC_AlarmSet[AGC_Alarm_DL1_Index+k] = false;
|
|
8886
|
+// printf("AGC FALSE 3\r\n");
|
|
8887
|
+ }
|
8824
|
8888
|
}
|
|
8889
|
+// printf("AGC_AlarmSet : %d \r\n",AGC_AlarmSet[AGC_Alarm_DL1_Index+k]);
|
8825
|
8890
|
}
|
8826
|
8891
|
AGC_Package_Operate(&bluecell_Currdatastatus.DLI_AGC_Threshold_H,
|
8827
|
8892
|
&bluecell_Currdatastatus.ATT_DL1_H,
|
|
@@ -9676,7 +9741,7 @@ void LED_Alarm_Check(){
|
9676
|
9741
|
if(bluecell_Currdatastatus.ALARM_TESTMODE == false){
|
9677
|
9742
|
if(bluecell_Currdatastatus.SelfTest == true){
|
9678
|
9743
|
Alarm_LED_OnSet = false;
|
9679
|
|
- printf("%d\r\n",__LINE__);
|
|
9744
|
+// printf("%d\r\n",__LINE__);
|
9680
|
9745
|
}
|
9681
|
9746
|
#if 0 // PYJ.2020.09.23_BEGIN --
|
9682
|
9747
|
else if(
|