|
@@ -93,6 +93,8 @@ extern uint8_t Led_ToggleCntSet;
|
93
|
93
|
|
94
|
94
|
|
95
|
95
|
extern volatile uint32_t SelfTestLifeCnt;
|
|
96
|
+volatile uint8_t Prev_ALC_OnOff = 0;
|
|
97
|
+volatile uint8_t Prev_AGC_OnOff = 0;
|
96
|
98
|
|
97
|
99
|
/***************************************************************************************/
|
98
|
100
|
/* Function */
|
|
@@ -110,7 +112,7 @@ void ALC_Alarm_TimerSet(uint8_t num,int16_t threshold,int16_t CurrDet,int16_t Cu
|
110
|
112
|
void Carrier_ONOFF(uint8_t val);
|
111
|
113
|
void DL_Path_OnOff(uint8_t Index,uint8_t value,uint8_t* path,uint8_t* PrevAtten,uint8_t* retrycnt,uint8_t* PrevRetryCnt);
|
112
|
114
|
void Factory_Set();
|
113
|
|
-void SelfTest_Ctrl(uint8_t num,uint8_t val,uint8_t* selftest,uint8_t* DL_Atten,uint8_t* UL_Atten,uint8_t* Prev_DL_Atten,uint8_t* Prev_UL_Atten);
|
|
115
|
+void SelfTest_Ctrl(uint8_t num,uint8_t val,uint8_t* selftest,uint8_t* DL_Atten,uint8_t* UL_Atten,uint8_t* Prev_DL_Atten,uint8_t* Prev_UL_Atten,uint8_t* ALC_Atten,uint8_t* Prev_ALC_Atten);
|
114
|
116
|
void TimeSetting(uint8_t* data);
|
115
|
117
|
void Temp_Shutdown_ONOFF(uint8_t val);
|
116
|
118
|
|
|
@@ -121,68 +123,6 @@ int16_t Temperature_Offset_Get(int8_t* Temp_Table,int8_t CurrTemp);
|
121
|
123
|
/* Valuable */
|
122
|
124
|
/***************************************************************************************/
|
123
|
125
|
|
124
|
|
-#define ALAMASK_DEFAULT 1
|
125
|
|
-#define Temp_THREADHOLD_DEFAULT 80
|
126
|
|
-#define CARRIER_DEFAULT 1
|
127
|
|
-#define DLI_PATH_DEFAULT
|
128
|
|
-#define DLI_GAIN_ATT_DEFAULT 0
|
129
|
|
-#define ULO_GAIN_ATT_DEFAULT -200
|
130
|
|
-
|
131
|
|
-#define TEMP_OFFSET_DEFAULT 0
|
132
|
|
-#define CARRIER_ONOF_DEFAULT 1
|
133
|
|
-#define PATH_DEFAULT true
|
134
|
|
-#define DLI_ATTEN_DEFAULT 0
|
135
|
|
-#define ULO_ATTEN_DEFAULT 0
|
136
|
|
-
|
137
|
|
-#define ATTEN_OFFSET_DEFAULT -30
|
138
|
|
-#define DLI_ATTEN_HIGHTHREADHOLD_DEFAULT 60
|
139
|
|
-#define DLI_ATTEN_LOWTHREADHOLD_DEFAULT -250
|
140
|
|
-#define DLI_FRBT_DAY_DEFAULT 7
|
141
|
|
-#define DLI_FRBT_ATTEN_DEFALUT 0 ;
|
142
|
|
-#define DLI_AGC_ONOFF_DEFAULT true
|
143
|
|
-#define DLI_AGC_THREADHOLD_DEFAULT -100
|
144
|
|
-#define DLI_SHUTDOWN_ONOFF_DEFAULT true
|
145
|
|
-#define DLI_SHUTDOWN_THREADHOLD_DEFAULT 70
|
146
|
|
-#define ULO_LEVEL_HIGH_THREADHOLD_DEFAULT -190
|
147
|
|
-#define SELFTEST_DEFALULT_DEFAULT false
|
148
|
|
-#define ULO_ALC_ONOFF_DEFAULT true
|
149
|
|
-#define ULO_ALC_THREADHOLD_DEFAULT -200
|
150
|
|
-#define ULO_SHUTDOWN_ONOFF_DEFAULT true
|
151
|
|
-#define ULO_SHUTDOWN_THREADHOLD_DEFAULT -180
|
152
|
|
-
|
153
|
|
-#define TableDataSetting_ATT_DL_LEVEL_STEP -1
|
154
|
|
-#define TableDataSetting_ATT_UL_LEVEL_STEP -1
|
155
|
|
-#define MBIC_AID 0xE0
|
156
|
|
-
|
157
|
|
-#define Temp_High 0xE014
|
158
|
|
-#define DLI_P4_Level_Low 0xE043
|
159
|
|
-#define DLI_P3_Level_Low 0xE042
|
160
|
|
-#define DLI_P2_Level_Low 0xE041
|
161
|
|
-#define DLI_P1_Level_Low 0xE040
|
162
|
|
-#define DLI_P4_Level_High 0xE047
|
163
|
|
-#define DLI_P3_Level_High 0xE046
|
164
|
|
-#define DLI_P2_Level_High 0xE045
|
165
|
|
-#define DLI_P1_Level_High 0xE044
|
166
|
|
-#define DLI_P4_AGC_Alarm 0xE05A
|
167
|
|
-#define DLI_P3_AGC_Alarm 0xE059
|
168
|
|
-#define DLI_P2_AGC_Alarm 0xE058
|
169
|
|
-#define DLI_P1_AGC_Alarm 0xE057
|
170
|
|
-#define DLI_P4_Shutdown_Alarm 0xE05E
|
171
|
|
-#define DLI_P3_Shutdown_Alarm 0xE05D
|
172
|
|
-#define DLI_P2_Shutdown_Alarm 0xE05C
|
173
|
|
-#define DLI_P1_Shutdown_Alarm 0xE05B
|
174
|
|
-#define ULO_P4_Level_High 0xE073
|
175
|
|
-#define ULO_P3_Level_High 0xE072
|
176
|
|
-#define ULO_P2_Level_High 0xE071
|
177
|
|
-#define ULO_P1_Level_High 0xE070
|
178
|
|
-#define ULO_P4_ALC_Alarm 0xE08A
|
179
|
|
-#define ULO_P3_ALC_Alarm 0xE089
|
180
|
|
-#define ULO_P2_ALC_Alarm 0xE088
|
181
|
|
-#define ULO_P1_ALC_Alarm 0xE087
|
182
|
|
-#define ULO_P4_Shutdown 0xE08E
|
183
|
|
-#define ULO_P3_Shutdown 0xE08D
|
184
|
|
-#define ULO_P2_Shutdown 0xE08C
|
185
|
|
-#define ULO_P1_Shutdown 0xE08B
|
186
|
126
|
|
187
|
127
|
|
188
|
128
|
int8_t DL_DET_Table_ref[AGC_Table_DL_Ref_Index_MAX][TABLE_LENGTH_MAX];
|
|
@@ -196,7 +136,7 @@ bool UL_ALC_GainAttenSet[ALC_Alarm_UL_Index_MAX];
|
196
|
136
|
int16_t ALC_Level_Save[ALC_Alarm_UL_Index_MAX];
|
197
|
137
|
bool Initialize;
|
198
|
138
|
bool AGC_AlarmSet[AGC_Alarm_DL_Index_MAX];
|
199
|
|
-uint8_t FRBT_Day_Inc;
|
|
139
|
+uint8_t FRBT_UserCtrl = 0;
|
200
|
140
|
uint16_t ADC3Ret[5];
|
201
|
141
|
volatile uint8_t LED_TestCnt = 0;
|
202
|
142
|
uint8_t TxData[2048];
|
|
@@ -250,11 +190,7 @@ volatile uint8_t StartTimeFRBT_Day[6] = {0,}; /*Start day Register*/
|
250
|
190
|
uint8_t FRBT_Day[6] = {0,}; /*Curr day Register*/
|
251
|
191
|
uint8_t PrevFRBT_Day[6] = {0,}; /*Prev day Register*/
|
252
|
192
|
|
253
|
|
-typedef enum{
|
254
|
|
- FRBT_IDEL = 0,
|
255
|
|
- FRBT_TRACKING,
|
256
|
|
- FRBT_RUNNING,
|
257
|
|
-}FRBT_Status_I;
|
|
193
|
+
|
258
|
194
|
typedef enum{
|
259
|
195
|
Path1_OnOff = 0,
|
260
|
196
|
Path2_OnOff,
|
|
@@ -361,6 +297,12 @@ void Boot_LED_Toggle(void){
|
361
|
297
|
|
362
|
298
|
}
|
363
|
299
|
|
|
300
|
+void FRBT_UserCtrl_Set(uint8_t set){
|
|
301
|
+ FRBT_UserCtrl = set;
|
|
302
|
+}
|
|
303
|
+uint8_t FRBT_UserCtrl_Get(){
|
|
304
|
+ return FRBT_UserCtrl;
|
|
305
|
+}
|
364
|
306
|
|
365
|
307
|
|
366
|
308
|
|
|
@@ -2167,10 +2109,20 @@ bool Bluecell_Operate(uint8_t* data){
|
2167
|
2109
|
break;
|
2168
|
2110
|
case ATT_SelfTest :
|
2169
|
2111
|
// printf("SelfTest %d \r\n ",data[BLUECELL_DATA]);
|
2170
|
|
- SelfTest_Ctrl(SelfTest1,data[BLUECELL_DATA],&bluecell_Currdatastatus.SelfTest,&bluecell_Currdatastatus.ATT_DL1_H,&bluecell_Currdatastatus.ATT_UL1_H,&bluecell_Currdatastatus.SelfTest_ATT_DL1_H,&bluecell_Currdatastatus.SelfTest_ATT_UL1_H);
|
2171
|
|
- SelfTest_Ctrl(SelfTest2,data[BLUECELL_DATA],&bluecell_Currdatastatus.SelfTest,&bluecell_Currdatastatus.ATT_DL2_H,&bluecell_Currdatastatus.ATT_UL2_H,&bluecell_Currdatastatus.SelfTest_ATT_DL2_H,&bluecell_Currdatastatus.SelfTest_ATT_UL2_H);
|
2172
|
|
- SelfTest_Ctrl(SelfTest3,data[BLUECELL_DATA],&bluecell_Currdatastatus.SelfTest,&bluecell_Currdatastatus.ATT_DL3_H,&bluecell_Currdatastatus.ATT_UL3_H,&bluecell_Currdatastatus.SelfTest_ATT_DL3_H,&bluecell_Currdatastatus.SelfTest_ATT_UL3_H);
|
2173
|
|
- SelfTest_Ctrl(SelfTest4,data[BLUECELL_DATA],&bluecell_Currdatastatus.SelfTest,&bluecell_Currdatastatus.ATT_DL4_H,&bluecell_Currdatastatus.ATT_UL4_H,&bluecell_Currdatastatus.SelfTest_ATT_DL4_H,&bluecell_Currdatastatus.SelfTest_ATT_UL4_H);
|
|
2112
|
+ SelfTest_Ctrl(SelfTest1,data[BLUECELL_DATA],&bluecell_Currdatastatus.SelfTest,&bluecell_Currdatastatus.ATT_DL1_H,&bluecell_Currdatastatus.ATT_UL1_H,&bluecell_Currdatastatus.SelfTest_ATT_DL1_H,&bluecell_Currdatastatus.SelfTest_ATT_UL1_H,&bluecell_Currdatastatus.MBIC_ULO_ALC_Atten1_H,&bluecell_Currdatastatus.Prev_ATT_ALC1_H);
|
|
2113
|
+ SelfTest_Ctrl(SelfTest2,data[BLUECELL_DATA],&bluecell_Currdatastatus.SelfTest,&bluecell_Currdatastatus.ATT_DL2_H,&bluecell_Currdatastatus.ATT_UL2_H,&bluecell_Currdatastatus.SelfTest_ATT_DL2_H,&bluecell_Currdatastatus.SelfTest_ATT_UL2_H,&bluecell_Currdatastatus.MBIC_ULO_ALC_Atten2_H,&bluecell_Currdatastatus.Prev_ATT_ALC2_H);
|
|
2114
|
+ SelfTest_Ctrl(SelfTest3,data[BLUECELL_DATA],&bluecell_Currdatastatus.SelfTest,&bluecell_Currdatastatus.ATT_DL3_H,&bluecell_Currdatastatus.ATT_UL3_H,&bluecell_Currdatastatus.SelfTest_ATT_DL3_H,&bluecell_Currdatastatus.SelfTest_ATT_UL3_H,&bluecell_Currdatastatus.MBIC_ULO_ALC_Atten3_H,&bluecell_Currdatastatus.Prev_ATT_ALC3_H);
|
|
2115
|
+ SelfTest_Ctrl(SelfTest4,data[BLUECELL_DATA],&bluecell_Currdatastatus.SelfTest,&bluecell_Currdatastatus.ATT_DL4_H,&bluecell_Currdatastatus.ATT_UL4_H,&bluecell_Currdatastatus.SelfTest_ATT_DL4_H,&bluecell_Currdatastatus.SelfTest_ATT_UL4_H,&bluecell_Currdatastatus.MBIC_ULO_ALC_Atten4_H,&bluecell_Currdatastatus.Prev_ATT_ALC4_H);
|
|
2116
|
+ HAL_Delay(500);
|
|
2117
|
+ if(bluecell_Currdatastatus.SelfTest == true){
|
|
2118
|
+ Prev_ALC_OnOff = bluecell_Currdatastatus.ULO_ALC_ON_OFF;
|
|
2119
|
+ Prev_AGC_OnOff = bluecell_Currdatastatus.DLI_AGC_ON_OFF;
|
|
2120
|
+ bluecell_Currdatastatus.DLI_AGC_ON_OFF = false;
|
|
2121
|
+ bluecell_Currdatastatus.ULO_ALC_ON_OFF = false;
|
|
2122
|
+ }else{
|
|
2123
|
+ bluecell_Currdatastatus.ULO_ALC_ON_OFF = Prev_ALC_OnOff;
|
|
2124
|
+ bluecell_Currdatastatus.DLI_AGC_ON_OFF = Prev_AGC_OnOff;
|
|
2125
|
+ }
|
2174
|
2126
|
#if 0 // PYJ.2020.09.03_BEGIN --
|
2175
|
2127
|
if(bluecell_Currdatastatus.SelfTest == false && bluecell_Currdatastatus.SelfTest != data[BLUECELL_DATA]){
|
2176
|
2128
|
bluecell_Currdatastatus.SelfTest_ATT_DL1_H = bluecell_Currdatastatus.ATT_DL1_H;
|
|
@@ -2853,13 +2805,13 @@ bool Bluecell_Operate(uint8_t* data){
|
2853
|
2805
|
// FRBT_Day[DLI_FRBT_Time_Day] ,
|
2854
|
2806
|
// PrevFRBT_Day[DLI_FRBT_Time_Day]);
|
2855
|
2807
|
#if 1 // PYJ.2020.07.02_BEGIN --
|
2856
|
|
- FRBT_Day_Inc++;
|
|
2808
|
+ FRBT_UserCtrl++;
|
2857
|
2809
|
bluecell_Currdatastatus.DLI_FRBT_Status = FRBT_TRACKING;
|
2858
|
2810
|
#else
|
2859
|
2811
|
bluecell_Currdatastatus.DLI_FRBT_D_Day = 7;
|
2860
|
2812
|
bluecell_Currdatastatus.DLI_FRBT_Status = FRBT_TRACKING;
|
2861
|
2813
|
#endif // PYJ.2020.07.02_END --
|
2862
|
|
- printf("D day Plus : %d \r\n",FRBT_Day_Inc);
|
|
2814
|
+ printf("D day Plus : %d \r\n",FRBT_UserCtrl);
|
2863
|
2815
|
}
|
2864
|
2816
|
|
2865
|
2817
|
for(int i = 0; i < DLI_FRBT_Time_Index_Max; i++){
|
|
@@ -2912,6 +2864,17 @@ bool Bluecell_Operate(uint8_t* data){
|
2912
|
2864
|
bluecell_Currdatastatus.Manufacture_Date[i] = data[BLUECELL_DATA + i];
|
2913
|
2865
|
}
|
2914
|
2866
|
break;
|
|
2867
|
+ case Bluecell_FRBT_DaySetting:
|
|
2868
|
+ bluecell_Currdatastatus.DLI_FRBT_D_Day = data[BLUECELL_DATA + 1];
|
|
2869
|
+ if(bluecell_Currdatastatus.DLI_FRBT_D_Day == 0){
|
|
2870
|
+ FRBT_UserCtrl = true;
|
|
2871
|
+ bluecell_Currdatastatus.DLI_FRBT_Status = FRBT_IDEL;
|
|
2872
|
+
|
|
2873
|
+ }else{
|
|
2874
|
+ bluecell_Currdatastatus.DLI_FRBT_Status = FRBT_TRACKING;
|
|
2875
|
+ FRBT_UserCtrl = false;
|
|
2876
|
+ }
|
|
2877
|
+ break;
|
2915
|
2878
|
#if 0 // PYJ.2020.09.03_BEGIN --
|
2916
|
2879
|
case Bluecell_DL_Det_ALL_Offset:
|
2917
|
2880
|
bluecell_Currdatastatus.DL_Det_ALL_Offset = data[BLUECELL_DATA];
|
|
@@ -4240,7 +4203,8 @@ void Factory_Set(){
|
4240
|
4203
|
|
4241
|
4204
|
|
4242
|
4205
|
bluecell_Currdatastatus.DLI_FRBT_D_Day = DLI_FRBT_DAY_DEFAULT;
|
4243
|
|
-
|
|
4206
|
+ bluecell_Currdatastatus.DLI_FRBT_Status = FRBT_TRACKING;
|
|
4207
|
+ FRBT_UserCtrl = false;
|
4244
|
4208
|
bluecell_Currdatastatus.DLI_FRBT_Atten1_H = DLI_FRBT_ATTEN_DEFALUT;
|
4245
|
4209
|
bluecell_Currdatastatus.DLI_FRBT_Atten2_H = DLI_FRBT_ATTEN_DEFALUT;
|
4246
|
4210
|
bluecell_Currdatastatus.DLI_FRBT_Atten3_H = DLI_FRBT_ATTEN_DEFALUT;
|
|
@@ -4478,9 +4442,9 @@ void TimeSetting(uint8_t* data){
|
4478
|
4442
|
// printf("DLI_FRBT_Status : %d \r\n",bluecell_Currdatastatus.DLI_FRBT_Status);
|
4479
|
4443
|
// printf("DLI_AGC_ON_OFF : %d \r\n",bluecell_Currdatastatus.DLI_AGC_ON_OFF);
|
4480
|
4444
|
// printf("DLI_FRBT_D_Day : %d \r\n",bluecell_Currdatastatus.DLI_FRBT_D_Day);
|
4481
|
|
-// printf("Curr Day %d \r\n ",FRBT_Day_Inc);
|
|
4445
|
+// printf("Curr Day %d \r\n ",FRBT_UserCtrl);
|
4482
|
4446
|
if(bluecell_Currdatastatus.DLI_AGC_ON_OFF == true
|
4483
|
|
- && FRBT_Day_Inc < bluecell_Currdatastatus.DLI_FRBT_D_Day
|
|
4447
|
+ // && FRBT_UserCtrl < bluecell_Currdatastatus.DLI_FRBT_D_Day
|
4484
|
4448
|
&& bluecell_Currdatastatus.DLI_FRBT_Status != FRBT_RUNNING){
|
4485
|
4449
|
for(int i = 0; i < DLI_FRBT_Time_Index_Max; i++){
|
4486
|
4450
|
FRBT_Day[DLI_FRBT_Time_Year + i] = data[i]; /* Curr day */
|
|
@@ -4497,9 +4461,14 @@ void TimeSetting(uint8_t* data){
|
4497
|
4461
|
// printf("FRBT_Day[DLI_FRBT_Time_Day] : %d PrevFRBT_Day[DLI_FRBT_D_Day] : %d \r\n",
|
4498
|
4462
|
// FRBT_Day[DLI_FRBT_Time_Day] ,
|
4499
|
4463
|
// PrevFRBT_Day[DLI_FRBT_Time_Day]);
|
4500
|
|
- FRBT_Day_Inc++;
|
|
4464
|
+// FRBT_UserCtrl++;
|
|
4465
|
+ bluecell_Currdatastatus.DLI_FRBT_D_Day--;
|
|
4466
|
+
|
|
4467
|
+ if(bluecell_Currdatastatus.DLI_FRBT_D_Day > 7)
|
|
4468
|
+ bluecell_Currdatastatus.DLI_FRBT_D_Day = 7;
|
|
4469
|
+
|
4501
|
4470
|
bluecell_Currdatastatus.DLI_FRBT_Status = FRBT_TRACKING;
|
4502
|
|
-// printf("D day Plus : %d \r\n",FRBT_Day_Inc);
|
|
4471
|
+// printf("D day Plus : %d \r\n",FRBT_UserCtrl);
|
4503
|
4472
|
}
|
4504
|
4473
|
|
4505
|
4474
|
for(int i = 0; i < DLI_FRBT_Time_Index_Max; i++){
|
|
@@ -5381,11 +5350,12 @@ bool MBIC_Operate(uint8_t* data){
|
5381
|
5350
|
case DLI_FRBT_D_Day:
|
5382
|
5351
|
bluecell_Currdatastatus.DLI_FRBT_D_Day = data[MBIC_PAYLOADSTART + 3];
|
5383
|
5352
|
if(bluecell_Currdatastatus.DLI_FRBT_D_Day == 0){
|
5384
|
|
- FRBT_Day_Inc = 0;
|
|
5353
|
+ FRBT_UserCtrl = true;
|
5385
|
5354
|
bluecell_Currdatastatus.DLI_FRBT_Status = FRBT_IDEL;
|
5386
|
5355
|
|
5387
|
5356
|
}else{
|
5388
|
5357
|
bluecell_Currdatastatus.DLI_FRBT_Status = FRBT_TRACKING;
|
|
5358
|
+ FRBT_UserCtrl = false;
|
5389
|
5359
|
}
|
5390
|
5360
|
break;
|
5391
|
5361
|
|
|
@@ -5401,14 +5371,14 @@ bool MBIC_Operate(uint8_t* data){
|
5401
|
5371
|
PrevFRBT_Day[DLI_FRBT_Time_Year + i] = FRBT_Day[DLI_FRBT_Time_Year + i] = 0;
|
5402
|
5372
|
}
|
5403
|
5373
|
|
5404
|
|
- FRBT_Day_Inc = 0;
|
|
5374
|
+// FRBT_UserCtrl = 0;
|
5405
|
5375
|
bluecell_Currdatastatus.DLI_FRBT_Status = FRBT_IDEL;
|
5406
|
5376
|
bluecell_Currdatastatus.ALARM_DLI_AGC_Alarm = 0;
|
5407
|
5377
|
}else{
|
5408
|
5378
|
for(int i = 0; i < DLI_FRBT_Time_Index_Max; i++){
|
5409
|
5379
|
StartTimeFRBT_Day[DLI_FRBT_Time_Year + i] = data[MBIC_TIME_0 + i]; /* Curr day */
|
5410
|
5380
|
}
|
5411
|
|
- FRBT_Day_Inc = 1;
|
|
5381
|
+// FRBT_UserCtrl = 1;
|
5412
|
5382
|
// printf("FRBT Tracking START \r\n");
|
5413
|
5383
|
// printf("FRBT Start Time Save : %d Y %d M %d D %d H %d M %d S\r\n",
|
5414
|
5384
|
// StartTimeFRBT_Day[DLI_FRBT_Time_Year],
|
|
@@ -5663,10 +5633,21 @@ bool MBIC_Operate(uint8_t* data){
|
5663
|
5633
|
bluecell_Currdatastatus.Path4_GainValue = data[MBIC_PAYLOADSTART + 3];
|
5664
|
5634
|
break;
|
5665
|
5635
|
case ULO_SelfTest_ONOFF:
|
5666
|
|
- SelfTest_Ctrl(SelfTest1,data[MBIC_PAYLOADSTART + 3],&bluecell_Currdatastatus.SelfTest,&bluecell_Currdatastatus.ATT_DL1_H,&bluecell_Currdatastatus.ATT_UL1_H,&bluecell_Currdatastatus.SelfTest_ATT_DL1_H,&bluecell_Currdatastatus.SelfTest_ATT_UL1_H);
|
5667
|
|
- SelfTest_Ctrl(SelfTest2,data[MBIC_PAYLOADSTART + 3],&bluecell_Currdatastatus.SelfTest,&bluecell_Currdatastatus.ATT_DL2_H,&bluecell_Currdatastatus.ATT_UL2_H,&bluecell_Currdatastatus.SelfTest_ATT_DL2_H,&bluecell_Currdatastatus.SelfTest_ATT_UL2_H);
|
5668
|
|
- SelfTest_Ctrl(SelfTest3,data[MBIC_PAYLOADSTART + 3],&bluecell_Currdatastatus.SelfTest,&bluecell_Currdatastatus.ATT_DL3_H,&bluecell_Currdatastatus.ATT_UL3_H,&bluecell_Currdatastatus.SelfTest_ATT_DL3_H,&bluecell_Currdatastatus.SelfTest_ATT_UL3_H);
|
5669
|
|
- SelfTest_Ctrl(SelfTest4,data[MBIC_PAYLOADSTART + 3],&bluecell_Currdatastatus.SelfTest,&bluecell_Currdatastatus.ATT_DL4_H,&bluecell_Currdatastatus.ATT_UL4_H,&bluecell_Currdatastatus.SelfTest_ATT_DL4_H,&bluecell_Currdatastatus.SelfTest_ATT_UL4_H);
|
|
5636
|
+ SelfTest_Ctrl(SelfTest1,data[MBIC_PAYLOADSTART + 3],&bluecell_Currdatastatus.SelfTest,&bluecell_Currdatastatus.ATT_DL1_H,&bluecell_Currdatastatus.ATT_UL1_H,&bluecell_Currdatastatus.SelfTest_ATT_DL1_H,&bluecell_Currdatastatus.SelfTest_ATT_UL1_H,&bluecell_Currdatastatus.MBIC_ULO_ALC_Atten1_H,&bluecell_Currdatastatus.Prev_ATT_ALC1_H);
|
|
5637
|
+ SelfTest_Ctrl(SelfTest2,data[MBIC_PAYLOADSTART + 3],&bluecell_Currdatastatus.SelfTest,&bluecell_Currdatastatus.ATT_DL2_H,&bluecell_Currdatastatus.ATT_UL2_H,&bluecell_Currdatastatus.SelfTest_ATT_DL2_H,&bluecell_Currdatastatus.SelfTest_ATT_UL2_H,&bluecell_Currdatastatus.MBIC_ULO_ALC_Atten2_H,&bluecell_Currdatastatus.Prev_ATT_ALC2_H);
|
|
5638
|
+ SelfTest_Ctrl(SelfTest3,data[MBIC_PAYLOADSTART + 3],&bluecell_Currdatastatus.SelfTest,&bluecell_Currdatastatus.ATT_DL3_H,&bluecell_Currdatastatus.ATT_UL3_H,&bluecell_Currdatastatus.SelfTest_ATT_DL3_H,&bluecell_Currdatastatus.SelfTest_ATT_UL3_H,&bluecell_Currdatastatus.MBIC_ULO_ALC_Atten3_H,&bluecell_Currdatastatus.Prev_ATT_ALC3_H);
|
|
5639
|
+ SelfTest_Ctrl(SelfTest4,data[MBIC_PAYLOADSTART + 3],&bluecell_Currdatastatus.SelfTest,&bluecell_Currdatastatus.ATT_DL4_H,&bluecell_Currdatastatus.ATT_UL4_H,&bluecell_Currdatastatus.SelfTest_ATT_DL4_H,&bluecell_Currdatastatus.SelfTest_ATT_UL4_H,&bluecell_Currdatastatus.MBIC_ULO_ALC_Atten4_H,&bluecell_Currdatastatus.Prev_ATT_ALC4_H);
|
|
5640
|
+ HAL_Delay(500);
|
|
5641
|
+ if(bluecell_Currdatastatus.SelfTest == true){
|
|
5642
|
+ Prev_ALC_OnOff = bluecell_Currdatastatus.ULO_ALC_ON_OFF;
|
|
5643
|
+ Prev_AGC_OnOff = bluecell_Currdatastatus.DLI_AGC_ON_OFF;
|
|
5644
|
+ bluecell_Currdatastatus.DLI_AGC_ON_OFF = false;
|
|
5645
|
+ bluecell_Currdatastatus.ULO_ALC_ON_OFF = false;
|
|
5646
|
+ }else{
|
|
5647
|
+ bluecell_Currdatastatus.ULO_ALC_ON_OFF = Prev_ALC_OnOff;
|
|
5648
|
+ bluecell_Currdatastatus.DLI_AGC_ON_OFF = Prev_AGC_OnOff;
|
|
5649
|
+ }
|
|
5650
|
+
|
5670
|
5651
|
#if 0 // PYJ.2020.09.03_BEGIN --
|
5671
|
5652
|
if(bluecell_Currdatastatus.SelfTest == false){
|
5672
|
5653
|
printf("SelfTest ON\r\n");
|
|
@@ -8044,6 +8025,9 @@ void ALC_Package_Operate(uint8_t*ULO_ADC_Level,uint8_t* ULO_Level,DET_TABLEUL_st
|
8044
|
8025
|
ret = ((ULO_ADC_Level[ULO_ALC_H] << 8 | ULO_ADC_Level[ULO_ALC_L]) * 0.001);
|
8045
|
8026
|
/*Curr UL Value*/
|
8046
|
8027
|
ResdBm = AutoControl_ADC_Compare(ret,&UL_Table->Table_Det_15_dBm_H,UL_Table->Table_Length * 2,&UL_DET_Table_ref[TableIndex][TABLE_MAX_VALUE]);
|
|
8028
|
+
|
|
8029
|
+// ResdBm = (int16_t)(ULO_Level[ULO_ALC_H] << 8 | ULO_Level[ULO_ALC_L]);
|
|
8030
|
+// ResdBm = (int16_t)Bluecell_TestPro( ResdBm / 10);
|
8047
|
8031
|
//ret 현재 Voltage 값 출력
|
8048
|
8032
|
//ret 에 따른 현재 DBM 구현
|
8049
|
8033
|
|
|
@@ -8309,7 +8293,7 @@ void AGC_Alarm_Check(uint8_t Path_Index,double AGC_Det,uint8_t* AGC_Table,uint16
|
8309
|
8293
|
#if 1 // PYJ.2020.06.27_BEGIN --
|
8310
|
8294
|
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){
|
8311
|
8295
|
double ret = 0;
|
8312
|
|
- int8_t ResdBm = 0;
|
|
8296
|
+ int16_t ResdBm = 0;
|
8313
|
8297
|
int16_t CurrAtten = 0;
|
8314
|
8298
|
int16_t Levelret = 0;
|
8315
|
8299
|
int i = 0;
|
|
@@ -8335,21 +8319,24 @@ void AGC_Package_Operate(uint8_t* Threshold,uint8_t* DL_MainAtten,uint8_t Tablei
|
8335
|
8319
|
|
8336
|
8320
|
CurrAtten = (int16_t)(DL_MainAtten[DLI_AGC_H] << 8 | DL_MainAtten[DLI_AGC_L]);
|
8337
|
8321
|
CurrAtten *= 0.1;
|
8338
|
|
- ResdBm = (int8_t)Bluecell_TestPro(AGC_AutoControl_ADC_Compare(ret,&DL_Table->Table_Det5_dBm_H,DL_Table->Table_Length,AGC_Table));
|
8339
|
|
- DLI_Level[DLI_AGC_H] = ((int16_t)ResdBm & 0xFF00) >> 8;
|
8340
|
|
- DLI_Level[DLI_AGC_L] = ((int16_t)ResdBm & 0x00FF);
|
|
8322
|
+ ResdBm = (int16_t)(DLI_Level[DLI_AGC_H] << 8 | DLI_Level[DLI_AGC_L]);//(int8_t)Bluecell_TestPro(AGC_AutoControl_ADC_Compare(ret,&DL_Table->Table_Det5_dBm_H,DL_Table->Table_Length,AGC_Table));
|
|
8323
|
+ ResdBm = (int16_t)Bluecell_TestPro( ResdBm / 10);
|
|
8324
|
+// DLI_Level[DLI_AGC_H] = ((int16_t)ResdBm & 0xFF00) >> 8;
|
|
8325
|
+// DLI_Level[DLI_AGC_L] = ((int16_t)ResdBm & 0x00FF);
|
8341
|
8326
|
for(i = 0; i < sizeof(AGC_dBm_t); i++){
|
8342
|
8327
|
if(AGC_Table[i] == ResdBm)
|
8343
|
8328
|
break;
|
8344
|
8329
|
}
|
8345
|
8330
|
IwillgiveAtten = AGC_Calc(Limitdata,ResdBm);
|
8346
|
8331
|
IwillgiveAtten *= -1;
|
8347
|
|
-// printf("==================================\r\n");
|
8348
|
|
-// printf("Curr ATTEN %d \r\n",CurrAtten );
|
8349
|
|
-// printf("Current DL% ADC VALUE : %f \r\n",Tableindex+1,ret);
|
8350
|
|
-// printf("ResdBm : DL%d : %d \r\n",Tableindex+1,ResdBm);
|
8351
|
|
-// printf("I WILL GIVE YOU ATTEN : %d\r\n",IwillgiveAtten);
|
8352
|
|
-// printf("AGC : %d\r\n",Limitdata);
|
|
8332
|
+#if 0 // PYJ.2020.09.14_BEGIN --
|
|
8333
|
+ printf("==================================\r\n");
|
|
8334
|
+ printf("Curr ATTEN %d \r\n",CurrAtten );
|
|
8335
|
+ printf("Current DL% ADC VALUE : %f \r\n",Tableindex+1,ret);
|
|
8336
|
+ printf("ResdBm : DL%d : %d \r\n",Tableindex+1,ResdBm);
|
|
8337
|
+ printf("I WILL GIVE YOU ATTEN : %d\r\n",IwillgiveAtten);
|
|
8338
|
+ printf("AGC : %d\r\n",Limitdata);
|
|
8339
|
+#endif // PYJ.2020.09.14_END --
|
8353
|
8340
|
if((CurrAtten) < IwillgiveAtten)
|
8354
|
8341
|
IwillgiveAtten = (CurrAtten );
|
8355
|
8342
|
|
|
@@ -8407,10 +8394,7 @@ int16_t Temperature_Offset_Get(int8_t* Temp_Table,int8_t CurrTemp){
|
8407
|
8394
|
// printf("Temp Table : %x \r\n",Temp_Table[0] << 8 | Temp_Table[1]);
|
8408
|
8395
|
|
8409
|
8396
|
}
|
8410
|
|
-typedef enum{
|
8411
|
|
- DL_Level_H,
|
8412
|
|
- DL_Level_L,
|
8413
|
|
-};
|
|
8397
|
+
|
8414
|
8398
|
void DL_Det_Function(uint8_t Table_Num,uint8_t* CurrADC_Level,DET_TABLEDL_st* DL_Table,uint8_t* Level){
|
8415
|
8399
|
double ret = 0;//
|
8416
|
8400
|
uint8_t* AGC_Table;
|
|
@@ -9180,12 +9164,11 @@ void SelfTest_TimerOff(uint8_t num,uint8_t* selftest){
|
9180
|
9164
|
HAL_GPIO_WritePin(Port,Pin,GPIO_PIN_SET);//CLOCK
|
9181
|
9165
|
}
|
9182
|
9166
|
|
9183
|
|
-void SelfTest_Ctrl(uint8_t num,uint8_t val,uint8_t* selftest,uint8_t* DL_Atten,uint8_t* UL_Atten,uint8_t* Prev_DL_Atten,uint8_t* Prev_UL_Atten){
|
|
9167
|
+void SelfTest_Ctrl(uint8_t num,uint8_t val,uint8_t* selftest,uint8_t* DL_Atten,uint8_t* UL_Atten,uint8_t* Prev_DL_Atten,uint8_t* Prev_UL_Atten,uint8_t* ALC_Atten,uint8_t* Prev_ALC_Atten){
|
9184
|
9168
|
GPIO_TypeDef *Port = 0;
|
9185
|
9169
|
uint16_t Pin = 0;
|
9186
|
9170
|
GPIO_TypeDef *_Port = 0;
|
9187
|
9171
|
uint16_t _Pin = 0;
|
9188
|
|
-
|
9189
|
9172
|
switch(num){
|
9190
|
9173
|
case SelfTest1:
|
9191
|
9174
|
_Port = _PATH_SW1_GPIO_Port;
|
|
@@ -9228,13 +9211,17 @@ void SelfTest_Ctrl(uint8_t num,uint8_t val,uint8_t* selftest,uint8_t* DL_Atten,u
|
9228
|
9211
|
Prev_DL_Atten[Atten_L] = DL_Atten[Atten_L];
|
9229
|
9212
|
Prev_UL_Atten[Atten_H] = UL_Atten[Atten_H];
|
9230
|
9213
|
Prev_UL_Atten[Atten_L] = UL_Atten[Atten_L];
|
|
9214
|
+ Prev_ALC_Atten[Atten_H] = ALC_Atten[Atten_H];
|
|
9215
|
+ Prev_ALC_Atten[Atten_L] = ALC_Atten[Atten_L];
|
9231
|
9216
|
|
9232
|
9217
|
// for(int i =0; i< 8; i++)
|
9233
|
9218
|
// printf("Selftest_UL_PrevAttenSave[%d] : %x \r\n",i,Selftest_UL_PrevAttenSave[i]);
|
9234
|
9219
|
DL_Atten[Atten_H] = 0;
|
9235
|
9220
|
DL_Atten[Atten_L] = 0;
|
9236
|
9221
|
UL_Atten[Atten_H] = 0;
|
9237
|
|
- UL_Atten[Atten_L] = 0;
|
|
9222
|
+ UL_Atten[Atten_L] = 0;
|
|
9223
|
+ ALC_Atten[Atten_H] = 0;
|
|
9224
|
+ ALC_Atten[Atten_L] = 0;
|
9238
|
9225
|
HAL_GPIO_WritePin(_Port,_Pin,GPIO_PIN_SET);//CLOCK
|
9239
|
9226
|
HAL_GPIO_WritePin(Port,Pin,GPIO_PIN_RESET);//CLOCK
|
9240
|
9227
|
}else{
|
|
@@ -9248,6 +9235,8 @@ void SelfTest_Ctrl(uint8_t num,uint8_t val,uint8_t* selftest,uint8_t* DL_Atten,u
|
9248
|
9235
|
DL_Atten[Atten_L] = Prev_DL_Atten[Atten_L];
|
9249
|
9236
|
UL_Atten[Atten_H] = Prev_UL_Atten[Atten_H];
|
9250
|
9237
|
UL_Atten[Atten_L] = Prev_UL_Atten[Atten_L];
|
|
9238
|
+ ALC_Atten[Atten_H] = Prev_ALC_Atten[Atten_H];
|
|
9239
|
+ ALC_Atten[Atten_L] = Prev_ALC_Atten[Atten_L];
|
9251
|
9240
|
|
9252
|
9241
|
#endif // PYJ.2020.09.03_END --
|
9253
|
9242
|
// for(int i =0; i< 8; i++)
|
|
@@ -9273,15 +9262,19 @@ void SelfTestTimer_Operate()
|
9273
|
9262
|
SelfTest_TimerOff(SelfTest4,&bluecell_Currdatastatus.SelfTest);
|
9274
|
9263
|
}
|
9275
|
9264
|
void FRBT_Operate(){
|
9276
|
|
-
|
9277
|
9265
|
if(bluecell_Currdatastatus.DLI_FRBT_D_Day == 0 || bluecell_Currdatastatus.DLI_AGC_ON_OFF == false){ /*AGC ON ONLY*/
|
9278
|
|
- bluecell_Currdatastatus.DLI_FRBT_Status = FRBT_IDEL;
|
|
9266
|
+ if(FRBT_UserCtrl_Get() == true){
|
|
9267
|
+ bluecell_Currdatastatus.DLI_FRBT_Status = FRBT_IDEL;
|
|
9268
|
+ }else{
|
|
9269
|
+ bluecell_Currdatastatus.DLI_FRBT_Status = FRBT_RUNNING;
|
|
9270
|
+ }
|
9279
|
9271
|
// printf("AGC OFF \r\n");
|
9280
|
9272
|
return;
|
9281
|
9273
|
}
|
9282
|
9274
|
|
|
9275
|
+#if 0 // PYJ.2020.09.14_BEGIN --
|
9283
|
9276
|
/*Time Calc*/
|
9284
|
|
- if(FRBT_Day_Inc == bluecell_Currdatastatus.DLI_FRBT_D_Day
|
|
9277
|
+ if(FRBT_UserCtrl == bluecell_Currdatastatus.DLI_FRBT_D_Day
|
9285
|
9278
|
&& StartTimeFRBT_Day[DLI_FRBT_Time_Hour] <= FRBT_Day[DLI_FRBT_Time_Hour]
|
9286
|
9279
|
&& StartTimeFRBT_Day[DLI_FRBT_Time_Minute] <= FRBT_Day[DLI_FRBT_Time_Minute]
|
9287
|
9280
|
&& StartTimeFRBT_Day[DLI_FRBT_Time_Second] <= FRBT_Day[DLI_FRBT_Time_Second]
|
|
@@ -9290,6 +9283,15 @@ void FRBT_Operate(){
|
9290
|
9283
|
bluecell_Currdatastatus.DLI_FRBT_Status = FRBT_RUNNING;
|
9291
|
9284
|
// printf("FRBT Running Start \r\n");
|
9292
|
9285
|
}
|
|
9286
|
+#else
|
|
9287
|
+ /*Time Calc*/
|
|
9288
|
+ if(bluecell_Currdatastatus.DLI_FRBT_D_Day > 0)
|
|
9289
|
+ {
|
|
9290
|
+ bluecell_Currdatastatus.DLI_FRBT_Status = FRBT_TRACKING;
|
|
9291
|
+// printf("FRBT Running Start \r\n");
|
|
9292
|
+ }
|
|
9293
|
+
|
|
9294
|
+#endif // PYJ.2020.09.14_END --
|
9293
|
9295
|
|
9294
|
9296
|
if(bluecell_Currdatastatus.DLI_FRBT_Status == FRBT_TRACKING){
|
9295
|
9297
|
FRBT_Tracking_Package(DET_Alarm_DL1_Index,&bluecell_Currdatastatus.DLI_FRBT_Atten1_H,&bluecell_Currdatastatus.ATT_DL1_H,bluecell_Currdatastatus.ATT_DL1_PATH);
|