|
@@ -88,7 +88,7 @@ double PE43711_Double(uint8_t high_bit,uint8_t low_bit);
|
88
|
88
|
void Booting_LED_Check(void);
|
89
|
89
|
double Bluecell_TestPro(double value );
|
90
|
90
|
double AGC_AutoControl_ADC_Compare(double CurrentAdc,uint8_t* CompareAdc,uint8_t size,int8_t* RefTable_Data);
|
91
|
|
-void ALC_Alarm_TimerSet(uint8_t num,int16_t threshold,int16_t CurrDet,int16_t CurrAtten);
|
|
91
|
+void ALC_Alarm_TimerSet(uint8_t num,int16_t threshold,int16_t CurrDet,int16_t CurrAtten,int16_t MainAtten);
|
92
|
92
|
|
93
|
93
|
|
94
|
94
|
|
|
@@ -1393,7 +1393,7 @@ void Bluecell_TableLoad(uint8_t* data,uint8_t type){
|
1393
|
1393
|
case DLI_P1_ATT_Accuracy_Table_Number:
|
1394
|
1394
|
EEPROM_M24C08_Read(EEPROM_M24C08_ID ,EEPROM_ATT_BASE ,&Att_DL1.Table_0_0_dBm,sizeof(ATT_TABLE_st) );
|
1395
|
1395
|
Bluecell_DataCopy(&data[BLUECELL_DATA + 1],&Att_DL1.Table_0_0_dBm,sizeof(ATT_TABLE_st));
|
1396
|
|
- printf("Table_Length : %d , Table_Ref : %d ",Att_DL1.Table_Length,Att_DL1.Table_Ref);
|
|
1396
|
+// printf("Table_Length : %d , Table_Ref : %d ",Att_DL1.Table_Length,Att_DL1.Table_Ref);
|
1397
|
1397
|
// Bluecell_structprintf(&Att_DL1.Table_0_0_dBm,sizeof(ATT_TABLE_st));
|
1398
|
1398
|
data[BLUECELL_LENGTH_H] = 0;
|
1399
|
1399
|
data[BLUECELL_LENGTH_L] = (sizeof(ATT_TABLE_st)) + 7 - 3;;
|
|
@@ -1436,12 +1436,15 @@ void Bluecell_TableLoad(uint8_t* data,uint8_t type){
|
1436
|
1436
|
case DLI_P1_Level_Table_Number:
|
1437
|
1437
|
EEPROM_M24C08_Read(EEPROM_M24C08_ID ,(EEPROM_ATT_UL4_TABLE_ADDRESDS),&Det_DL1.Table_Det5_dBm_H,sizeof(DET_TABLEDL_st) );
|
1438
|
1438
|
Bluecell_DataCopy(&data[BLUECELL_DATA + 1],&Det_DL1.Table_Det5_dBm_H,sizeof(DET_TABLEDL_st));
|
1439
|
|
- printf("Table_Length : %d , Table_Ref : %d ",Det_DL1.Table_Length,Det_DL1.Table_Ref);
|
|
1439
|
+// printf("Table_Length : %d , Table_Ref : %d ",Det_DL1.Table_Length,Det_DL1.Table_Ref);
|
1440
|
1440
|
data[BLUECELL_LENGTH_L] = (sizeof(DET_TABLEDL_st)) + 7 - 3;
|
1441
|
1441
|
break;
|
1442
|
1442
|
case DLI_P2_Level_Table_Number:
|
1443
|
1443
|
EEPROM_M24C08_Read(EEPROM_M24C08_ID ,(EEPROM_DET_DL1_TABLE_ADDRESDS),&Det_DL2.Table_Det5_dBm_H,sizeof(DET_TABLEDL_st) );
|
1444
|
1444
|
Bluecell_DataCopy(&data[BLUECELL_DATA + 1],&Det_DL2.Table_Det5_dBm_H,sizeof(DET_TABLEDL_st));
|
|
1445
|
+// for(int i = 0 ; i < sizeof(DET_TABLEDL_st);i++)
|
|
1446
|
+// printf("[%d Dbm] : %f \r\n",ALC_Table_ref[i],((data[BLUECELL_DATA + 1 + (i * 2)] << 8)| data[BLUECELL_DATA + 1 + (i * 2)+ 1]) * 0.001 );
|
|
1447
|
+
|
1445
|
1448
|
data[BLUECELL_LENGTH_L] = (sizeof(DET_TABLEDL_st)) + 7 - 3;
|
1446
|
1449
|
break;
|
1447
|
1450
|
case DLI_P3_Level_Table_Number:
|
|
@@ -1457,22 +1460,33 @@ void Bluecell_TableLoad(uint8_t* data,uint8_t type){
|
1457
|
1460
|
case ULO_P1_Level_Table_Number:
|
1458
|
1461
|
EEPROM_M24C08_Read(EEPROM_M24C08_ID ,(EEPROM_DET_DL4_TABLE_ADDRESDS),&Det_UL1.Table_Det_15_dBm_H,sizeof(DET_TABLEUL_st) );
|
1459
|
1462
|
Bluecell_DataCopy(&data[BLUECELL_DATA + 1],&Det_UL1.Table_Det_15_dBm_H,sizeof(DET_TABLEUL_st));
|
|
1463
|
+// for(int i = 0 ; i < sizeof(DET_TABLEUL_st);i++)
|
|
1464
|
+// printf("[%d Dbm] : %f \r\n",ALC_Table_ref[i],((data[BLUECELL_DATA + 1 + (i * 2)] << 8)| data[BLUECELL_DATA + 1 + (i * 2)+ 1]) * 0.001 );
|
1460
|
1465
|
data[BLUECELL_LENGTH_L] = (sizeof(DET_TABLEUL_st)) + 7 - 3;
|
1461
|
1466
|
break;
|
1462
|
1467
|
case ULO_P2_Level_Table_Number:
|
1463
|
1468
|
EEPROM_M24C08_Read(EEPROM_M24C08_ID ,(EEPROM_DET_UL1_TABLE_ADDRESDS),&Det_UL2.Table_Det_15_dBm_H,sizeof(DET_TABLEUL_st) );
|
1464
|
1469
|
Bluecell_DataCopy(&data[BLUECELL_DATA + 1],&Det_UL2.Table_Det_15_dBm_H,sizeof(DET_TABLEUL_st));
|
|
1470
|
+// for(int i = 0 ; i < sizeof(DET_TABLEUL_st);i++)
|
|
1471
|
+// printf("[%d Dbm] : %f \r\n",ALC_Table_ref[i],((data[BLUECELL_DATA + 1 + (i * 2)] << 8)| data[BLUECELL_DATA + 1 + (i * 2)+ 1]) * 0.001 );
|
|
1472
|
+
|
1465
|
1473
|
data[BLUECELL_LENGTH_L] = (sizeof(DET_TABLEUL_st)) + 7 - 3;
|
1466
|
1474
|
|
1467
|
1475
|
break;
|
1468
|
1476
|
case ULO_P3_Level_Table_Number:
|
1469
|
1477
|
EEPROM_M24C08_Read(EEPROM_M24C08_ID ,(EEPROM_DET_UL2_TABLE_ADDRESDS),&Det_UL3.Table_Det_15_dBm_H,sizeof(DET_TABLEUL_st) );
|
1470
|
1478
|
Bluecell_DataCopy(&data[BLUECELL_DATA + 1],&Det_UL3.Table_Det_15_dBm_H,sizeof(DET_TABLEUL_st));
|
|
1479
|
+// for(int i = 0 ; i < sizeof(DET_TABLEUL_st);i++)
|
|
1480
|
+// printf("[%d Dbm] : %f \r\n",ALC_Table_ref[i],((data[BLUECELL_DATA + 1 + (i * 2)] << 8)| data[BLUECELL_DATA + 1 + (i * 2)+ 1]) * 0.001 );
|
|
1481
|
+
|
1471
|
1482
|
data[BLUECELL_LENGTH_L] = (sizeof(DET_TABLEUL_st)) + 7 - 3;
|
1472
|
1483
|
break;
|
1473
|
1484
|
case ULO_P4_Level_Table_Number:
|
1474
|
1485
|
EEPROM_M24C08_Read(EEPROM_M24C08_ID ,(EEPROM_DET_UL3_TABLE_ADDRESDS),&Det_UL4.Table_Det_15_dBm_H,sizeof(DET_TABLEUL_st) );
|
1475
|
1486
|
Bluecell_DataCopy(&data[BLUECELL_DATA + 1],&Det_UL4.Table_Det_15_dBm_H,sizeof(DET_TABLEUL_st));
|
|
1487
|
+// for(int i = 0 ; i < sizeof(DET_TABLEUL_st);i++)
|
|
1488
|
+// printf("[%d Dbm] : %f \r\n",ALC_Table_ref[i],((data[BLUECELL_DATA + 1 + (i * 2)] << 8)| data[BLUECELL_DATA + 1 + (i * 2)+ 1]) * 0.001 );
|
|
1489
|
+
|
1476
|
1490
|
data[BLUECELL_LENGTH_L] = (sizeof(DET_TABLEUL_st)) + 7 - 3;
|
1477
|
1491
|
|
1478
|
1492
|
break;
|
|
@@ -2057,6 +2071,8 @@ bool Bluecell_Operate(uint8_t* data){
|
2057
|
2071
|
//double ret = 0 ,tmp = 0.1;
|
2058
|
2072
|
int16_t tempdata = 0;
|
2059
|
2073
|
int16_t CurrAtten = 0;
|
|
2074
|
+ int16_t ALC_TEMP[4] ={0,};
|
|
2075
|
+ int16_t Tmpdata = 0 ,Tmpdata2 = 0;
|
2060
|
2076
|
uint8_t i = 0;
|
2061
|
2077
|
uint16_t Crcret = 0;
|
2062
|
2078
|
switch(datatype){
|
|
@@ -2119,12 +2135,22 @@ bool Bluecell_Operate(uint8_t* data){
|
2119
|
2135
|
case Bluecell_ATT_UL1 :
|
2120
|
2136
|
|
2121
|
2137
|
bluecell_Currdatastatus.ATT_UL1_H = data[BLUECELL_DATA + i++];
|
2122
|
|
- bluecell_Currdatastatus.ATT_UL1_L = data[BLUECELL_DATA + i++];
|
2123
|
|
- CurrAtten = bluecell_Currdatastatus.ATT_UL1_H << 8 | bluecell_Currdatastatus.ATT_UL1_L;
|
2124
|
|
- if(CurrAtten <= -200){
|
2125
|
|
- bluecell_Currdatastatus.ATT_UL1_H = (CurrAtten & 0xFF00) >> 8;
|
2126
|
|
- bluecell_Currdatastatus.ATT_UL1_L = (CurrAtten & 0x00FF);
|
|
2138
|
+ bluecell_Currdatastatus.ATT_UL1_L =data[BLUECELL_DATA + i++];
|
|
2139
|
+ if(bluecell_Currdatastatus.ULO_ALC_ON_OFF == true){
|
|
2140
|
+ Tmpdata = bluecell_Currdatastatus.MBIC_ULO_ALC_Atten1_H << 8 | bluecell_Currdatastatus.MBIC_ULO_ALC_Atten1_L;
|
|
2141
|
+ Tmpdata2 = bluecell_Currdatastatus.ATT_UL1_H << 8 | bluecell_Currdatastatus.ATT_UL1_L;
|
|
2142
|
+ if(Tmpdata + Tmpdata2 <= -200){
|
|
2143
|
+ Tmpdata2 = -200 + (Tmpdata * -1);
|
|
2144
|
+ bluecell_Currdatastatus.ATT_UL1_H = ((Tmpdata2 & 0xFF00) >> 8);
|
|
2145
|
+ bluecell_Currdatastatus.ATT_UL1_L = Tmpdata2 & 0x00FF;
|
|
2146
|
+ }
|
|
2147
|
+ UL_ALC_GainAttenSet[ALC_Alarm_UL1_Index] = true;
|
|
2148
|
+ ALC_Level_Save[ALC_Alarm_UL1_Index] = bluecell_Currdatastatus.ULO_Level1_H << 8 | bluecell_Currdatastatus.ULO_Level1_L;
|
2127
|
2149
|
}
|
|
2150
|
+ CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);
|
|
2151
|
+
|
|
2152
|
+
|
|
2153
|
+
|
2128
|
2154
|
printf("LINE : %d Curr ATTEN : %d \r\n",__LINE__,CurrAtten);
|
2129
|
2155
|
|
2130
|
2156
|
/*
|
|
@@ -2138,12 +2164,19 @@ bool Bluecell_Operate(uint8_t* data){
|
2138
|
2164
|
case Bluecell_ATT_UL2 :
|
2139
|
2165
|
bluecell_Currdatastatus.ATT_UL2_H = data[BLUECELL_DATA + i++];
|
2140
|
2166
|
bluecell_Currdatastatus.ATT_UL2_L = data[BLUECELL_DATA + i++];
|
2141
|
|
- CurrAtten = bluecell_Currdatastatus.ATT_UL2_H << 8 | bluecell_Currdatastatus.ATT_UL2_L;
|
2142
|
|
- printf("LINE : %d Curr ATTEN : %d \r\n",__LINE__,CurrAtten);
|
2143
|
|
- if(CurrAtten <= -200){
|
2144
|
|
- bluecell_Currdatastatus.ATT_UL2_H = (CurrAtten & 0xFF00) >> 8;
|
2145
|
|
- bluecell_Currdatastatus.ATT_UL2_L = (CurrAtten & 0x00FF);
|
|
2167
|
+ if(bluecell_Currdatastatus.ULO_ALC_ON_OFF == true){
|
|
2168
|
+ Tmpdata = bluecell_Currdatastatus.MBIC_ULO_ALC_Atten2_H << 8 | bluecell_Currdatastatus.MBIC_ULO_ALC_Atten2_L;
|
|
2169
|
+ Tmpdata2 = bluecell_Currdatastatus.ATT_UL2_H << 8 | bluecell_Currdatastatus.ATT_UL2_L;
|
|
2170
|
+ if(Tmpdata + Tmpdata2 <= -200){
|
|
2171
|
+ Tmpdata2 = -200 + (Tmpdata * -1);
|
|
2172
|
+ bluecell_Currdatastatus.ATT_UL2_H = ((Tmpdata2 & 0xFF00) >> 8);
|
|
2173
|
+ bluecell_Currdatastatus.ATT_UL2_L = Tmpdata2 & 0x00FF;
|
|
2174
|
+ }
|
|
2175
|
+ UL_ALC_GainAttenSet[ALC_Alarm_UL2_Index] = true;
|
|
2176
|
+ ALC_Level_Save[ALC_Alarm_UL2_Index] = bluecell_Currdatastatus.ULO_Level2_H << 8 | bluecell_Currdatastatus.ULO_Level2_L;
|
2146
|
2177
|
}
|
|
2178
|
+ CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);
|
|
2179
|
+
|
2147
|
2180
|
|
2148
|
2181
|
/*
|
2149
|
2182
|
Atten Ctrl Function
|
|
@@ -2154,12 +2187,18 @@ bool Bluecell_Operate(uint8_t* data){
|
2154
|
2187
|
case Bluecell_ATT_UL3 :
|
2155
|
2188
|
bluecell_Currdatastatus.ATT_UL3_H = data[BLUECELL_DATA + i++];
|
2156
|
2189
|
bluecell_Currdatastatus.ATT_UL3_L = data[BLUECELL_DATA + i++];
|
2157
|
|
- CurrAtten = bluecell_Currdatastatus.ATT_UL3_H << 8 | bluecell_Currdatastatus.ATT_UL3_L;
|
2158
|
|
- printf("LINE : %d Curr ATTEN : %d \r\n",__LINE__,CurrAtten);
|
2159
|
|
- if(CurrAtten <= -200){
|
2160
|
|
- bluecell_Currdatastatus.ATT_UL3_H = (CurrAtten & 0xFF00) >> 8;
|
2161
|
|
- bluecell_Currdatastatus.ATT_UL3_L = (CurrAtten & 0x00FF);
|
|
2190
|
+ if(bluecell_Currdatastatus.ULO_ALC_ON_OFF == true){
|
|
2191
|
+ Tmpdata = bluecell_Currdatastatus.MBIC_ULO_ALC_Atten3_H << 8 | bluecell_Currdatastatus.MBIC_ULO_ALC_Atten3_L;
|
|
2192
|
+ Tmpdata2 = bluecell_Currdatastatus.ATT_UL3_H << 8 | bluecell_Currdatastatus.ATT_UL3_L;
|
|
2193
|
+ if(Tmpdata + Tmpdata2 <= -200){
|
|
2194
|
+ Tmpdata2 = -200 + (Tmpdata * -2);
|
|
2195
|
+ bluecell_Currdatastatus.ATT_UL3_H = ((Tmpdata2 & 0xFF00) >> 8);
|
|
2196
|
+ bluecell_Currdatastatus.ATT_UL3_L = Tmpdata2 & 0x00FF;
|
|
2197
|
+ }
|
|
2198
|
+ UL_ALC_GainAttenSet[ALC_Alarm_UL3_Index] = true;
|
|
2199
|
+ ALC_Level_Save[ALC_Alarm_UL3_Index] = bluecell_Currdatastatus.ULO_Level3_H << 8 | bluecell_Currdatastatus.ULO_Level3_L;
|
2162
|
2200
|
}
|
|
2201
|
+ CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);
|
2163
|
2202
|
|
2164
|
2203
|
/*
|
2165
|
2204
|
Atten Ctrl Function
|
|
@@ -2170,12 +2209,19 @@ bool Bluecell_Operate(uint8_t* data){
|
2170
|
2209
|
case Bluecell_ATT_UL4 :
|
2171
|
2210
|
bluecell_Currdatastatus.ATT_UL4_H = data[BLUECELL_DATA + i++];
|
2172
|
2211
|
bluecell_Currdatastatus.ATT_UL4_L = data[BLUECELL_DATA + i++];
|
2173
|
|
- CurrAtten = bluecell_Currdatastatus.ATT_UL4_H << 8 | bluecell_Currdatastatus.ATT_UL4_L;
|
2174
|
|
- if(CurrAtten <= -200){
|
2175
|
|
- bluecell_Currdatastatus.ATT_UL4_H = (CurrAtten & 0xFF00) >> 8;
|
2176
|
|
- bluecell_Currdatastatus.ATT_UL4_L = (CurrAtten & 0x00FF);
|
2177
|
|
- }
|
2178
|
|
- printf("LINE : %d Curr ATTEN : %d \r\n",__LINE__,CurrAtten);
|
|
2212
|
+ if(bluecell_Currdatastatus.ULO_ALC_ON_OFF == true){
|
|
2213
|
+ Tmpdata = bluecell_Currdatastatus.MBIC_ULO_ALC_Atten4_H << 8 | bluecell_Currdatastatus.MBIC_ULO_ALC_Atten4_L;
|
|
2214
|
+ Tmpdata2 = bluecell_Currdatastatus.ATT_UL4_H << 8 | bluecell_Currdatastatus.ATT_UL4_L;
|
|
2215
|
+ if(Tmpdata + Tmpdata2 <= -200){
|
|
2216
|
+ Tmpdata2 = -200 + (Tmpdata * -2);
|
|
2217
|
+ bluecell_Currdatastatus.ATT_UL4_H = ((Tmpdata2 & 0xFF00) >> 8);
|
|
2218
|
+ bluecell_Currdatastatus.ATT_UL4_L = Tmpdata2 & 0x00FF;
|
|
2219
|
+ }
|
|
2220
|
+ UL_ALC_GainAttenSet[ALC_Alarm_UL4_Index] = true;
|
|
2221
|
+ ALC_Level_Save[ALC_Alarm_UL4_Index] = bluecell_Currdatastatus.ULO_Level4_H << 8 | bluecell_Currdatastatus.ULO_Level4_L;
|
|
2222
|
+ }
|
|
2223
|
+ CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);
|
|
2224
|
+
|
2179
|
2225
|
ALCTimerCnt = 0;
|
2180
|
2226
|
|
2181
|
2227
|
|
|
@@ -2470,7 +2516,63 @@ bool Bluecell_Operate(uint8_t* data){
|
2470
|
2516
|
printf("%x ",Txdata[i]);
|
2471
|
2517
|
}
|
2472
|
2518
|
printf("\r\n");
|
2473
|
|
-#endif // PYJ.2020.04.22_END --
|
|
2519
|
+#endif // PYJ.2020.04.22_END --
|
|
2520
|
+ printf("===================START=======================\r\n");
|
|
2521
|
+ printf("ALC ON %d \r\n",bluecell_Currdatastatus.ULO_ALC_ON_OFF);
|
|
2522
|
+ printf("AGC ON %d \r\n",bluecell_Currdatastatus.DLI_AGC_ON_OFF);
|
|
2523
|
+ printf("Shutdown DL ON OFF %d \r\n",bluecell_Currdatastatus.DLI_Shutdown_ON_OFF);
|
|
2524
|
+ printf("Shutdown UL ON OFF %d \r\n",bluecell_Currdatastatus.ULO_Shutdown_ON_OFF);
|
|
2525
|
+
|
|
2526
|
+
|
|
2527
|
+ printf("Shutdown DL1 CNT %d \r\n",bluecell_Currdatastatus.DLI_Shutdown_Retry_Count1);
|
|
2528
|
+ printf("Shutdown DL2 CNT %d \r\n",bluecell_Currdatastatus.DLI_Shutdown_Retry_Count2);
|
|
2529
|
+ printf("Shutdown DL3 CNT %d \r\n",bluecell_Currdatastatus.DLI_Shutdown_Retry_Count3);
|
|
2530
|
+ printf("Shutdown DL4 CNT %d \r\n",bluecell_Currdatastatus.DLI_Shutdown_Retry_Count4);
|
|
2531
|
+
|
|
2532
|
+ printf("Shutdown UL1 CNT %d \r\n",bluecell_Currdatastatus.ULO_Shutdown_Retry_Count1);
|
|
2533
|
+ printf("Shutdown UL2 CNT %d \r\n",bluecell_Currdatastatus.ULO_Shutdown_Retry_Count2);
|
|
2534
|
+ printf("Shutdown UL3 CNT %d \r\n",bluecell_Currdatastatus.ULO_Shutdown_Retry_Count3);
|
|
2535
|
+ printf("Shutdown UL4 CNT %d \r\n",bluecell_Currdatastatus.ULO_Shutdown_Retry_Count4);
|
|
2536
|
+
|
|
2537
|
+// printf("Temp Alarm %d \r\n");
|
|
2538
|
+ printf("ALC Alarm 1: %d 2: %d 3: %d 4: %d\r\n",
|
|
2539
|
+ bluecell_Currdatastatus.ALARM_ULO_ALC_Alarm & ALARM_ALC_P1,
|
|
2540
|
+ bluecell_Currdatastatus.ALARM_ULO_ALC_Alarm & ALARM_ALC_P2,
|
|
2541
|
+ bluecell_Currdatastatus.ALARM_ULO_ALC_Alarm & ALARM_ALC_P3,
|
|
2542
|
+ bluecell_Currdatastatus.ALARM_ULO_ALC_Alarm & ALARM_ALC_P4);
|
|
2543
|
+ ALC_TEMP[0] = bluecell_Currdatastatus.MBIC_ULO_ALC_Atten1_H << 8 | bluecell_Currdatastatus.MBIC_ULO_ALC_Atten1_L;
|
|
2544
|
+ ALC_TEMP[1] = bluecell_Currdatastatus.MBIC_ULO_ALC_Atten2_H << 8 | bluecell_Currdatastatus.MBIC_ULO_ALC_Atten2_L;
|
|
2545
|
+ ALC_TEMP[2] = bluecell_Currdatastatus.MBIC_ULO_ALC_Atten3_H << 8 | bluecell_Currdatastatus.MBIC_ULO_ALC_Atten3_L;
|
|
2546
|
+ ALC_TEMP[3] = bluecell_Currdatastatus.MBIC_ULO_ALC_Atten4_H << 8 | bluecell_Currdatastatus.MBIC_ULO_ALC_Atten4_L;
|
|
2547
|
+ printf("ALC%d ATTEN : %d \r\n",1,ALC_TEMP[0]);
|
|
2548
|
+ printf("ALC%d ATTEN : %d \r\n",2,ALC_TEMP[1]);
|
|
2549
|
+ printf("ALC%d ATTEN : %d \r\n",3,ALC_TEMP[2]);
|
|
2550
|
+ printf("ALC%d ATTEN : %d \r\n",4,ALC_TEMP[3]);
|
|
2551
|
+ printf("AGC Alarm 1: %d 2: %d 3: %d 4: %d\r\n",
|
|
2552
|
+ bluecell_Currdatastatus.ALARM_DLI_AGC_Alarm & ALARM_AGC_P1,
|
|
2553
|
+ bluecell_Currdatastatus.ALARM_DLI_AGC_Alarm & ALARM_AGC_P2,
|
|
2554
|
+ bluecell_Currdatastatus.ALARM_DLI_AGC_Alarm & ALARM_AGC_P3,
|
|
2555
|
+ bluecell_Currdatastatus.ALARM_DLI_AGC_Alarm & ALARM_AGC_P4
|
|
2556
|
+ );
|
|
2557
|
+
|
|
2558
|
+ printf("Shutdown DL Alarm 1: %d 2: %d 3: %d 4: %d\r\n",
|
|
2559
|
+ bluecell_Currdatastatus.ALARM_DLI_SHTUTDOWN & ALARM_DLI_SHUTDOWN_P1,
|
|
2560
|
+ bluecell_Currdatastatus.ALARM_DLI_SHTUTDOWN & ALARM_DLI_SHUTDOWN_P2,
|
|
2561
|
+ bluecell_Currdatastatus.ALARM_DLI_SHTUTDOWN & ALARM_DLI_SHUTDOWN_P3,
|
|
2562
|
+ bluecell_Currdatastatus.ALARM_DLI_SHTUTDOWN & ALARM_DLI_SHUTDOWN_P4
|
|
2563
|
+ );
|
|
2564
|
+ printf("Shutdown UL Alarm 1: %d 2: %d 3: %d 4: %d\r\n",
|
|
2565
|
+ bluecell_Currdatastatus.ALARM_ULO_SHTUTDOWN & ALARM_ULO_SHUTDOWN_P1,
|
|
2566
|
+ bluecell_Currdatastatus.ALARM_ULO_SHTUTDOWN & ALARM_ULO_SHUTDOWN_P2,
|
|
2567
|
+ bluecell_Currdatastatus.ALARM_ULO_SHTUTDOWN & ALARM_ULO_SHUTDOWN_P3,
|
|
2568
|
+ bluecell_Currdatastatus.ALARM_ULO_SHTUTDOWN & ALARM_ULO_SHUTDOWN_P4
|
|
2569
|
+ );
|
|
2570
|
+ printf("===================END=======================\r\n");
|
|
2571
|
+
|
|
2572
|
+// printf("Level DL Alarm %d \r\n");
|
|
2573
|
+// printf("Level DL Alarm %d \r\n");
|
|
2574
|
+
|
|
2575
|
+
|
2474
|
2576
|
Uart1_Data_Send(&Txdata[0], sizeof(BLUESTATUS_st));
|
2475
|
2577
|
break;
|
2476
|
2578
|
case Bluecell_StatusSave:
|
|
@@ -3760,7 +3862,8 @@ bool MBIC_Operate(uint8_t* data){
|
3760
|
3862
|
uint8_t datatype = data[MBIC_PAYLOADSTART + 1];
|
3761
|
3863
|
// uint8_t Length = (data[MBIC_PROT_SUB_DATA_INDEX + 2]);
|
3762
|
3864
|
uint8_t cmd = data[MBIC_PROT_CMD_INDEX];
|
3763
|
|
-
|
|
3865
|
+ int16_t Tmpdata = 0;
|
|
3866
|
+ int16_t Tmpdata2 = 0;
|
3764
|
3867
|
//uint16_t Temp_ADC = 0;
|
3765
|
3868
|
//uint16_t i = 0;
|
3766
|
3869
|
//double temp = 0;
|
|
@@ -3946,6 +4049,7 @@ bool MBIC_Operate(uint8_t* data){
|
3946
|
4049
|
case DLI_Gain_Atten1 :
|
3947
|
4050
|
bluecell_Currdatastatus.ATT_DL1_H = data[MBIC_PAYLOADSTART + 3];
|
3948
|
4051
|
bluecell_Currdatastatus.ATT_DL1_L = data[MBIC_PAYLOADSTART + 4];
|
|
4052
|
+
|
3949
|
4053
|
DL_PrevIwillgiveAtten[AGC_Alarm_DL1_Index] = 0;
|
3950
|
4054
|
printf("bluecell_Currdatastatus.ATT_DL1_H : %x\r\n",bluecell_Currdatastatus.ATT_DL1_H);
|
3951
|
4055
|
printf("bluecell_Currdatastatus.ATT_DL1_L : %x\r\n",bluecell_Currdatastatus.ATT_DL1_L);
|
|
@@ -4136,6 +4240,13 @@ bool MBIC_Operate(uint8_t* data){
|
4136
|
4240
|
bluecell_Currdatastatus.ATT_UL1_H = data[MBIC_PAYLOADSTART + 3];
|
4137
|
4241
|
bluecell_Currdatastatus.ATT_UL1_L = data[MBIC_PAYLOADSTART + 4];
|
4138
|
4242
|
if(bluecell_Currdatastatus.ULO_ALC_ON_OFF == true){
|
|
4243
|
+ Tmpdata = bluecell_Currdatastatus.MBIC_ULO_ALC_Atten1_H << 8 | bluecell_Currdatastatus.MBIC_ULO_ALC_Atten1_L;
|
|
4244
|
+ Tmpdata2 = bluecell_Currdatastatus.ATT_UL1_H << 8 | bluecell_Currdatastatus.ATT_UL1_L;
|
|
4245
|
+ if(Tmpdata + Tmpdata2 <= -200){
|
|
4246
|
+ Tmpdata2 = -200 + (Tmpdata * -1);
|
|
4247
|
+ bluecell_Currdatastatus.ATT_UL1_H = ((Tmpdata2 & 0xFF00) >> 8);
|
|
4248
|
+ bluecell_Currdatastatus.ATT_UL1_L = Tmpdata2 & 0x00FF;
|
|
4249
|
+ }
|
4139
|
4250
|
UL_ALC_GainAttenSet[ALC_Alarm_UL1_Index] = true;
|
4140
|
4251
|
ALC_Level_Save[ALC_Alarm_UL1_Index] = bluecell_Currdatastatus.ULO_Level1_H << 8 | bluecell_Currdatastatus.ULO_Level1_L;
|
4141
|
4252
|
}
|
|
@@ -4146,6 +4257,13 @@ bool MBIC_Operate(uint8_t* data){
|
4146
|
4257
|
bluecell_Currdatastatus.ATT_UL2_H = data[MBIC_PAYLOADSTART + 3];
|
4147
|
4258
|
bluecell_Currdatastatus.ATT_UL2_L = data[MBIC_PAYLOADSTART + 4];
|
4148
|
4259
|
if(bluecell_Currdatastatus.ULO_ALC_ON_OFF == true){
|
|
4260
|
+ Tmpdata = bluecell_Currdatastatus.MBIC_ULO_ALC_Atten1_H << 8 | bluecell_Currdatastatus.MBIC_ULO_ALC_Atten1_L;
|
|
4261
|
+ Tmpdata2 = bluecell_Currdatastatus.ATT_UL1_H << 8 | bluecell_Currdatastatus.ATT_UL1_L;
|
|
4262
|
+ if(Tmpdata + Tmpdata2 <= -200){
|
|
4263
|
+ Tmpdata2 = -200 + (Tmpdata * -1);
|
|
4264
|
+ bluecell_Currdatastatus.ATT_UL1_H = ((Tmpdata2 & 0xFF00) >> 8);
|
|
4265
|
+ bluecell_Currdatastatus.ATT_UL1_L = Tmpdata2 & 0x00FF;
|
|
4266
|
+ }
|
4149
|
4267
|
UL_ALC_GainAttenSet[ALC_Alarm_UL2_Index] = true;
|
4150
|
4268
|
ALC_Level_Save[ALC_Alarm_UL2_Index] = bluecell_Currdatastatus.ULO_Level2_H << 8 | bluecell_Currdatastatus.ULO_Level2_L;
|
4151
|
4269
|
}
|
|
@@ -4157,6 +4275,13 @@ bool MBIC_Operate(uint8_t* data){
|
4157
|
4275
|
bluecell_Currdatastatus.ATT_UL3_H = data[MBIC_PAYLOADSTART + 3];
|
4158
|
4276
|
bluecell_Currdatastatus.ATT_UL3_L = data[MBIC_PAYLOADSTART + 4];
|
4159
|
4277
|
if(bluecell_Currdatastatus.ULO_ALC_ON_OFF == true){
|
|
4278
|
+ Tmpdata = bluecell_Currdatastatus.MBIC_ULO_ALC_Atten1_H << 8 | bluecell_Currdatastatus.MBIC_ULO_ALC_Atten1_L;
|
|
4279
|
+ Tmpdata2 = bluecell_Currdatastatus.ATT_UL1_H << 8 | bluecell_Currdatastatus.ATT_UL1_L;
|
|
4280
|
+ if(Tmpdata + Tmpdata2 <= -200){
|
|
4281
|
+ Tmpdata2 = -200 + (Tmpdata * -1);
|
|
4282
|
+ bluecell_Currdatastatus.ATT_UL1_H = ((Tmpdata2 & 0xFF00) >> 8);
|
|
4283
|
+ bluecell_Currdatastatus.ATT_UL1_L = Tmpdata2 & 0x00FF;
|
|
4284
|
+ }
|
4160
|
4285
|
UL_ALC_GainAttenSet[ALC_Alarm_UL3_Index] = true;
|
4161
|
4286
|
ALC_Level_Save[ALC_Alarm_UL3_Index] = bluecell_Currdatastatus.ULO_Level3_H << 8 | bluecell_Currdatastatus.ULO_Level3_L;
|
4162
|
4287
|
}
|
|
@@ -4168,6 +4293,13 @@ bool MBIC_Operate(uint8_t* data){
|
4168
|
4293
|
bluecell_Currdatastatus.ATT_UL4_H = data[MBIC_PAYLOADSTART + 3];
|
4169
|
4294
|
bluecell_Currdatastatus.ATT_UL4_L = data[MBIC_PAYLOADSTART + 4];
|
4170
|
4295
|
if(bluecell_Currdatastatus.ULO_ALC_ON_OFF == true){
|
|
4296
|
+ Tmpdata = bluecell_Currdatastatus.MBIC_ULO_ALC_Atten1_H << 8 | bluecell_Currdatastatus.MBIC_ULO_ALC_Atten1_L;
|
|
4297
|
+ Tmpdata2 = bluecell_Currdatastatus.ATT_UL1_H << 8 | bluecell_Currdatastatus.ATT_UL1_L;
|
|
4298
|
+ if(Tmpdata + Tmpdata2 <= -200){
|
|
4299
|
+ Tmpdata2 = -200 + (Tmpdata * -1);
|
|
4300
|
+ bluecell_Currdatastatus.ATT_UL1_H = ((Tmpdata2 & 0xFF00) >> 8);
|
|
4301
|
+ bluecell_Currdatastatus.ATT_UL1_L = Tmpdata2 & 0x00FF;
|
|
4302
|
+ }
|
4171
|
4303
|
UL_ALC_GainAttenSet[ALC_Alarm_UL4_Index] = true;
|
4172
|
4304
|
ALC_Level_Save[ALC_Alarm_UL4_Index] = bluecell_Currdatastatus.ULO_Level4_H << 8 | bluecell_Currdatastatus.ULO_Level4_L ;
|
4173
|
4305
|
}
|
|
@@ -5455,7 +5587,7 @@ int16_t ALC_Calc(uint8_t num,double CurrAtten ,int8_t threshold,double CurrDet){
|
5455
|
5587
|
return result * 10;
|
5456
|
5588
|
}
|
5457
|
5589
|
#define UL_DL_DATASEND_MULTIPLE 10
|
5458
|
|
-void ALC_Alarm_TimerSet(uint8_t num,int16_t threshold,int16_t CurrDet,int16_t Atten){
|
|
5590
|
+void ALC_Alarm_TimerSet(uint8_t num,int16_t threshold,int16_t CurrDet,int16_t Atten,int16_t MainAtten){
|
5459
|
5591
|
int16_t ret =0;
|
5460
|
5592
|
int16_t CurrAtten = 0;
|
5461
|
5593
|
CurrAtten = Atten * 0.1;
|
|
@@ -5463,7 +5595,7 @@ void ALC_Alarm_TimerSet(uint8_t num,int16_t threshold,int16_t CurrDet,int16_t At
|
5463
|
5595
|
ret = CurrDet - threshold ;
|
5464
|
5596
|
ret = Bluecell_TestPro(ret +( CurrAtten * 0.1 * -1));
|
5465
|
5597
|
ret *= -1;
|
5466
|
|
- if(CurrAtten <= -20)
|
|
5598
|
+ if(CurrAtten + (MainAtten*0.1) <= -20)
|
5467
|
5599
|
ALC_AlarmSet[num] = true;
|
5468
|
5600
|
}
|
5469
|
5601
|
else if(threshold -2 > CurrDet){
|
|
@@ -5515,13 +5647,13 @@ void ALC_Package_Operate(uint8_t*ULO_ADC_Level,uint8_t* ULO_Level,DET_TABLEUL_st
|
5515
|
5647
|
CurrentATTENVALUE = PE43711_Double(ALC_Atten[ULO_ALC_H],ALC_Atten[ULO_ALC_L]);
|
5516
|
5648
|
ULO_Level[ULO_ALC_H] = (ResultData & 0xFF00) >> 8;
|
5517
|
5649
|
ULO_Level[ULO_ALC_L] = (ResultData & 0x00FF);
|
5518
|
|
-// printf("=============ALC ON =====START================\r\n");
|
|
5650
|
+ printf("=============ALC ON =====START================\r\n");
|
5519
|
5651
|
// printf("Current UL ADC VALUE : %f \r\n",ret);
|
5520
|
|
-// printf("ResdBm : UL%d : %f \r\n",TableIndex,ResdBm);
|
|
5652
|
+ printf("ResdBm : UL%d : %f \r\n",TableIndex + 1,ResdBm);
|
5521
|
5653
|
// printf("ORIGIN ResdBm : %f %d\r\n",ResdBm,Main_Atten);
|
5522
|
5654
|
// printf("After ResdBm : %f \r\n",ResdBm);
|
5523
|
5655
|
Limitdata += (Main_Atten * 0.1);
|
5524
|
|
- ALC_Alarm_TimerSet(TableIndex,Limitdata,ResdBm,UL_Atten);
|
|
5656
|
+ ALC_Alarm_TimerSet(TableIndex,Limitdata,ResdBm,UL_Atten,Main_Atten);
|
5525
|
5657
|
IwillGiveAtten = ALC_Calc(TableIndex,CurrentATTENVALUE,Limitdata,ResdBm);
|
5526
|
5658
|
// printf("STEP 1 : I WILL GIVE ATTEN %d \r\n",IwillGiveAtten);
|
5527
|
5659
|
IwillGiveAtten += UL_Atten;
|
|
@@ -7008,6 +7140,78 @@ void DLI_ShutdownAlarmCheck(){
|
7008
|
7140
|
|
7009
|
7141
|
}
|
7010
|
7142
|
#else
|
|
7143
|
+//DL_Shutdown_Operate(DET_Alarm_DL1_Shutdown_Index,
|
|
7144
|
+// &bluecell_Currdatastatus.ATT_DL1_PATH,
|
|
7145
|
+// &bluecell_Currdatastatus.DLI_Shutdown_Retry_Count1);
|
|
7146
|
+
|
|
7147
|
+void DL_Shutdown_Operate(uint8_t index,uint8_t* path,uint8_t* retrycnt){
|
|
7148
|
+ GPIO_TypeDef *Port;
|
|
7149
|
+ uint16_t Pin;
|
|
7150
|
+
|
|
7151
|
+
|
|
7152
|
+ switch(index){
|
|
7153
|
+ case DET_Alarm_DL1_Shutdown_Index:
|
|
7154
|
+ Port = PATH_EN_DL1_GPIO_Port;
|
|
7155
|
+ Pin = PATH_EN_DL1_Pin;
|
|
7156
|
+ break;
|
|
7157
|
+ case DET_Alarm_DL2_Shutdown_Index:
|
|
7158
|
+ Port = PATH_EN_DL2_GPIO_Port;
|
|
7159
|
+ Pin = PATH_EN_DL2_Pin;
|
|
7160
|
+ break;
|
|
7161
|
+ case DET_Alarm_DL3_Shutdown_Index:
|
|
7162
|
+ Port = PATH_EN_DL3_GPIO_Port;
|
|
7163
|
+ Pin = PATH_EN_DL3_Pin;
|
|
7164
|
+ break;
|
|
7165
|
+ case DET_Alarm_DL4_Shutdown_Index:
|
|
7166
|
+ Port = PATH_EN_DL4_GPIO_Port;
|
|
7167
|
+ Pin = PATH_EN_DL4_Pin;
|
|
7168
|
+ break;
|
|
7169
|
+ }
|
|
7170
|
+ if(MBIC_DL_ShutdownCount[index] < 3
|
|
7171
|
+ && (PrevMBIC_DL_ShutdownCount[index] != MBIC_DL_ShutdownCount[index])
|
|
7172
|
+ && DET_DL_Shutdown_Off_AlarmTimerCnt[index] >= MBIC_RECOVERY_SHUTDOWN_MAINTAIN_SEC
|
|
7173
|
+ && DL_PathUserHandl[index] == false){
|
|
7174
|
+ HAL_GPIO_WritePin(Port,Pin,GPIO_PIN_SET);//CLOCK
|
|
7175
|
+ *path = true;
|
|
7176
|
+ bluecell_Prevdatastatus.ATT_DL1_H = 0xFF;
|
|
7177
|
+ bluecell_Prevdatastatus.ATT_DL1_L = 0xFF;
|
|
7178
|
+ PrevMBIC_DL_ShutdownCount[index] = MBIC_DL_ShutdownCount[index];
|
|
7179
|
+ CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);
|
|
7180
|
+ }
|
|
7181
|
+ else if(MBIC_DL_ShutdownCount[index] == 3
|
|
7182
|
+ && DET_DL_Shutdown_Off_AlarmTimerCnt[index] >= MBIC_RECOVERY_LAST_SHUTDOWN_MAINTAIN_SEC
|
|
7183
|
+ && DL_PathUserHandl[index] == false){
|
|
7184
|
+ HAL_GPIO_WritePin(Port,Pin,GPIO_PIN_SET);//CLOCK
|
|
7185
|
+ *path = true;
|
|
7186
|
+ bluecell_Prevdatastatus.ATT_DL1_H = 0xFF;
|
|
7187
|
+ bluecell_Prevdatastatus.ATT_DL1_L = 0xFF;
|
|
7188
|
+ CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);
|
|
7189
|
+ }
|
|
7190
|
+ if(DET_DL_Shutdown_On_AlarmTimerCnt[index] >= MBIC_ON_SHUTDOWN_MAINTAIN_SEC)
|
|
7191
|
+ {
|
|
7192
|
+ /*Shutdown 5sec Alarm*/
|
|
7193
|
+ HAL_GPIO_WritePin(Port,Pin,GPIO_PIN_RESET);//CLOCK
|
|
7194
|
+ printf("SHUTDOWN ON DL %d\r\n",index + 1);
|
|
7195
|
+ *path = false;
|
|
7196
|
+ (*retrycnt)++;
|
|
7197
|
+ DET_DL_Shutdown_On_AlarmTimerCnt[index] = 0;
|
|
7198
|
+
|
|
7199
|
+ if((*retrycnt) >= RETRYCNT_MAX){
|
|
7200
|
+ (*retrycnt) = RETRYCNT_MAX;
|
|
7201
|
+ bluecell_Currdatastatus.ALARM_DLI_SHTUTDOWN |= ALARM_DLI_SHUTDOWN_P1;
|
|
7202
|
+ bluecell_Currdatastatus.DLI_Shutdown_Alarm1 = true;
|
|
7203
|
+ }
|
|
7204
|
+ }
|
|
7205
|
+ else{
|
|
7206
|
+ if(DET_DL_Shutdown_Off_AlarmTimerCnt[index] >= MBIC_OFF_MAINTAIN_SEC
|
|
7207
|
+ && (*retrycnt) != RETRYCNT_MAX){
|
|
7208
|
+ bluecell_Currdatastatus.ALARM_DLI_SHTUTDOWN &= ~ALARM_DLI_SHUTDOWN_P1;
|
|
7209
|
+ bluecell_Currdatastatus.DLI_Shutdown_Alarm1 = false;
|
|
7210
|
+ }
|
|
7211
|
+ }
|
|
7212
|
+
|
|
7213
|
+
|
|
7214
|
+}
|
7011
|
7215
|
void DLI_ShutdownAlarmCheck()
|
7012
|
7216
|
{
|
7013
|
7217
|
|
|
@@ -7217,7 +7421,84 @@ void DLI_ShutdownAlarmCheck()
|
7217
|
7421
|
}
|
7218
|
7422
|
|
7219
|
7423
|
#endif // PYJ.2020.06.21_END --
|
|
7424
|
+typedef enum{
|
|
7425
|
+ UL_Shutdown_H,
|
|
7426
|
+ UL_Shutdown_L,
|
|
7427
|
+};
|
|
7428
|
+#if 0 // PYJ.2020.06.28_BEGIN --
|
|
7429
|
+UL_Shutdown_Operate(DET_Alarm_UL1_Shutdown_Index,
|
|
7430
|
+ &bluecell_Currdatastatus.ATT_UL1_PATH,
|
|
7431
|
+ &bluecell_Prevdatastatus.ATT_UL1_H,
|
|
7432
|
+ &bluecell_Currdatastatus.ULO_Shutdown_Retry_Count1,
|
|
7433
|
+ &bluecell_Currdatastatus.ULO_Shutdown_Alarm1);
|
|
7434
|
+#endif // PYJ.2020.06.28_END --
|
|
7435
|
+
|
|
7436
|
+void UL_Shutdown_Operate(uint8_t Index,uint8_t* Path,uint8_t* PrevATT,uint8_t* RetryCnt,uint8_t* ShutdownAlarm){
|
|
7437
|
+ GPIO_TypeDef *Port;
|
|
7438
|
+ uint16_t Pin;
|
|
7439
|
+
|
|
7440
|
+
|
|
7441
|
+ switch(Index){
|
|
7442
|
+ case DET_Alarm_UL1_Shutdown_Index:
|
|
7443
|
+ Port = PATH_EN_UL1_GPIO_Port;
|
|
7444
|
+ Pin = PATH_EN_UL1_Pin;
|
|
7445
|
+ break;
|
|
7446
|
+ case DET_Alarm_UL2_Shutdown_Index:
|
|
7447
|
+ Port = PATH_EN_UL2_GPIO_Port;
|
|
7448
|
+ Pin = PATH_EN_UL2_Pin;
|
|
7449
|
+ break;
|
|
7450
|
+ case DET_Alarm_UL3_Shutdown_Index:
|
|
7451
|
+ Port = PATH_EN_UL3_GPIO_Port;
|
|
7452
|
+ Pin = PATH_EN_UL3_Pin;
|
|
7453
|
+ break;
|
|
7454
|
+ case DET_Alarm_UL4_Shutdown_Index:
|
|
7455
|
+ Port = PATH_EN_UL4_GPIO_Port;
|
|
7456
|
+ Pin = PATH_EN_UL4_Pin;
|
|
7457
|
+ break;
|
7220
|
7458
|
|
|
7459
|
+ }
|
|
7460
|
+ if(MBIC_UL_ShutdownCount[Index] < 3
|
|
7461
|
+ && (PrevMBIC_UL_ShutdownCount[Index] != MBIC_UL_ShutdownCount[Index])
|
|
7462
|
+ && DET_UL_Shutdown_Off_AlarmTimerCnt[Index] >= MBIC_RECOVERY_SHUTDOWN_MAINTAIN_SEC){
|
|
7463
|
+ HAL_GPIO_WritePin(Port,Pin,GPIO_PIN_SET);//CLOCK
|
|
7464
|
+ *Path = true;
|
|
7465
|
+ PrevATT[UL_Shutdown_H] = 0xFF;
|
|
7466
|
+ PrevATT[UL_Shutdown_L] = 0xFF;
|
|
7467
|
+ PrevMBIC_UL_ShutdownCount[Index] = MBIC_UL_ShutdownCount[Index];
|
|
7468
|
+ CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);
|
|
7469
|
+ }
|
|
7470
|
+ else if(MBIC_UL_ShutdownCount[Index] == 3
|
|
7471
|
+ && DET_UL_Shutdown_Off_AlarmTimerCnt[Index] >= MBIC_RECOVERY_LAST_SHUTDOWN_MAINTAIN_SEC){
|
|
7472
|
+ HAL_GPIO_WritePin(Port,Pin,GPIO_PIN_SET);//CLOCK
|
|
7473
|
+ *Path = true;
|
|
7474
|
+ PrevATT[UL_Shutdown_H] = 0xFF;
|
|
7475
|
+ PrevATT[UL_Shutdown_L] = 0xFF;
|
|
7476
|
+ CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);
|
|
7477
|
+ }
|
|
7478
|
+ if(DET_UL_Shutdown_On_AlarmTimerCnt[Index] >= MBIC_ON_SHUTDOWN_MAINTAIN_SEC)
|
|
7479
|
+ {
|
|
7480
|
+ /*Shutdown 5sec Alarm*/
|
|
7481
|
+ HAL_GPIO_WritePin(Port,Pin,GPIO_PIN_RESET);//CLOCK
|
|
7482
|
+ *Path = false;
|
|
7483
|
+ (*RetryCnt)++;
|
|
7484
|
+ DET_UL_Shutdown_On_AlarmTimerCnt[Index] = 0;
|
|
7485
|
+
|
|
7486
|
+ if((*RetryCnt) >= RETRYCNT_MAX){
|
|
7487
|
+ (*RetryCnt) = RETRYCNT_MAX;
|
|
7488
|
+ bluecell_Currdatastatus.ALARM_ULO_SHTUTDOWN |= ALARM_ULO_SHUTDOWN_P1;
|
|
7489
|
+ *ShutdownAlarm = true;
|
|
7490
|
+ }else{
|
|
7491
|
+ }
|
|
7492
|
+
|
|
7493
|
+ }
|
|
7494
|
+ else{
|
|
7495
|
+ if(DET_UL_Shutdown_Off_AlarmTimerCnt[Index] >= MBIC_OFF_MAINTAIN_SEC
|
|
7496
|
+ && (*RetryCnt) != RETRYCNT_MAX){
|
|
7497
|
+ bluecell_Currdatastatus.ALARM_ULO_SHTUTDOWN &= ~ALARM_ULO_SHUTDOWN_P1;
|
|
7498
|
+ *ShutdownAlarm = false;
|
|
7499
|
+ }
|
|
7500
|
+ }
|
|
7501
|
+}
|
7221
|
7502
|
|
7222
|
7503
|
void ULO_ShutdownAlarmCheck(){
|
7223
|
7504
|
// double temp = 0;
|
|
@@ -7378,10 +7659,10 @@ void ULO_ShutdownAlarmCheck(){
|
7378
|
7659
|
/*Shutdown 5sec Alarm*/
|
7379
|
7660
|
HAL_GPIO_WritePin(PATH_EN_UL2_GPIO_Port,PATH_EN_UL2_Pin,GPIO_PIN_RESET);//CLOCK
|
7380
|
7661
|
bluecell_Currdatastatus.ATT_UL2_PATH = false;
|
7381
|
|
- printf("UL SHUTDOWN RECOVERY OPERATE PATH OFF\r\n");
|
|
7662
|
+// printf("UL SHUTDOWN RECOVERY OPERATE PATH OFF\r\n");
|
7382
|
7663
|
bluecell_Currdatastatus.ULO_Shutdown_Retry_Count2++;
|
7383
|
7664
|
DET_UL_Shutdown_On_AlarmTimerCnt[DET_Alarm_UL2_Shutdown_Index] = 0;
|
7384
|
|
- printf("Shutdown Operate UL2 ============== bluecell_Currdatastatus.ULO_Shutdown_Retry_Count2 : %d \r\n",bluecell_Currdatastatus.ULO_Shutdown_Retry_Count2);
|
|
7665
|
+// printf("Shutdown Operate UL2 ============== bluecell_Currdatastatus.ULO_Shutdown_Retry_Count2 : %d \r\n",bluecell_Currdatastatus.ULO_Shutdown_Retry_Count2);
|
7385
|
7666
|
|
7386
|
7667
|
if(bluecell_Currdatastatus.ULO_Shutdown_Retry_Count2 >= RETRYCNT_MAX){
|
7387
|
7668
|
bluecell_Currdatastatus.ULO_Shutdown_Retry_Count2 = RETRYCNT_MAX;
|
|
@@ -7619,13 +7900,13 @@ void ULO_ALCAlarmCheck(){
|
7619
|
7900
|
bluecell_Currdatastatus.ULO_ALC_Alarm3 = false;
|
7620
|
7901
|
}
|
7621
|
7902
|
}
|
7622
|
|
- if(ALC_AlarmSet[ALC_Alarm_UL3_Index] == true
|
7623
|
|
- &&ALC_On_AlarmTimerCnt[ALC_Alarm_UL3_Index] >= MBIC_ON_MAINTAIN_SEC){
|
|
7903
|
+ if(ALC_AlarmSet[ALC_Alarm_UL4_Index] == true
|
|
7904
|
+ &&ALC_On_AlarmTimerCnt[ALC_Alarm_UL4_Index] >= MBIC_ON_MAINTAIN_SEC){
|
7624
|
7905
|
// printf("ALARM_ALC_P4 OCCUR\r\n");
|
7625
|
7906
|
bluecell_Currdatastatus.ALARM_ULO_ALC_Alarm |= ALARM_ALC_P4;
|
7626
|
7907
|
bluecell_Currdatastatus.ULO_ALC_Alarm4 = true;
|
7627
|
7908
|
}else{
|
7628
|
|
- if(ALC_Off_AlarmTimerCnt[ALC_Alarm_UL3_Index] >= MBIC_OFF_MAINTAIN_SEC){
|
|
7909
|
+ if(ALC_Off_AlarmTimerCnt[ALC_Alarm_UL4_Index] >= MBIC_OFF_MAINTAIN_SEC){
|
7629
|
7910
|
bluecell_Currdatastatus.ALARM_ULO_ALC_Alarm &= ~ALARM_ALC_P4;
|
7630
|
7911
|
bluecell_Currdatastatus.ULO_ALC_Alarm4 = false;
|
7631
|
7912
|
}
|