|
@@ -3255,28 +3255,6 @@ uint32_t MBIC_DataSend(uint8_t* data){
|
3255
|
3255
|
else
|
3256
|
3256
|
data[MBIC_PAYLOADSTART + i++] = 0;
|
3257
|
3257
|
|
3258
|
|
-#if 0 // PYJ.2020.08.18_BEGIN --
|
3259
|
|
- if(bluecell_Currdatastatus.ALARM_MASK2 != false)
|
3260
|
|
- data[MBIC_PAYLOADSTART + i++] = bluecell_Currdatastatus.ALARM_DLI_Level;
|
3261
|
|
- else
|
3262
|
|
- data[MBIC_PAYLOADSTART + i++] = 0;
|
3263
|
|
-
|
3264
|
|
- if(bluecell_Currdatastatus.ALARM_MASK3 != false)
|
3265
|
|
- data[MBIC_PAYLOADSTART + i++] = (bluecell_Currdatastatus.ALARM_DLI_AGC_Alarm & 0xF0 )
|
3266
|
|
- | (bluecell_Currdatastatus.ALARM_DLI_SHTUTDOWN & 0x0F);
|
3267
|
|
- else
|
3268
|
|
- data[MBIC_PAYLOADSTART + i++] = 0;
|
3269
|
|
- if(bluecell_Currdatastatus.ALARM_MASK4 != false)
|
3270
|
|
- data[MBIC_PAYLOADSTART + i++] = bluecell_Currdatastatus.ALARM_ULO_Level;
|
3271
|
|
- else
|
3272
|
|
- data[MBIC_PAYLOADSTART + i++] = 0;
|
3273
|
|
-
|
3274
|
|
- if(bluecell_Currdatastatus.ALARM_MASK5 != false)
|
3275
|
|
- data[MBIC_PAYLOADSTART + i++] = (bluecell_Currdatastatus.ALARM_ULO_ALC_Alarm & 0xF0)
|
3276
|
|
- |(bluecell_Currdatastatus.ALARM_ULO_SHTUTDOWN & 0x0F);
|
3277
|
|
- else
|
3278
|
|
- data[MBIC_PAYLOADSTART + i++] = 0;
|
3279
|
|
-#else
|
3280
|
3258
|
// printf("bluecell_Currdatastatus.ALARM_DLI_Level : %x \r\n",bluecell_Currdatastatus.ALARM_DLI_Level);
|
3281
|
3259
|
// printf("bluecell_Currdatastatus.ALARM_DLI_AGC_Alarm : %x \r\n",bluecell_Currdatastatus.ALARM_DLI_AGC_Alarm);
|
3282
|
3260
|
// printf("bluecell_Currdatastatus.ALARM_DLI_SHTUTDOWN : %x \r\n",bluecell_Currdatastatus.ALARM_DLI_SHTUTDOWN);
|
|
@@ -3486,7 +3464,6 @@ uint32_t MBIC_DataSend(uint8_t* data){
|
3486
|
3464
|
}
|
3487
|
3465
|
|
3488
|
3466
|
|
3489
|
|
-#endif // PYJ.2020.08.18_END --
|
3490
|
3467
|
}
|
3491
|
3468
|
/*ALARM BIT MASK*/
|
3492
|
3469
|
data[MBIC_PAYLOADSTART + i++] = MBIC_AID;
|
|
@@ -4572,6 +4549,9 @@ void Factory_Set(){
|
4572
|
4549
|
|
4573
|
4550
|
}
|
4574
|
4551
|
|
|
4552
|
+
|
|
4553
|
+/*When using the shutdown function, you should never use this function to turn onoff
|
|
4554
|
+Because this function initializes Shutdown related Count and alarm.*/
|
4575
|
4555
|
void DL_Path_OnOff(uint8_t Index,uint8_t value,uint8_t* path,uint8_t* PrevAtten,uint8_t* retrycnt,uint8_t* PrevRetryCnt){
|
4576
|
4556
|
GPIO_TypeDef *Port = 0;
|
4577
|
4557
|
uint16_t Pin = 0;
|
|
@@ -4580,21 +4560,27 @@ void DL_Path_OnOff(uint8_t Index,uint8_t value,uint8_t* path,uint8_t* PrevAtten,
|
4580
|
4560
|
Port = PATH_EN_DL1_GPIO_Port;
|
4581
|
4561
|
Pin = PATH_EN_DL1_Pin;
|
4582
|
4562
|
bluecell_Currdatastatus.DLI_Shutdown_Alarm1 = false;
|
|
4563
|
+ bluecell_Currdatastatus.ALARM_DLI_SHTUTDOWN &= ~ALARM_DLI_SHUTDOWN_P1;
|
4583
|
4564
|
break;
|
4584
|
4565
|
case Path2_OnOff:
|
4585
|
4566
|
Port = PATH_EN_DL2_GPIO_Port;
|
4586
|
4567
|
Pin = PATH_EN_DL2_Pin;
|
4587
|
4568
|
bluecell_Currdatastatus.DLI_Shutdown_Alarm2 = false;
|
|
4569
|
+ bluecell_Currdatastatus.ALARM_DLI_SHTUTDOWN &= ~ALARM_DLI_SHUTDOWN_P2;
|
4588
|
4570
|
break;
|
4589
|
4571
|
case Path3_OnOff:
|
4590
|
4572
|
Port = PATH_EN_DL3_GPIO_Port;
|
4591
|
4573
|
Pin = PATH_EN_DL3_Pin;
|
4592
|
4574
|
bluecell_Currdatastatus.DLI_Shutdown_Alarm3 = false;
|
|
4575
|
+ bluecell_Currdatastatus.ALARM_DLI_SHTUTDOWN &= ~ALARM_DLI_SHUTDOWN_P3;
|
|
4576
|
+
|
4593
|
4577
|
break;
|
4594
|
4578
|
case Path4_OnOff:
|
4595
|
4579
|
Port = PATH_EN_DL4_GPIO_Port;
|
4596
|
4580
|
Pin = PATH_EN_DL4_Pin;
|
4597
|
4581
|
bluecell_Currdatastatus.DLI_Shutdown_Alarm4 = false;
|
|
4582
|
+ bluecell_Currdatastatus.ALARM_DLI_SHTUTDOWN &= ~ALARM_DLI_SHUTDOWN_P4;
|
|
4583
|
+
|
4598
|
4584
|
break;
|
4599
|
4585
|
}
|
4600
|
4586
|
*path = value;
|
|
@@ -4613,6 +4599,9 @@ void DL_Path_OnOff(uint8_t Index,uint8_t value,uint8_t* path,uint8_t* PrevAtten,
|
4613
|
4599
|
CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);
|
4614
|
4600
|
|
4615
|
4601
|
}
|
|
4602
|
+/*When using the shutdown function, you should never use this function to turn onoff
|
|
4603
|
+Because this function initializes Shutdown related Count and alarm.*/
|
|
4604
|
+
|
4616
|
4605
|
void UL_Path_OnOff(uint8_t Index,uint8_t value,uint8_t* path,uint8_t* PrevAtten,uint8_t* retrycnt,uint8_t* PrevRetryCnt){
|
4617
|
4606
|
GPIO_TypeDef *Port = 0;
|
4618
|
4607
|
uint16_t Pin = 0;
|
|
@@ -4622,21 +4611,25 @@ void UL_Path_OnOff(uint8_t Index,uint8_t value,uint8_t* path,uint8_t* PrevAtten,
|
4622
|
4611
|
Port = PATH_EN_UL1_GPIO_Port;
|
4623
|
4612
|
Pin = PATH_EN_UL1_Pin;
|
4624
|
4613
|
bluecell_Currdatastatus.ULO_Shutdown_Alarm1 = false;
|
|
4614
|
+ bluecell_Currdatastatus.ALARM_ULO_SHTUTDOWN &= ~ALARM_ULO_SHUTDOWN_P1;
|
4625
|
4615
|
break;
|
4626
|
4616
|
case Path2_OnOff:
|
4627
|
4617
|
Port = PATH_EN_UL2_GPIO_Port;
|
4628
|
4618
|
Pin = PATH_EN_UL2_Pin;
|
4629
|
4619
|
bluecell_Currdatastatus.ULO_Shutdown_Alarm2 = false;
|
|
4620
|
+ bluecell_Currdatastatus.ALARM_ULO_SHTUTDOWN &= ~ALARM_ULO_SHUTDOWN_P2;
|
4630
|
4621
|
break;
|
4631
|
4622
|
case Path3_OnOff:
|
4632
|
4623
|
Port = PATH_EN_UL3_GPIO_Port;
|
4633
|
4624
|
Pin = PATH_EN_UL3_Pin;
|
4634
|
4625
|
bluecell_Currdatastatus.ULO_Shutdown_Alarm3 = false;
|
|
4626
|
+ bluecell_Currdatastatus.ALARM_ULO_SHTUTDOWN &= ~ALARM_ULO_SHUTDOWN_P3;
|
4635
|
4627
|
break;
|
4636
|
4628
|
case Path4_OnOff:
|
4637
|
4629
|
Port = PATH_EN_UL4_GPIO_Port;
|
4638
|
4630
|
Pin = PATH_EN_UL4_Pin;
|
4639
|
4631
|
bluecell_Currdatastatus.ULO_Shutdown_Alarm4 = false;
|
|
4632
|
+ bluecell_Currdatastatus.ALARM_ULO_SHTUTDOWN &= ~ALARM_ULO_SHUTDOWN_P4;
|
4640
|
4633
|
break;
|
4641
|
4634
|
}
|
4642
|
4635
|
*path = value;
|
|
@@ -6316,6 +6309,11 @@ void DET_LevelAlarmCheck(){
|
6316
|
6309
|
}
|
6317
|
6310
|
Res_DL_dBm[DET_Alarm_DL1_Index + i] *= 0.1;
|
6318
|
6311
|
#else
|
|
6312
|
+// if(i == 2){
|
|
6313
|
+// printf("======================================================\r\n");
|
|
6314
|
+// printf("Res_Down_DL_dBm[DET_Alarm_DL1_Index + i] : %d \r\n",Res_Down_DL_dBm[DET_Alarm_DL1_Index + i]);
|
|
6315
|
+// }
|
|
6316
|
+
|
6319
|
6317
|
Res_Up_DL_dBm[DET_Alarm_DL1_Index + i] = Res_Down_DL_dBm[DET_Alarm_DL1_Index + i];
|
6320
|
6318
|
if(Res_Up_DL_dBm[DET_Alarm_DL1_Index + i] < 0)
|
6321
|
6319
|
Res_Up_DL_dBm[DET_Alarm_DL1_Index + i] -= 9;
|
|
@@ -6324,6 +6322,7 @@ void DET_LevelAlarmCheck(){
|
6324
|
6322
|
|
6325
|
6323
|
Res_Down_DL_dBm[DET_Alarm_DL1_Index + i] *= 0.1; // down
|
6326
|
6324
|
Res_Up_DL_dBm[DET_Alarm_DL1_Index + i] *= 0.1; // Round
|
|
6325
|
+
|
6327
|
6326
|
|
6328
|
6327
|
|
6329
|
6328
|
|
|
@@ -6525,13 +6524,18 @@ void DET_LevelAlarmCheck(){
|
6525
|
6524
|
// printf("1Res_Down_DL_dBm : %d \r\n",Res_Down_DL_dBm[DET_Alarm_DL1_Shutdown_Index ]);
|
6526
|
6525
|
// }
|
6527
|
6526
|
ADC_Alarm_DL_Shutdown_Set[DET_Alarm_DL1_Shutdown_Index + i] = true;
|
6528
|
|
-// printf("Shutdown On 1\r\n");
|
|
6527
|
+// if(i == 2){
|
|
6528
|
+//// printf("Shutdown On 1\r\n");
|
|
6529
|
+// }
|
6529
|
6530
|
}
|
6530
|
6531
|
else{
|
6531
|
6532
|
if(LimitData_DL_Shutdown - 2 < Res_Down_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i]
|
6532
|
6533
|
&& MBIC_DL_ShutdownCount[DET_Alarm_DL1_Shutdown_Index + i] > 0 )
|
6533
|
6534
|
{
|
6534
|
6535
|
ADC_Alarm_DL_Shutdown_Set[DET_Alarm_DL1_Shutdown_Index + i] = true;
|
|
6536
|
+// if(i == 2){
|
|
6537
|
+//// printf("Shutdown On 1_2\r\n");
|
|
6538
|
+// }
|
6535
|
6539
|
// if(i == 0){
|
6536
|
6540
|
// printf("2Res_Down_DL_dBm : %d \r\n",Res_Down_DL_dBm[DET_Alarm_DL1_Shutdown_Index ]);
|
6537
|
6541
|
// }
|
|
@@ -6549,6 +6553,9 @@ void DET_LevelAlarmCheck(){
|
6549
|
6553
|
if(LimitData_DL_Shutdown < Res_Down_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i]){
|
6550
|
6554
|
// if(DL_Atten[DET_Alarm_DL1_Index + i] * 0.1 <= -15)
|
6551
|
6555
|
ADC_Alarm_DL_Shutdown_Set[DET_Alarm_DL1_Shutdown_Index + i] = true;
|
|
6556
|
+// if(i == 2){
|
|
6557
|
+//// printf("Shutdown On 2_1\r\n");
|
|
6558
|
+// }
|
6552
|
6559
|
// printf("3Res_Down_DL_dBm : %d \r\n",Res_Down_DL_dBm[DET_Alarm_DL1_Shutdown_Index ]);
|
6553
|
6560
|
// printf("Shutdown On 2\r\n");
|
6554
|
6561
|
}
|
|
@@ -6557,21 +6564,33 @@ void DET_LevelAlarmCheck(){
|
6557
|
6564
|
&& MBIC_DL_ShutdownCount[DET_Alarm_DL1_Shutdown_Index + i] > 0 ){
|
6558
|
6565
|
// printf("4Res_Down_DL_dBm : %d \r\n",Res_Down_DL_dBm[DET_Alarm_DL1_Shutdown_Index ]);
|
6559
|
6566
|
ADC_Alarm_DL_Shutdown_Set[DET_Alarm_DL1_Shutdown_Index + i] = true;
|
6560
|
|
- // printf("Shutdown On 2_1\r\n");
|
|
6567
|
+// printf("Shutdown On 2_2\r\n");
|
6561
|
6568
|
}
|
|
6569
|
+ else if(MBIC_DL_ShutdownCount[DET_Alarm_DL1_Shutdown_Index + i] > 0
|
|
6570
|
+ && LimitData_DL_Shutdown - 2 < Res_Down_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i]){
|
|
6571
|
+ ADC_Alarm_DL_Shutdown_Set[DET_Alarm_DL1_Shutdown_Index + i] = true;
|
|
6572
|
+// if(i == 2){
|
|
6573
|
+//// printf("Shutdown On 2_3\r\n");
|
|
6574
|
+// }
|
|
6575
|
+ }
|
6562
|
6576
|
else if(MBIC_DL_ShutdownCount[DET_Alarm_DL1_Shutdown_Index + i] > 0){
|
6563
|
6577
|
ADC_Alarm_DL_Shutdown_Set[DET_Alarm_DL1_Shutdown_Index + i] = false;
|
6564
|
|
- // printf("Shutdown Off 2\r\n");
|
|
6578
|
+// if(i == 2){
|
|
6579
|
+//// printf("Shutdown Off 2\r\n");
|
|
6580
|
+// }
|
6565
|
6581
|
}
|
6566
|
6582
|
else if(MBIC_DL_ShutdownCount[DET_Alarm_DL1_Shutdown_Index + i] == 0
|
6567
|
6583
|
&& LimitData_DL_Shutdown > Res_Up_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i]){
|
6568
|
6584
|
ADC_Alarm_DL_Shutdown_Set[DET_Alarm_DL1_Shutdown_Index + i] = false;
|
|
6585
|
+// if(i == 2){
|
|
6586
|
+//// printf("Shutdown Off 3\r\n");
|
|
6587
|
+// }
|
6569
|
6588
|
}
|
6570
|
6589
|
}
|
6571
|
6590
|
|
6572
|
6591
|
}
|
6573
|
6592
|
#if 0 // PYJ.2020.10.23_BEGIN --
|
6574
|
|
- if(i == 3){
|
|
6593
|
+ if(i == 2){
|
6575
|
6594
|
printf("======================================================\r\n");
|
6576
|
6595
|
printf("Res_Down_DL_dBm : %d \r\n",Res_Down_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i ]);
|
6577
|
6596
|
printf("Res_Up_DL_dBm : %d \r\n",Res_Up_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i]);
|
|
@@ -9502,7 +9521,8 @@ void DL_Shutdown_Operate(uint8_t index,uint8_t* path,uint8_t* retrycnt,uint8_t*
|
9502
|
9521
|
if(DET_DL_Shutdown_Off_AlarmTimerCnt[index] >= MBIC_OFF_MAINTAIN_SEC
|
9503
|
9522
|
&& (*retrycnt) != RETRYCNT_MAX){
|
9504
|
9523
|
bluecell_Currdatastatus.ALARM_DLI_SHTUTDOWN &= ~AlarmFlag;
|
9505
|
|
- *ShutdownAlarm = false;
|
|
9524
|
+ *ShutdownAlarm = false;
|
|
9525
|
+
|
9506
|
9526
|
}
|
9507
|
9527
|
}
|
9508
|
9528
|
if((*retrycnt) >= 1){
|
|
@@ -9618,7 +9638,7 @@ void UL_Shutdown_Operate(uint8_t Index,uint8_t* Path,uint8_t* PrevATT,uint8_t* R
|
9618
|
9638
|
if(DET_UL_Shutdown_Off_AlarmTimerCnt[Index] >= MBIC_OFF_MAINTAIN_SEC
|
9619
|
9639
|
&& (*RetryCnt) != RETRYCNT_MAX){
|
9620
|
9640
|
bluecell_Currdatastatus.ALARM_ULO_SHTUTDOWN &= ~AlarmFlag;
|
9621
|
|
- *ShutdownAlarm = false;
|
|
9641
|
+ *ShutdownAlarm = false;
|
9622
|
9642
|
}
|
9623
|
9643
|
}
|
9624
|
9644
|
if((*RetryCnt) >= 1){
|