|
@@ -6437,7 +6437,7 @@ void DET_LevelAlarmCheck(){
|
6437
|
6437
|
printf("MBIC_DL_ShutdownCount : %d \r\n",MBIC_DL_ShutdownCount[DET_Alarm_DL1_Shutdown_Index ]);
|
6438
|
6438
|
printf("ADC_Alarm_DL_Normal_Shutdown_Set : %d \r\n",ADC_Alarm_DL_Normal_Shutdown_Set[DET_Alarm_DL1_Shutdown_Index]);
|
6439
|
6439
|
printf("=========================End============================================\r\n");
|
6440
|
|
- HAL_Delay(500);
|
|
6440
|
+// HAL_Delay(500);
|
6441
|
6441
|
#endif // PYJ.2020.10.23_END --
|
6442
|
6442
|
}
|
6443
|
6443
|
for(int i = 0 ; i < DET_Alarm_DL_Shutdown_Index_MAX; i++){
|
|
@@ -6446,6 +6446,9 @@ void DET_LevelAlarmCheck(){
|
6446
|
6446
|
// if(LimitData_DL_Shutdown <= Res_Down_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i]){
|
6447
|
6447
|
if(LimitData_DL_Shutdown < Res_Down_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i]){
|
6448
|
6448
|
// if(DL_Atten[DET_Alarm_DL1_Index + i] * 0.1 <= -15)
|
|
6449
|
+// if(i == 0){
|
|
6450
|
+// printf("1Res_Down_DL_dBm : %d \r\n",Res_Down_DL_dBm[DET_Alarm_DL1_Shutdown_Index ]);
|
|
6451
|
+// }
|
6449
|
6452
|
ADC_Alarm_DL_Shutdown_Set[DET_Alarm_DL1_Shutdown_Index + i] = true;
|
6450
|
6453
|
// printf("Shutdown On 1\r\n");
|
6451
|
6454
|
}
|
|
@@ -6454,6 +6457,9 @@ void DET_LevelAlarmCheck(){
|
6454
|
6457
|
&& MBIC_DL_ShutdownCount[DET_Alarm_DL1_Shutdown_Index + i] > 0 )
|
6455
|
6458
|
{
|
6456
|
6459
|
ADC_Alarm_DL_Shutdown_Set[DET_Alarm_DL1_Shutdown_Index + i] = true;
|
|
6460
|
+// if(i == 0){
|
|
6461
|
+// printf("2Res_Down_DL_dBm : %d \r\n",Res_Down_DL_dBm[DET_Alarm_DL1_Shutdown_Index ]);
|
|
6462
|
+// }
|
6457
|
6463
|
// printf("Shutdown On 1_1\r\n");
|
6458
|
6464
|
}
|
6459
|
6465
|
else if(MBIC_DL_ShutdownCount[DET_Alarm_DL1_Shutdown_Index + i] > 0){
|
|
@@ -6464,22 +6470,27 @@ void DET_LevelAlarmCheck(){
|
6464
|
6470
|
}
|
6465
|
6471
|
else
|
6466
|
6472
|
{
|
6467
|
|
-// if(LimitData_DL_Shutdown <= Res_Up_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i]){
|
6468
|
|
- if(LimitData_DL_Shutdown < Res_Down_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i]){
|
6469
|
|
-
|
6470
|
|
- // if(DL_Atten[DET_Alarm_DL1_Index + i] * 0.1 <= -15)
|
6471
|
|
- ADC_Alarm_DL_Shutdown_Set[DET_Alarm_DL1_Shutdown_Index + i] = true;
|
6472
|
|
-// printf("Shutdown On 2\r\n");
|
6473
|
|
- }
|
|
6473
|
+ // if(LimitData_DL_Shutdown <= Res_Up_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i]){
|
|
6474
|
+ if(LimitData_DL_Shutdown < Res_Down_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i]){
|
|
6475
|
+ // if(DL_Atten[DET_Alarm_DL1_Index + i] * 0.1 <= -15)
|
|
6476
|
+ ADC_Alarm_DL_Shutdown_Set[DET_Alarm_DL1_Shutdown_Index + i] = true;
|
|
6477
|
+// printf("3Res_Down_DL_dBm : %d \r\n",Res_Down_DL_dBm[DET_Alarm_DL1_Shutdown_Index ]);
|
|
6478
|
+ // printf("Shutdown On 2\r\n");
|
|
6479
|
+ }
|
6474
|
6480
|
else{
|
6475
|
6481
|
if(LimitData_DL_Shutdown - 2 < Res_Up_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i]
|
6476
|
|
- && MBIC_DL_ShutdownCount[DET_Alarm_DL1_Shutdown_Index + i] > 0 ){
|
6477
|
|
- ADC_Alarm_DL_Shutdown_Set[DET_Alarm_DL1_Shutdown_Index + i] = true;
|
6478
|
|
-// printf("Shutdown On 2_1\r\n");
|
|
6482
|
+ && MBIC_DL_ShutdownCount[DET_Alarm_DL1_Shutdown_Index + i] > 0 ){
|
|
6483
|
+// printf("4Res_Down_DL_dBm : %d \r\n",Res_Down_DL_dBm[DET_Alarm_DL1_Shutdown_Index ]);
|
|
6484
|
+ ADC_Alarm_DL_Shutdown_Set[DET_Alarm_DL1_Shutdown_Index + i] = true;
|
|
6485
|
+ // printf("Shutdown On 2_1\r\n");
|
6479
|
6486
|
}
|
6480
|
6487
|
else if(MBIC_DL_ShutdownCount[DET_Alarm_DL1_Shutdown_Index + i] > 0){
|
6481
|
6488
|
ADC_Alarm_DL_Shutdown_Set[DET_Alarm_DL1_Shutdown_Index + i] = false;
|
6482
|
|
-// printf("Shutdown Off 2\r\n");
|
|
6489
|
+ // printf("Shutdown Off 2\r\n");
|
|
6490
|
+ }
|
|
6491
|
+ else if(MBIC_DL_ShutdownCount[DET_Alarm_DL1_Shutdown_Index + i] == 0
|
|
6492
|
+ && LimitData_DL_Shutdown > Res_Up_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i]){
|
|
6493
|
+ ADC_Alarm_DL_Shutdown_Set[DET_Alarm_DL1_Shutdown_Index + i] = false;
|
6483
|
6494
|
}
|
6484
|
6495
|
}
|
6485
|
6496
|
|
|
@@ -6637,42 +6648,6 @@ void DET_LevelAlarmCheck(){
|
6637
|
6648
|
}
|
6638
|
6649
|
|
6639
|
6650
|
}
|
6640
|
|
-#if 0 // PYJ.2020.10.23_BEGIN --
|
6641
|
|
- else{
|
6642
|
|
- /*UL Shutdown Minus Condition Check */
|
6643
|
|
- if(UL_RetryCount[DET_Alarm_UL1_Shutdown_Index + i] > 0
|
6644
|
|
- && LimitData_UL_Shutdown - 2 <= Res_Down_UL_dBm[DET_Alarm_UL1_Shutdown_Index + i]
|
6645
|
|
- && *PathStatus == true){
|
6646
|
|
-// ADC_Alarm_UL_Shutdown_Set[DET_Alarm_UL1_Shutdown_Index + i] = true;
|
6647
|
|
- ADC_Alarm_UL_Normal_Shutdown_Set[DET_Alarm_UL1_Shutdown_Index + i] = true;
|
6648
|
|
- if(DET_UL_Normal_Shutdown_On_AlarmTimerCnt[DET_Alarm_UL1_Shutdown_Index + i] > MBIC_OFF_MAINTAIN_SEC){
|
6649
|
|
- if(UL_RetryCount[DET_Alarm_UL1_Shutdown_Index + i] > 0){// Nomal Operate
|
6650
|
|
- UL_RetryCount[DET_Alarm_UL1_Shutdown_Index + i] = 0;
|
6651
|
|
- printf("UL%d_PATH : %d Retry Count Initialize Start %d \r\n",i+1,UL_PathStatus[DET_Alarm_UL1_Shutdown_Index + i],bluecell_Currdatastatus.ULO_Shutdown_Retry_Count2);
|
6652
|
|
- }
|
6653
|
|
- }
|
6654
|
|
- printf("2_1 Shutdown threas hold : %d \r\n Curr Meas : %d Shutdown UL %d \r\n Alarm ON Count : %d\r\n",LimitData_UL_Shutdown,Res_Down_UL_dBm[DET_Alarm_UL1_Shutdown_Index + i],i + 1,UL_RetryCount[DET_Alarm_UL1_Shutdown_Index + i] );
|
6655
|
|
- }
|
6656
|
|
- else if(LimitData_UL_Shutdown - 2 >= Res_Down_UL_dBm[DET_Alarm_UL1_Shutdown_Index + i]){
|
6657
|
|
- ADC_Alarm_UL_Shutdown_Set[DET_Alarm_UL1_Shutdown_Index + i] = false;
|
6658
|
|
- ADC_Alarm_UL_Normal_Shutdown_Set[DET_Alarm_UL1_Shutdown_Index + i] = false;
|
6659
|
|
- printf("2 Shutdown threas hold : %d \r\n Curr Meas : %d Shutdown UL %d \r\n Alarm OFF Count : %d\r\n",LimitData_UL_Shutdown,Res_Down_UL_dBm[DET_Alarm_UL1_Shutdown_Index + i],i + 1,UL_RetryCount[DET_Alarm_UL1_Shutdown_Index + i] );
|
6660
|
|
- }
|
6661
|
|
- else if(UL_PathStatus[DET_Alarm_UL1_Shutdown_Index + i] == true){
|
6662
|
|
- ADC_Alarm_UL_Normal_Shutdown_Set[DET_Alarm_UL1_Shutdown_Index + i] = true;
|
6663
|
|
- if(DET_UL_Normal_Shutdown_On_AlarmTimerCnt[DET_Alarm_UL1_Shutdown_Index + i] > MBIC_OFF_MAINTAIN_SEC){
|
6664
|
|
- if(UL_RetryCount[DET_Alarm_UL1_Shutdown_Index + i] > 0){// Nomal Operate
|
6665
|
|
- UL_RetryCount[DET_Alarm_UL1_Shutdown_Index + i] = 0;
|
6666
|
|
- printf("UL%d_PATH : %d Retry Count Initialize Start %d \r\n",i+1,UL_PathStatus[DET_Alarm_UL1_Shutdown_Index + i],bluecell_Currdatastatus.ULO_Shutdown_Retry_Count2);
|
6667
|
|
- }
|
6668
|
|
- }
|
6669
|
|
- }else{
|
6670
|
|
- ADC_Alarm_UL_Normal_Shutdown_Set[DET_Alarm_UL1_Shutdown_Index + i] = false;
|
6671
|
|
- printf("3_0 Shutdown threas hold : %d \r\n Curr Meas : %d Shutdown UL %d | Alarm OFF Count : %d\r\n",LimitData_UL_Shutdown,Res_Down_UL_dBm[DET_Alarm_UL1_Shutdown_Index + i],i + 1,UL_RetryCount[DET_Alarm_UL1_Shutdown_Index + i] );
|
6672
|
|
- }
|
6673
|
|
- printf("3_1 Shutdown threas hold : %d \r\n Curr Meas : %d Shutdown UL %d Count : %d\r\n",LimitData_UL_Shutdown,Res_Down_UL_dBm[DET_Alarm_UL1_Shutdown_Index + i],i + 1,UL_RetryCount[DET_Alarm_UL1_Shutdown_Index + i] );
|
6674
|
|
- }
|
6675
|
|
-#endif // PYJ.2020.10.23_END --
|
6676
|
6651
|
// HAL_Delay(500);
|
6677
|
6652
|
}
|
6678
|
6653
|
|
|
@@ -8446,7 +8421,7 @@ void ALC_Alarm_TimerSet(uint8_t num,int16_t threshold,double CurrDet,int16_t Att
|
8446
|
8421
|
if(CurrAtten + M_Atten <= -20){
|
8447
|
8422
|
if(AlarmStatus[num] == false){
|
8448
|
8423
|
// if(threshold + 0.6 <= CurrDet){
|
8449
|
|
- if(threshold <= CurrDet){
|
|
8424
|
+ if(threshold <= CurrDet && threshold + 0.6 <= CurrDet){
|
8450
|
8425
|
ALC_AlarmSet[num] = true;
|
8451
|
8426
|
// printf("Alarm 1 ON \r\n");
|
8452
|
8427
|
}else{
|
|
@@ -8952,8 +8927,8 @@ void AGC_Package_Operate(uint8_t* Threshold,uint8_t* DL_MainAtten,uint8_t Tablei
|
8952
|
8927
|
#endif
|
8953
|
8928
|
}
|
8954
|
8929
|
}
|
8955
|
|
- if(IwillgiveAtten > 0){
|
8956
|
|
- IwillgiveAtten = 0;
|
|
8930
|
+ if(IwillgiveAtten >= 5){
|
|
8931
|
+ IwillgiveAtten = 5;
|
8957
|
8932
|
}
|
8958
|
8933
|
}
|
8959
|
8934
|
|
|
@@ -9346,6 +9321,8 @@ typedef enum{
|
9346
|
9321
|
DL_Shutdown_L,
|
9347
|
9322
|
};
|
9348
|
9323
|
|
|
9324
|
+
|
|
9325
|
+#define DL_SHUTDOWN_DEBUG 1
|
9349
|
9326
|
void DL_Shutdown_Operate(uint8_t index,uint8_t* path,uint8_t* retrycnt,uint8_t* ShutdownAlarm,uint8_t* MainAtten){
|
9350
|
9327
|
GPIO_TypeDef *Port = 0;
|
9351
|
9328
|
uint16_t Pin = 0;
|
|
@@ -9380,22 +9357,22 @@ void DL_Shutdown_Operate(uint8_t index,uint8_t* path,uint8_t* retrycnt,uint8_t*
|
9380
|
9357
|
&& DET_DL_Shutdown_Off_AlarmTimerCnt[index] >= MBIC_RECOVERY_SHUTDOWN_MAINTAIN_SEC
|
9381
|
9358
|
&& DL_PathUserHandl[index] == false
|
9382
|
9359
|
&& (*retrycnt) > 0){
|
9383
|
|
- HAL_GPIO_WritePin(Port,Pin,GPIO_PIN_SET);//CLOCK
|
9384
|
|
- *path = true;
|
9385
|
|
- MainAtten[DL_Shutdown_H] = 0xFF;
|
9386
|
|
- MainAtten[DL_Shutdown_L] = 0xFF;
|
9387
|
|
- PrevMBIC_DL_ShutdownCount[index] = MBIC_DL_ShutdownCount[index];
|
9388
|
|
- CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);
|
|
9360
|
+ HAL_GPIO_WritePin(Port,Pin,GPIO_PIN_SET);//CLOCK
|
|
9361
|
+ *path = true;
|
|
9362
|
+ MainAtten[DL_Shutdown_H] = 0xFF;
|
|
9363
|
+ MainAtten[DL_Shutdown_L] = 0xFF;
|
|
9364
|
+ PrevMBIC_DL_ShutdownCount[index] = MBIC_DL_ShutdownCount[index];
|
|
9365
|
+ CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);
|
9389
|
9366
|
}
|
9390
|
9367
|
else if(MBIC_DL_ShutdownCount[index] == 3
|
9391
|
9368
|
&& DET_DL_Shutdown_Off_AlarmTimerCnt[index] >= MBIC_RECOVERY_LAST_SHUTDOWN_MAINTAIN_SEC
|
9392
|
9369
|
&& DL_PathUserHandl[index] == false){
|
9393
|
|
- HAL_GPIO_WritePin(Port,Pin,GPIO_PIN_SET);//CLOCK
|
9394
|
|
- *path = true;
|
9395
|
|
- MainAtten[DL_Shutdown_H] = 0xFF;
|
9396
|
|
- MainAtten[DL_Shutdown_L] = 0xFF;
|
9397
|
|
- PrevMBIC_DL_ShutdownCount[index] = MBIC_DL_ShutdownCount[index];
|
9398
|
|
- CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);
|
|
9370
|
+ HAL_GPIO_WritePin(Port,Pin,GPIO_PIN_SET);//CLOCK
|
|
9371
|
+ *path = true;
|
|
9372
|
+ MainAtten[DL_Shutdown_H] = 0xFF;
|
|
9373
|
+ MainAtten[DL_Shutdown_L] = 0xFF;
|
|
9374
|
+ PrevMBIC_DL_ShutdownCount[index] = MBIC_DL_ShutdownCount[index];
|
|
9375
|
+ CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);
|
9399
|
9376
|
}
|
9400
|
9377
|
if(DET_DL_Shutdown_On_AlarmTimerCnt[index] >= MBIC_ON_SHUTDOWN_MAINTAIN_SEC)
|
9401
|
9378
|
{
|