|
@@ -84,6 +84,9 @@ extern volatile uint32_t ADC_100ms_Cnt;
|
84
|
84
|
extern volatile uint32_t HFR_ADC1value[ADC1_CNT];
|
85
|
85
|
extern volatile uint32_t HFR_ADC3value[ADC3_CNT];
|
86
|
86
|
|
|
87
|
+extern volatile uint32_t ALC_Delay_Cnt[ALC_Alarm_UL_Index_MAX];
|
|
88
|
+
|
|
89
|
+
|
87
|
90
|
volatile uint8_t Selftest_DL_PrevAttenSave[8] = {0,};
|
88
|
91
|
volatile uint8_t Selftest_UL_PrevAttenSave[8] = {0,};
|
89
|
92
|
uint8_t TempShutdown_DL_SaveData[4] = {false,};
|
|
@@ -8475,6 +8478,16 @@ typedef enum{
|
8475
|
8478
|
ULO_ALC_H = 0,
|
8476
|
8479
|
ULO_ALC_L,
|
8477
|
8480
|
};
|
|
8481
|
+
|
|
8482
|
+
|
|
8483
|
+bool ALC_DelayCnt_val[ALC_Alarm_UL_Index_MAX] = {false,};
|
|
8484
|
+
|
|
8485
|
+void ALC_DelayCnt_Set(uint8_t index,bool set){
|
|
8486
|
+ ALC_DelayCnt_val[index] = set;
|
|
8487
|
+}
|
|
8488
|
+bool ALC_DelayCnt_Get(uint8_t index){
|
|
8489
|
+ return ALC_DelayCnt_val[index];
|
|
8490
|
+}
|
8478
|
8491
|
|
8479
|
8492
|
void ALC_Package_Operate(uint8_t*ULO_ADC_Level,uint8_t* ULO_Level,DET_TABLEUL_st* UL_Table,uint8_t TableIndex,uint8_t* ALC_Atten,uint8_t* UL_Main_Atten,uint8_t* GainOffset,uint8_t* retrycnt ){
|
8480
|
8493
|
/*static int16_t PrevLimitdata[ALC_Alarm_UL_Index_MAX] = {0,};
|
|
@@ -8493,8 +8506,18 @@ void ALC_Package_Operate(uint8_t*ULO_ADC_Level,uint8_t* ULO_Level,DET_TABLEUL_st
|
8493
|
8506
|
int16_t Main_Atten = 0;
|
8494
|
8507
|
int16_t GiveAttenPlusULAtten = 0;
|
8495
|
8508
|
int16_t Plus_ResultData = 0;
|
|
8509
|
+ static int16_t Prev_IwillGiveAtten[ALC_Alarm_UL_Index_MAX] ={0,};
|
8496
|
8510
|
if(*retrycnt > 0)
|
8497
|
8511
|
return;
|
|
8512
|
+
|
|
8513
|
+
|
|
8514
|
+
|
|
8515
|
+ if(ALC_Delay_Cnt[TableIndex] < 600 && ALC_DelayCnt_Get(TableIndex) == true)
|
|
8516
|
+ return;
|
|
8517
|
+ else
|
|
8518
|
+ ALC_DelayCnt_Set(TableIndex,false);
|
|
8519
|
+
|
|
8520
|
+
|
8498
|
8521
|
|
8499
|
8522
|
UL_Atten = ALC_Atten[ULO_ALC_H] << 8 | ALC_Atten[ULO_ALC_L];
|
8500
|
8523
|
Main_Atten = UL_Main_Atten[ULO_ALC_H] << 8 | UL_Main_Atten[ULO_ALC_L];
|
|
@@ -8517,8 +8540,7 @@ void ALC_Package_Operate(uint8_t*ULO_ADC_Level,uint8_t* ULO_Level,DET_TABLEUL_st
|
8517
|
8540
|
//ret 에 따른 현재 DBM 구현
|
8518
|
8541
|
|
8519
|
8542
|
CurrentATTENVALUE = PE43711_Double(ALC_Atten[ULO_ALC_H],ALC_Atten[ULO_ALC_L]);
|
8520
|
|
-
|
8521
|
|
-#if 0 // PYJ.2020.10.19_BEGIN --
|
|
8543
|
+#if 0 // PYJ.2020.10.19_BEGIN --
|
8522
|
8544
|
printf("=============ALC ON =====START================\r\n");
|
8523
|
8545
|
printf("Current UL ADC VALUE : %f \r\n",ret);
|
8524
|
8546
|
printf("ResdBm : UL%d : %f \r\n",TableIndex + 1,ResdBm);
|
|
@@ -8573,11 +8595,15 @@ void ALC_Package_Operate(uint8_t*ULO_ADC_Level,uint8_t* ULO_Level,DET_TABLEUL_st
|
8573
|
8595
|
if(IwillGiveAtten >= 0){
|
8574
|
8596
|
IwillGiveAtten = 0;
|
8575
|
8597
|
}
|
8576
|
|
-#if 0 // PYJ.2020.10.19_BEGIN --
|
|
8598
|
+#if 0// PYJ.2020.10.19_BEGIN --
|
8577
|
8599
|
printf(" UL_Atten: %d I WILL GIVE ATTEN : %d \r\n", UL_Atten,IwillGiveAtten);
|
8578
|
8600
|
printf("ADC : %f CURR ATT : %f Threas : %d : I WILL GIVE ATTEN : %d \r\n",ret,ResdBm , Limitdata,IwillGiveAtten);
|
8579
|
|
- printf("==================END================\r\n");
|
|
8601
|
+ printf("==================END================\r\n");
|
8580
|
8602
|
#endif // PYJ.2020.10.19_END --
|
|
8603
|
+ if(Prev_IwillGiveAtten[TableIndex] != IwillGiveAtten){
|
|
8604
|
+ Prev_IwillGiveAtten[TableIndex] = IwillGiveAtten;
|
|
8605
|
+ ALC_DelayCnt_Set(TableIndex,true);
|
|
8606
|
+ }
|
8581
|
8607
|
|
8582
|
8608
|
// if( (IwillGiveAtten > 0) || (CurrentATTENVALUE >= (IwillGiveAtten))){
|
8583
|
8609
|
// IwillGiveAtten *= 10;
|
|
@@ -8636,7 +8662,7 @@ int16_t ResultData = 0;
|
8636
|
8662
|
// printf("ResdBm : %x ///// bluecell_Currdatastatus.ULO_Level1_L : %x \r\n",ResultData,ULO_Level[ULO_ALC_L]);
|
8637
|
8663
|
// printf("==================END================\r\n");
|
8638
|
8664
|
}
|
8639
|
|
-
|
|
8665
|
+#define ALC_PRINT 0
|
8640
|
8666
|
void ALC_Function(){ //DL
|
8641
|
8667
|
//double Volt_Calc_val = 3.3 / 4095;
|
8642
|
8668
|
//double tempret = 0;
|