|
@@ -2,6 +2,7 @@
|
2
|
2
|
#include <stdlib.h>
|
3
|
3
|
#include <stdint.h>
|
4
|
4
|
#include <math.h>
|
|
5
|
+#include <time.h>
|
5
|
6
|
|
6
|
7
|
#include "main.h"
|
7
|
8
|
#include "Bluecell_operate.h"
|
|
@@ -100,6 +101,8 @@ volatile uint8_t Prev_UL_Shutdown_OnOff = 0;
|
100
|
101
|
|
101
|
102
|
|
102
|
103
|
volatile bool timeset_init = false;
|
|
104
|
+uint8_t Last_Day = 0;
|
|
105
|
+uint8_t Prev_Last_Day = 0;
|
103
|
106
|
|
104
|
107
|
/***************************************************************************************/
|
105
|
108
|
/* Function */
|
|
@@ -2673,6 +2676,8 @@ bool Bluecell_Operate(uint8_t* data){
|
2673
|
2676
|
for(int i = 0; i < DLI_FRBT_Time_Index_Max; i++){
|
2674
|
2677
|
PrevFRBT_Day[DLI_FRBT_Time_Year + i] = FRBT_Day[DLI_FRBT_Time_Year + i] = 0;
|
2675
|
2678
|
}
|
|
2679
|
+ Last_Day = 0;
|
|
2680
|
+ Prev_Last_Day = 0;
|
2676
|
2681
|
|
2677
|
2682
|
// FRBT_UserCtrl = 0;
|
2678
|
2683
|
bluecell_Currdatastatus.DLI_FRBT_Status = FRBT_IDEL;
|
|
@@ -3261,7 +3266,8 @@ uint32_t MBIC_DataSend(uint8_t* data){
|
3261
|
3266
|
data[MBIC_PAYLOADSTART + i++] = 0;
|
3262
|
3267
|
}
|
3263
|
3268
|
else if(bluecell_Currdatastatus.Carrier_ON_OFF == false
|
3264
|
|
- || bluecell_Currdatastatus.ALARM_TESTMODE == true){/*Carrier OFF -> Alarm OFF*/
|
|
3269
|
+ || bluecell_Currdatastatus.ALARM_TESTMODE == true)
|
|
3270
|
+ {/*Carrier OFF -> Alarm OFF*/
|
3265
|
3271
|
|
3266
|
3272
|
if(bluecell_Currdatastatus.ALARM_TESTMODE == false){
|
3267
|
3273
|
data[MBIC_PAYLOADSTART + i++] = 0;
|
|
@@ -3270,14 +3276,16 @@ uint32_t MBIC_DataSend(uint8_t* data){
|
3270
|
3276
|
data[MBIC_PAYLOADSTART + i++] = 0;
|
3271
|
3277
|
data[MBIC_PAYLOADSTART + i++] = 0;
|
3272
|
3278
|
}else{
|
3273
|
|
- data[MBIC_PAYLOADSTART + i++] = bluecell_Currdatastatus.ALARM_Test_Dummy1;
|
3274
|
|
- data[MBIC_PAYLOADSTART + i++] = bluecell_Currdatastatus.ALARM_Test_Dummy2;
|
3275
|
|
- data[MBIC_PAYLOADSTART + i++] = bluecell_Currdatastatus.ALARM_Test_Dummy3;
|
3276
|
|
- data[MBIC_PAYLOADSTART + i++] = bluecell_Currdatastatus.ALARM_Test_Dummy4;
|
3277
|
|
- data[MBIC_PAYLOADSTART + i++] = bluecell_Currdatastatus.ALARM_Test_Dummy5;
|
|
3279
|
+ data[MBIC_PAYLOADSTART + i++] = bluecell_Currdatastatus.ALARM_Test_Dummy1 & bluecell_Currdatastatus.ALARM_MASK1;
|
|
3280
|
+ data[MBIC_PAYLOADSTART + i++] = bluecell_Currdatastatus.ALARM_Test_Dummy2 & bluecell_Currdatastatus.ALARM_MASK2;
|
|
3281
|
+ data[MBIC_PAYLOADSTART + i++] = bluecell_Currdatastatus.ALARM_Test_Dummy3 & bluecell_Currdatastatus.ALARM_MASK3;
|
|
3282
|
+ data[MBIC_PAYLOADSTART + i++] = bluecell_Currdatastatus.ALARM_Test_Dummy4 & bluecell_Currdatastatus.ALARM_MASK4;
|
|
3283
|
+ data[MBIC_PAYLOADSTART + i++] = bluecell_Currdatastatus.ALARM_Test_Dummy5 & bluecell_Currdatastatus.ALARM_MASK5;
|
3278
|
3284
|
}
|
3279
|
3285
|
// printf("Alarm Test Mode ON \r\n");
|
3280
|
|
- }else{
|
|
3286
|
+ }
|
|
3287
|
+ else
|
|
3288
|
+ {
|
3281
|
3289
|
if(bluecell_Currdatastatus.ALARM_MASK1 != false)
|
3282
|
3290
|
data[MBIC_PAYLOADSTART + i++] = bluecell_Currdatastatus.ALARM_TEMP_HIGH;
|
3283
|
3291
|
else
|
|
@@ -4603,10 +4611,57 @@ void UL_Path_OnOff(uint8_t Index,uint8_t value,uint8_t* path,uint8_t* PrevAtten,
|
4603
|
4611
|
CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);
|
4604
|
4612
|
|
4605
|
4613
|
}
|
|
4614
|
+uint8_t TimeCalc(){
|
|
4615
|
+ time_t tm_st;
|
|
4616
|
+ time_t tm_nd;
|
|
4617
|
+ int tm_day, tm_hour, tm_min, tm_sec;
|
|
4618
|
+ double d_diff;
|
|
4619
|
+ struct tm user_stime;
|
|
4620
|
+ struct tm user_stime2;
|
|
4621
|
+
|
|
4622
|
+ user_stime.tm_year = (2000 + PrevFRBT_Day[DLI_FRBT_Time_Year]) -1900; // 주의 :년도는 1900년부터 시작
|
|
4623
|
+ user_stime.tm_mon = PrevFRBT_Day[DLI_FRBT_Time_Month] -1; // 주의 :월은 0부터 시작
|
|
4624
|
+ user_stime.tm_mday = PrevFRBT_Day[DLI_FRBT_Time_Day];
|
|
4625
|
+ user_stime.tm_hour = PrevFRBT_Day[DLI_FRBT_Time_Hour];
|
|
4626
|
+ user_stime.tm_min = PrevFRBT_Day[DLI_FRBT_Time_Minute];
|
|
4627
|
+ user_stime.tm_sec = PrevFRBT_Day[DLI_FRBT_Time_Second];
|
|
4628
|
+ user_stime.tm_isdst = 0; // 썸머 타임 사용 안함
|
|
4629
|
+
|
|
4630
|
+ user_stime2.tm_year = (2000 + FRBT_Day[DLI_FRBT_Time_Year]) -1900; // 주의 :년도는 1900년부터 시작
|
|
4631
|
+ user_stime2.tm_mon = FRBT_Day[DLI_FRBT_Time_Month] -1; // 주의 :월은 0부터 시작
|
|
4632
|
+ user_stime2.tm_mday = FRBT_Day[DLI_FRBT_Time_Day];
|
|
4633
|
+ user_stime2.tm_hour = FRBT_Day[DLI_FRBT_Time_Hour];
|
|
4634
|
+ user_stime2.tm_min = FRBT_Day[DLI_FRBT_Time_Minute];
|
|
4635
|
+ user_stime2.tm_sec = FRBT_Day[DLI_FRBT_Time_Second];
|
|
4636
|
+ user_stime2.tm_isdst = 0; // 썸머 타임 사용 안함
|
|
4637
|
+
|
|
4638
|
+
|
|
4639
|
+ tm_st = mktime( &user_stime);
|
|
4640
|
+ tm_nd = mktime( &user_stime2);
|
|
4641
|
+
|
|
4642
|
+ d_diff = difftime( tm_nd, tm_st);
|
|
4643
|
+
|
|
4644
|
+ tm_day = d_diff / ( 60 *60 * 24);
|
|
4645
|
+ d_diff = d_diff - ( tm_day *60 *60 *24);
|
|
4646
|
+
|
|
4647
|
+ tm_hour = d_diff / ( 60 *60);
|
|
4648
|
+ d_diff = d_diff - ( tm_hour *60 *60);
|
|
4649
|
+
|
|
4650
|
+ tm_min = d_diff / 60;
|
|
4651
|
+ d_diff = d_diff - ( tm_min *60);
|
|
4652
|
+
|
|
4653
|
+ tm_sec = d_diff;
|
|
4654
|
+
|
|
4655
|
+// printf( "%d Day %d Hour %d Minute %d Second Bye \n", tm_day, tm_hour, tm_min, tm_sec);
|
|
4656
|
+ return tm_day;
|
|
4657
|
+
|
|
4658
|
+}
|
|
4659
|
+
|
4606
|
4660
|
void TimeSetting(uint8_t* data){
|
4607
|
4661
|
if(bluecell_Currdatastatus.DLI_FRBT_Status == 0)
|
4608
|
4662
|
return;
|
4609
|
|
-
|
|
4663
|
+
|
|
4664
|
+
|
4610
|
4665
|
// printf("DLI_FRBT_Status : %d \r\n",bluecell_Currdatastatus.DLI_FRBT_Status);
|
4611
|
4666
|
// printf("DLI_AGC_ON_OFF : %d \r\n",bluecell_Currdatastatus.DLI_AGC_ON_OFF);
|
4612
|
4667
|
// printf("DLI_FRBT_D_Day : %d \r\n",bluecell_Currdatastatus.DLI_FRBT_D_Day);
|
|
@@ -4618,23 +4673,61 @@ void TimeSetting(uint8_t* data){
|
4618
|
4673
|
FRBT_Day[DLI_FRBT_Time_Year + i] = data[i]; /* Curr day */
|
4619
|
4674
|
}
|
4620
|
4675
|
if(timeset_init == false){
|
4621
|
|
- PrevFRBT_Day[DLI_FRBT_Time_Day] = FRBT_Day[DLI_FRBT_Time_Day];
|
|
4676
|
+// PrevFRBT_Day[DLI_FRBT_Time_Day] = FRBT_Day[DLI_FRBT_Time_Day];
|
|
4677
|
+ for(int i = 0; i < DLI_FRBT_Time_Index_Max; i++){
|
|
4678
|
+ PrevFRBT_Day[DLI_FRBT_Time_Year + i] = FRBT_Day[DLI_FRBT_Time_Year + i]; /* Curr day */
|
|
4679
|
+ }
|
|
4680
|
+
|
4622
|
4681
|
timeset_init = true;
|
|
4682
|
+ Prev_Last_Day = Last_Day = TimeCalc();
|
4623
|
4683
|
return;
|
|
4684
|
+ }else{
|
|
4685
|
+
|
|
4686
|
+ Last_Day = TimeCalc();
|
4624
|
4687
|
}
|
4625
|
|
-// printf("BLUECELL TIME APPLY : %d - %d - %d - %d - %d - %d \r\n",
|
4626
|
|
-// FRBT_Day[DLI_FRBT_Time_Year],
|
4627
|
|
-// FRBT_Day[DLI_FRBT_Time_Month],
|
4628
|
|
-// FRBT_Day[DLI_FRBT_Time_Day],
|
4629
|
|
-// FRBT_Day[DLI_FRBT_Time_Hour],
|
4630
|
|
-// FRBT_Day[DLI_FRBT_Time_Minute],
|
4631
|
|
-// FRBT_Day[DLI_FRBT_Time_Second]);
|
4632
|
|
- if(FRBT_Day[DLI_FRBT_Time_Day] != PrevFRBT_Day[DLI_FRBT_Time_Day]){
|
|
4688
|
+// printf("Last Day : %d Prev Day : %d \r\n",Last_Day,Prev_Last_Day);
|
|
4689
|
+#if 0 // PYJ.2020.11.12_BEGIN --
|
|
4690
|
+ printf("BLUECELL TIME APPLY : %d - %d - %d - %d - %d - %d ",
|
|
4691
|
+ FRBT_Day[DLI_FRBT_Time_Year],
|
|
4692
|
+ FRBT_Day[DLI_FRBT_Time_Month],
|
|
4693
|
+ FRBT_Day[DLI_FRBT_Time_Day],
|
|
4694
|
+ FRBT_Day[DLI_FRBT_Time_Hour],
|
|
4695
|
+ FRBT_Day[DLI_FRBT_Time_Minute],
|
|
4696
|
+ FRBT_Day[DLI_FRBT_Time_Second]);
|
|
4697
|
+
|
|
4698
|
+ printf("/// %d - %d - %d "
|
|
4699
|
+ ,FRBT_Day[DLI_FRBT_Time_Hour] - PrevFRBT_Day[DLI_FRBT_Time_Hour]
|
|
4700
|
+ ,FRBT_Day[DLI_FRBT_Time_Minute] - PrevFRBT_Day[DLI_FRBT_Time_Minute]
|
|
4701
|
+ ,FRBT_Day[DLI_FRBT_Time_Second] - PrevFRBT_Day[DLI_FRBT_Time_Second]);
|
|
4702
|
+
|
|
4703
|
+ printf("\r\n");
|
|
4704
|
+ printf("PREV BLUECELL TIME APPLY : %d - %d - %d - %d - %d - %d \r\n",
|
|
4705
|
+ PrevFRBT_Day[DLI_FRBT_Time_Year],
|
|
4706
|
+ PrevFRBT_Day[DLI_FRBT_Time_Month],
|
|
4707
|
+ PrevFRBT_Day[DLI_FRBT_Time_Day],
|
|
4708
|
+ PrevFRBT_Day[DLI_FRBT_Time_Hour],
|
|
4709
|
+ PrevFRBT_Day[DLI_FRBT_Time_Minute],
|
|
4710
|
+ PrevFRBT_Day[DLI_FRBT_Time_Second]);
|
|
4711
|
+#endif // PYJ.2020.11.12_END --
|
|
4712
|
+#if 0 // PYJ.2020.11.12_BEGIN --
|
|
4713
|
+ if(FRBT_Day[DLI_FRBT_Time_Day] != PrevFRBT_Day[DLI_FRBT_Time_Day]
|
|
4714
|
+// &&FRBT_Day[DLI_FRBT_Time_Hour] >= PrevFRBT_Day[DLI_FRBT_Time_Hour]
|
|
4715
|
+// &&FRBT_Day[DLI_FRBT_Time_Minute] >= PrevFRBT_Day[DLI_FRBT_Time_Minute]
|
|
4716
|
+// &&FRBT_Day[DLI_FRBT_Time_Second] >= PrevFRBT_Day[DLI_FRBT_Time_Second]
|
|
4717
|
+ ){
|
|
4718
|
+#endif // PYJ.2020.11.12_END --
|
|
4719
|
+ if(Last_Day != Prev_Last_Day){
|
|
4720
|
+ if(bluecell_Currdatastatus.DLI_FRBT_D_Day != 0){
|
|
4721
|
+ bluecell_Currdatastatus.DLI_FRBT_D_Day -=(Last_Day - Prev_Last_Day);
|
|
4722
|
+ }
|
|
4723
|
+ Prev_Last_Day = Last_Day;
|
4633
|
4724
|
// printf("FRBT_Day[DLI_FRBT_Time_Day] : %d PrevFRBT_Day[DLI_FRBT_D_Day] : %d \r\n",
|
4634
|
4725
|
// FRBT_Day[DLI_FRBT_Time_Day] ,
|
4635
|
4726
|
// PrevFRBT_Day[DLI_FRBT_Time_Day]);
|
4636
|
4727
|
// FRBT_UserCtrl++;
|
4637
|
|
- bluecell_Currdatastatus.DLI_FRBT_D_Day--;
|
|
4728
|
+// bluecell_Currdatastatus.DLI_FRBT_D_Day--;
|
|
4729
|
+
|
|
4730
|
+
|
4638
|
4731
|
|
4639
|
4732
|
if(bluecell_Currdatastatus.DLI_FRBT_D_Day > 7)
|
4640
|
4733
|
bluecell_Currdatastatus.DLI_FRBT_D_Day = 7;
|
|
@@ -4643,9 +4736,9 @@ void TimeSetting(uint8_t* data){
|
4643
|
4736
|
// printf("D day Plus : %d \r\n",FRBT_UserCtrl);
|
4644
|
4737
|
}
|
4645
|
4738
|
|
4646
|
|
- for(int i = 0; i < DLI_FRBT_Time_Index_Max; i++){
|
4647
|
|
- PrevFRBT_Day[DLI_FRBT_Time_Year + i] = FRBT_Day[DLI_FRBT_Time_Year + i]; /* Curr day */
|
4648
|
|
- }
|
|
4739
|
+// for(int i = 0; i < DLI_FRBT_Time_Index_Max; i++){
|
|
4740
|
+// PrevFRBT_Day[DLI_FRBT_Time_Year + i] = FRBT_Day[DLI_FRBT_Time_Year + i]; /* Curr day */
|
|
4741
|
+// }
|
4649
|
4742
|
// printf("BLUECELL TIME APPLY : %d - %d - %d - %d - %d - %d \r\n",
|
4650
|
4743
|
// PrevFRBT_Day[DLI_FRBT_Time_Year],
|
4651
|
4744
|
// PrevFRBT_Day[DLI_FRBT_Time_Month],
|
|
@@ -5552,6 +5645,10 @@ bool MBIC_Operate(uint8_t* data){
|
5552
|
5645
|
|
5553
|
5646
|
}else{
|
5554
|
5647
|
bluecell_Currdatastatus.DLI_FRBT_Status = FRBT_TRACKING;
|
|
5648
|
+ for(int i = 0; i < DLI_FRBT_Time_Index_Max; i++){
|
|
5649
|
+ PrevFRBT_Day[DLI_FRBT_Time_Year + i] = FRBT_Day[DLI_FRBT_Time_Year + i]; /* Curr day */
|
|
5650
|
+ }
|
|
5651
|
+ Prev_Last_Day = Last_Day = 0;
|
5555
|
5652
|
FRBT_UserCtrl = false;
|
5556
|
5653
|
}
|
5557
|
5654
|
break;
|
|
@@ -5567,6 +5664,8 @@ bool MBIC_Operate(uint8_t* data){
|
5567
|
5664
|
for(int i = 0; i < DLI_FRBT_Time_Index_Max; i++){
|
5568
|
5665
|
PrevFRBT_Day[DLI_FRBT_Time_Year + i] = FRBT_Day[DLI_FRBT_Time_Year + i] = 0;
|
5569
|
5666
|
}
|
|
5667
|
+ Last_Day = 0;
|
|
5668
|
+ Prev_Last_Day = 0;
|
5570
|
5669
|
|
5571
|
5670
|
// FRBT_UserCtrl = 0;
|
5572
|
5671
|
bluecell_Currdatastatus.DLI_FRBT_Status = FRBT_IDEL;
|
|
@@ -6357,14 +6456,15 @@ void DET_LevelAlarmCheck(){
|
6357
|
6456
|
for(int i = 0 ; i < DET_Alarm_DL_Shutdown_Index_MAX; i++){
|
6358
|
6457
|
// if(i != 0) continue;
|
6359
|
6458
|
if( Res_Down_DL_dBm[DET_Alarm_UL1_Index + i] > 0 ){
|
6360
|
|
- if(LimitData_DL_Shutdown <= Res_Down_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i]){
|
|
6459
|
+// if(LimitData_DL_Shutdown <= Res_Down_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i]){
|
|
6460
|
+ if(LimitData_DL_Shutdown < Res_Down_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i]){
|
6361
|
6461
|
// if(DL_Atten[DET_Alarm_DL1_Index + i] * 0.1 <= -15)
|
6362
|
6462
|
ADC_Alarm_DL_Shutdown_Set[DET_Alarm_DL1_Shutdown_Index + i] = true;
|
6363
|
6463
|
// printf("Shutdown On 1\r\n");
|
6364
|
6464
|
}
|
6365
|
6465
|
else{
|
6366
|
|
- if(LimitData_DL_Shutdown - 2 <= Res_Down_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i]
|
6367
|
|
- && MBIC_DL_ShutdownCount[DET_Alarm_DL1_Shutdown_Index ] > 0 )
|
|
6466
|
+ if(LimitData_DL_Shutdown - 2 < Res_Down_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i]
|
|
6467
|
+ && MBIC_DL_ShutdownCount[DET_Alarm_DL1_Shutdown_Index + i] > 0 )
|
6368
|
6468
|
{
|
6369
|
6469
|
ADC_Alarm_DL_Shutdown_Set[DET_Alarm_DL1_Shutdown_Index + i] = true;
|
6370
|
6470
|
// printf("Shutdown On 1_1\r\n");
|
|
@@ -6374,15 +6474,19 @@ void DET_LevelAlarmCheck(){
|
6374
|
6474
|
// printf("Shutdown Off 1\r\n");
|
6375
|
6475
|
}
|
6376
|
6476
|
}
|
6377
|
|
- }else{
|
6378
|
|
- if(LimitData_DL_Shutdown <= Res_Up_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i]){
|
|
6477
|
+ }
|
|
6478
|
+ else
|
|
6479
|
+ {
|
|
6480
|
+// if(LimitData_DL_Shutdown <= Res_Up_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i]){
|
|
6481
|
+ if(LimitData_DL_Shutdown < Res_Down_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i]){
|
|
6482
|
+
|
6379
|
6483
|
// if(DL_Atten[DET_Alarm_DL1_Index + i] * 0.1 <= -15)
|
6380
|
6484
|
ADC_Alarm_DL_Shutdown_Set[DET_Alarm_DL1_Shutdown_Index + i] = true;
|
6381
|
6485
|
// printf("Shutdown On 2\r\n");
|
6382
|
|
- }
|
|
6486
|
+ }
|
6383
|
6487
|
else{
|
6384
|
|
- if(LimitData_DL_Shutdown - 2 <= Res_Up_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i]
|
6385
|
|
- && MBIC_DL_ShutdownCount[DET_Alarm_DL1_Shutdown_Index ] > 0 ){
|
|
6488
|
+ if(LimitData_DL_Shutdown - 2 < Res_Up_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i]
|
|
6489
|
+ && MBIC_DL_ShutdownCount[DET_Alarm_DL1_Shutdown_Index + i] > 0 ){
|
6386
|
6490
|
ADC_Alarm_DL_Shutdown_Set[DET_Alarm_DL1_Shutdown_Index + i] = true;
|
6387
|
6491
|
// printf("Shutdown On 2_1\r\n");
|
6388
|
6492
|
}
|
|
@@ -6394,11 +6498,15 @@ void DET_LevelAlarmCheck(){
|
6394
|
6498
|
|
6395
|
6499
|
}
|
6396
|
6500
|
#if 0 // PYJ.2020.10.23_BEGIN --
|
6397
|
|
- printf("======================================================\r\n");
|
6398
|
|
- printf("Res_Down_DL_dBm : %d \r\n",Res_Down_DL_dBm[DET_Alarm_DL1_Shutdown_Index ]);
|
6399
|
|
- printf("LimitData_DL_Shutdown : %d \r\n",LimitData_DL_Shutdown);
|
6400
|
|
- printf("Res_Up_DL_dBm : %d \r\n",Res_Up_DL_dBm[DET_Alarm_DL1_Shutdown_Index ]);
|
6401
|
|
- HAL_Delay(500);
|
|
6501
|
+ if(i == 3){
|
|
6502
|
+ printf("======================================================\r\n");
|
|
6503
|
+ printf("Res_Down_DL_dBm : %d \r\n",Res_Down_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i ]);
|
|
6504
|
+ printf("Res_Up_DL_dBm : %d \r\n",Res_Up_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i]);
|
|
6505
|
+
|
|
6506
|
+ printf("LimitData_DL_Shutdown : %d \r\n",LimitData_DL_Shutdown);
|
|
6507
|
+ printf("Res_Up_DL_dBm : %d \r\n",Res_Up_DL_dBm[DET_Alarm_DL1_Shutdown_Index + i]);
|
|
6508
|
+ printf("ALARM RESULT : %d \r\n",ADC_Alarm_DL_Shutdown_Set[DET_Alarm_DL1_Shutdown_Index + i]);
|
|
6509
|
+ }
|
6402
|
6510
|
#endif // PYJ.2020.10.23_END --
|
6403
|
6511
|
|
6404
|
6512
|
}
|
|
@@ -8335,19 +8443,23 @@ void ALC_Alarm_TimerSet(uint8_t num,int16_t threshold,double CurrDet,int16_t Att
|
8335
|
8443
|
M_Atten = (MainAtten * 0.1);
|
8336
|
8444
|
// printf("MainAtten : %d \r\n",MainAtten);
|
8337
|
8445
|
CurrAtten = Atten * 0.1; // ALC ATTEN
|
|
8446
|
+
|
8338
|
8447
|
if(CurrAtten + M_Atten >= -18){
|
8339
|
8448
|
ALC_AlarmSet[num] = false;
|
|
8449
|
+// printf("[%d]CurrDet : %f CurrAtten : %02d M_Atten : %d FALSE\r\n",num,CurrDet,CurrAtten,M_Atten);
|
8340
|
8450
|
// printf("Alarm 3 \r\n");
|
8341
|
8451
|
}
|
8342
|
8452
|
else if(threshold <= CurrDet){
|
8343
|
8453
|
ret = (int)CurrDet - threshold ;
|
8344
|
8454
|
ret = Bluecell_TestPro(ret +( CurrAtten * 0.1 * -1));
|
8345
|
8455
|
ret *= -1;
|
8346
|
|
-// printf("CurrDet : %f CurrAtten : %d M_Atten : %d \r\n",CurrDet,CurrAtten,M_Atten);
|
|
8456
|
+// printf("[%d]CurrDet : %f CurrAtten : %02d M_Atten : %d TRUE\r\n",num,CurrDet,CurrAtten,M_Atten);
|
|
8457
|
+
|
8347
|
8458
|
|
8348
|
8459
|
if(CurrAtten + M_Atten <= -20){
|
8349
|
8460
|
if(AlarmStatus[num] == false){
|
8350
|
|
- if(threshold + 0.6 <= CurrDet){
|
|
8461
|
+// if(threshold + 0.6 <= CurrDet){
|
|
8462
|
+ if(threshold <= CurrDet){
|
8351
|
8463
|
ALC_AlarmSet[num] = true;
|
8352
|
8464
|
// printf("Alarm 1 ON \r\n");
|
8353
|
8465
|
}else{
|
|
@@ -8363,6 +8475,12 @@ void ALC_Alarm_TimerSet(uint8_t num,int16_t threshold,double CurrDet,int16_t Att
|
8363
|
8475
|
}
|
8364
|
8476
|
#endif // PYJ.2020.10.19_END --
|
8365
|
8477
|
}
|
|
8478
|
+ else
|
|
8479
|
+ {
|
|
8480
|
+ /*NOP*/
|
|
8481
|
+// printf("[%d]CurrDet : %f CurrAtten : %02d M_Atten : %d | %d |\r\n",num,CurrDet,CurrAtten,M_Atten,ALC_AlarmSet[num]);
|
|
8482
|
+ }
|
|
8483
|
+#if 0 // PYJ.2020.11.12_BEGIN --
|
8366
|
8484
|
else if(threshold -2 > CurrDet){
|
8367
|
8485
|
if(CurrAtten < 0){
|
8368
|
8486
|
ret = (threshold - 2) - CurrDet ;// -27 ///// - 29
|
|
@@ -8372,6 +8490,8 @@ void ALC_Alarm_TimerSet(uint8_t num,int16_t threshold,double CurrDet,int16_t Att
|
8372
|
8490
|
// printf("Alarm 2 \r\n");
|
8373
|
8491
|
}
|
8374
|
8492
|
}
|
|
8493
|
+#endif // PYJ.2020.11.12_END --
|
|
8494
|
+
|
8375
|
8495
|
// printf("threshold : %d \r\n",threshold);
|
8376
|
8496
|
// printf("Curr Atten : %d Main Atten : %d Thre : %d CurrDet : %d \r\n",
|
8377
|
8497
|
// CurrAtten,MainAtten,threshold,CurrDet);
|
|
@@ -8805,10 +8925,16 @@ void AGC_Package_Operate(uint8_t* Threshold,uint8_t* DL_MainAtten,uint8_t Tablei
|
8805
|
8925
|
#if AGC_PRINT // PYJ.2020.10.23_BEGIN --
|
8806
|
8926
|
printf("==================================\r\n");
|
8807
|
8927
|
if(bluecell_Currdatastatus.DLI_FRBT_Status != FRBT_IDEL){
|
8808
|
|
-
|
|
8928
|
+#if 0
|
8809
|
8929
|
bluecell_Currdatastatus.DLI_FRBT_Status = FRBT_IDEL;
|
8810
|
8930
|
bluecell_Currdatastatus.DLI_FRBT_D_Day = 0;
|
8811
|
8931
|
FRBT_UserCtrl_Set(true);
|
|
8932
|
+#else
|
|
8933
|
+ bluecell_Currdatastatus.DLI_FRBT_Status = FRBT_RUNNING;
|
|
8934
|
+ bluecell_Currdatastatus.DLI_FRBT_D_Day = 0;
|
|
8935
|
+ FRBT_UserCtrl_Set(false);
|
|
8936
|
+
|
|
8937
|
+#endif
|
8812
|
8938
|
}
|
8813
|
8939
|
|
8814
|
8940
|
#endif // PYJ.2020.10.23_END --
|
|
@@ -8948,7 +9074,7 @@ void DL_Det_Function(uint8_t Table_Num,uint8_t* CurrADC_Level,DET_TABLEDL_st* DL
|
8948
|
9074
|
#else
|
8949
|
9075
|
ret = AGC_AutoControl_ADC_Compare(ret,&DL_Table->Table_Det5_dBm_H,DL_Table->Table_Length,AGC_Table);
|
8950
|
9076
|
|
8951
|
|
- ret += Temperature_Offset_Get(&Temp_DL1.Table_1_Temp,bluecell_Currdatastatus.DET_TEMP);
|
|
9077
|
+// ret += Temperature_Offset_Get(&Temp_DL1.Table_1_Temp,bluecell_Currdatastatus.DET_TEMP);
|
8952
|
9078
|
if(ret < -25)
|
8953
|
9079
|
ret = -25;
|
8954
|
9080
|
else if(ret > 7)
|
|
@@ -9032,14 +9158,6 @@ void AGC_Function(){//DL
|
9032
|
9158
|
}
|
9033
|
9159
|
// printf("AGC_AlarmSet : %d \r\n",AGC_AlarmSet[AGC_Alarm_DL1_Index+k]);
|
9034
|
9160
|
}
|
9035
|
|
- AGC_Package_Operate(&bluecell_Currdatastatus.DLI_AGC_Threshold_H,
|
9036
|
|
- &bluecell_Currdatastatus.ATT_DL1_H,
|
9037
|
|
- AGC_Alarm_DL1_Index,
|
9038
|
|
- &bluecell_Currdatastatus.DLI_P1_Level1_H,
|
9039
|
|
- &bluecell_Currdatastatus.DLI_Level1_H,
|
9040
|
|
- &Det_DL1.Table_Det5_dBm_H ,
|
9041
|
|
- &bluecell_Currdatastatus.DLI_FRBT_Atten1_H);
|
9042
|
|
-#if (AGC_PRINT == 0)// PYJ.2020.09.15_BEGIN --
|
9043
|
9161
|
AGC_Package_Operate(&bluecell_Currdatastatus.DLI_AGC_Threshold_H,
|
9044
|
9162
|
&bluecell_Currdatastatus.ATT_DL2_H,
|
9045
|
9163
|
AGC_Alarm_DL2_Index,
|
|
@@ -9047,6 +9165,14 @@ void AGC_Function(){//DL
|
9047
|
9165
|
&bluecell_Currdatastatus.DLI_Level2_H,
|
9048
|
9166
|
&Det_DL2.Table_Det5_dBm_H ,
|
9049
|
9167
|
&bluecell_Currdatastatus.DLI_FRBT_Atten2_H);
|
|
9168
|
+#if (AGC_PRINT == 0)// PYJ.2020.09.15_BEGIN --
|
|
9169
|
+ AGC_Package_Operate(&bluecell_Currdatastatus.DLI_AGC_Threshold_H,
|
|
9170
|
+ &bluecell_Currdatastatus.ATT_DL1_H,
|
|
9171
|
+ AGC_Alarm_DL1_Index,
|
|
9172
|
+ &bluecell_Currdatastatus.DLI_P1_Level1_H,
|
|
9173
|
+ &bluecell_Currdatastatus.DLI_Level1_H,
|
|
9174
|
+ &Det_DL1.Table_Det5_dBm_H ,
|
|
9175
|
+ &bluecell_Currdatastatus.DLI_FRBT_Atten1_H);
|
9050
|
9176
|
AGC_Package_Operate(&bluecell_Currdatastatus.DLI_AGC_Threshold_H,
|
9051
|
9177
|
&bluecell_Currdatastatus.ATT_DL3_H,
|
9052
|
9178
|
AGC_Alarm_DL3_Index,
|