|
@@ -93,6 +93,9 @@ volatile uint32_t DET_DL_High_On_AlarmTimerCnt[DET_Alarm_DL_Index_MAX] = {0,};
|
93
|
93
|
volatile uint32_t DET_DL_Low_Off_AlarmTimerCnt[DET_Alarm_DL_Index_MAX] = {0,};
|
94
|
94
|
volatile uint32_t DET_DL_High_Off_AlarmTimerCnt[DET_Alarm_DL_Index_MAX] = {0,};
|
95
|
95
|
|
|
96
|
+volatile uint32_t DET_DL_Normal_Shutdown_On_AlarmTimerCnt[DET_Alarm_UL_Index_MAX] = {0,};
|
|
97
|
+volatile uint32_t DET_UL_Normal_Shutdown_On_AlarmTimerCnt[DET_Alarm_UL_Index_MAX] = {0,};
|
|
98
|
+
|
96
|
99
|
|
97
|
100
|
volatile uint32_t DET_UL_Shutdown_On_AlarmTimerCnt[DET_Alarm_UL_Index_MAX] = {0,};
|
98
|
101
|
volatile uint32_t DET_UL_Shutdown_Off_AlarmTimerCnt[DET_Alarm_UL_Index_MAX] = {0,};
|
|
@@ -105,8 +108,26 @@ volatile uint32_t AlarmTimerOffCnt = 0;
|
105
|
108
|
volatile uint32_t AlarmTimerOnCnt = 0;
|
106
|
109
|
|
107
|
110
|
|
|
111
|
+volatile uint32_t Alarm_Temp_TimerOffCnt = 0;
|
|
112
|
+volatile uint32_t Alarm_Temp_TimerOnCnt = 0;
|
|
113
|
+
|
|
114
|
+volatile uint32_t Alarm_DL_Level_TimerOffCnt = 0;
|
|
115
|
+volatile uint32_t Alarm_DL_Level_TimerOnCnt = 0;
|
|
116
|
+
|
|
117
|
+volatile uint32_t Alarm_UL_Level_TimerOffCnt = 0;
|
|
118
|
+volatile uint32_t Alarm_UL_Level_TimerOnCnt = 0;
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
108
|
127
|
volatile bool AlarmTimerOnSet = 0;
|
109
|
128
|
volatile bool AlarmTimerOffSet = 0;
|
|
129
|
+
|
|
130
|
+
|
110
|
131
|
//extern bool AGC_AlarmTimerSet[AGC_Alarm_DL_Index_MAX];
|
111
|
132
|
extern bool ADC_Alarm_DL_High_Set[DET_Alarm_DL_Index_MAX];
|
112
|
133
|
extern bool ADC_Alarm_DL_Low_Set[DET_Alarm_DL_Index_MAX];
|
|
@@ -116,6 +137,13 @@ extern uint8_t ALC_AlarmSet[ALC_Alarm_UL_Index_MAX];
|
116
|
137
|
extern bool AGC_AlarmSet[AGC_Alarm_DL_Index_MAX];
|
117
|
138
|
extern bool ADC_Alarm_UL_Shutdown_Set[DET_Alarm_UL_Shutdown_Index_MAX];
|
118
|
139
|
extern bool ADC_Alarm_DL_Shutdown_Set[DET_Alarm_DL_Shutdown_Index_MAX];
|
|
140
|
+extern bool ADC_Alarm_DL_Normal_Shutdown_Set[DET_Alarm_DL_Shutdown_Index_MAX];
|
|
141
|
+extern bool ADC_Alarm_UL_Normal_Shutdown_Set[DET_Alarm_UL_Shutdown_Index_MAX];
|
|
142
|
+uint8_t* MBIC_UL_ShutdownCount;
|
|
143
|
+uint8_t* MBIC_DL_ShutdownCount;
|
|
144
|
+uint8_t* PrevMBIC_UL_ShutdownCount;
|
|
145
|
+uint8_t* PrevMBIC_DL_ShutdownCount;
|
|
146
|
+
|
119
|
147
|
|
120
|
148
|
/* USER CODE END PV */
|
121
|
149
|
|
|
@@ -921,22 +949,52 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
|
921
|
949
|
ALCTimerCnt++;
|
922
|
950
|
AGCTimerCnt++;
|
923
|
951
|
|
924
|
|
-
|
925
|
|
- if(ADC_Alarm_UL_Shutdown_Set[DET_Alarm_UL1_Shutdown_Index] == true){
|
926
|
|
- DET_UL_Shutdown_Off_AlarmTimerCnt[ALC_Alarm_UL1_Index] = 0;
|
927
|
|
- DET_UL_Shutdown_On_AlarmTimerCnt[ALC_Alarm_UL1_Index]++;
|
928
|
|
- if(DET_UL_Shutdown_On_AlarmTimerCnt[ALC_Alarm_UL1_Index] == 0xFFFFFFFF){
|
929
|
|
- DET_UL_Shutdown_On_AlarmTimerCnt[ALC_Alarm_UL1_Index] = MBIC_ON_MAINTAIN_SEC;
|
930
|
|
- }
|
931
|
|
- }else{
|
932
|
|
- DET_UL_Shutdown_On_AlarmTimerCnt[ALC_Alarm_UL1_Index] = 0;
|
933
|
|
- DET_UL_Shutdown_Off_AlarmTimerCnt[ALC_Alarm_UL1_Index]++;
|
934
|
|
- if(DET_UL_Shutdown_Off_AlarmTimerCnt[ALC_Alarm_UL1_Index] == 0xFFFFFFFF){
|
935
|
|
- DET_UL_Shutdown_Off_AlarmTimerCnt[ALC_Alarm_UL1_Index] = MBIC_OFF_MAINTAIN_SEC;
|
936
|
|
- }
|
937
|
|
-
|
938
|
|
-
|
939
|
|
- }
|
|
952
|
+ for(int i = 0; i < DET_Alarm_UL_Shutdown_Index_MAX; i++){
|
|
953
|
+ if(ADC_Alarm_UL_Shutdown_Set[DET_Alarm_UL1_Shutdown_Index + i] == true){
|
|
954
|
+ DET_UL_Shutdown_Off_AlarmTimerCnt[DET_Alarm_UL1_Shutdown_Index + i] = 0; // OFF CNT = 0;
|
|
955
|
+ DET_UL_Shutdown_On_AlarmTimerCnt[DET_Alarm_UL1_Shutdown_Index + i]++;
|
|
956
|
+ if(DET_UL_Shutdown_On_AlarmTimerCnt[DET_Alarm_UL1_Shutdown_Index + i] == 0xFFFFFFFF){
|
|
957
|
+ DET_UL_Shutdown_On_AlarmTimerCnt[DET_Alarm_UL1_Shutdown_Index + i] = MBIC_ON_MAINTAIN_SEC;
|
|
958
|
+ }
|
|
959
|
+ }else{
|
|
960
|
+ DET_UL_Shutdown_On_AlarmTimerCnt[DET_Alarm_UL1_Shutdown_Index + i] = 0;
|
|
961
|
+ DET_UL_Shutdown_Off_AlarmTimerCnt[DET_Alarm_UL1_Shutdown_Index + i]++;
|
|
962
|
+ if(DET_UL_Shutdown_Off_AlarmTimerCnt[DET_Alarm_UL1_Shutdown_Index + i] == 0xFFFFFFFF){
|
|
963
|
+ DET_UL_Shutdown_Off_AlarmTimerCnt[DET_Alarm_UL1_Shutdown_Index + i] = MBIC_RECOVERY_SHUTDOWN_MAINTAIN_SEC;
|
|
964
|
+ }
|
|
965
|
+ }
|
|
966
|
+ if(ADC_Alarm_UL_Normal_Shutdown_Set[DET_Alarm_UL1_Shutdown_Index + i] == true){
|
|
967
|
+ DET_UL_Normal_Shutdown_On_AlarmTimerCnt[DET_Alarm_UL1_Shutdown_Index + i]++;
|
|
968
|
+ if(DET_UL_Normal_Shutdown_On_AlarmTimerCnt[DET_Alarm_UL1_Shutdown_Index + i] == 0xFFFFFFFF){
|
|
969
|
+ DET_UL_Normal_Shutdown_On_AlarmTimerCnt[DET_Alarm_UL1_Shutdown_Index + i] = MBIC_OFF_MAINTAIN_SEC;
|
|
970
|
+ }
|
|
971
|
+ }else{
|
|
972
|
+ DET_UL_Normal_Shutdown_On_AlarmTimerCnt[DET_Alarm_UL1_Shutdown_Index + i] = 0;
|
|
973
|
+ }
|
|
974
|
+ }
|
|
975
|
+ for(int i = 0; i < DET_Alarm_DL_Shutdown_Index_MAX; i++){
|
|
976
|
+ if(ADC_Alarm_DL_Shutdown_Set[DET_Alarm_DL1_Shutdown_Index + i] == true){
|
|
977
|
+ DET_DL_Shutdown_Off_AlarmTimerCnt[DET_Alarm_DL1_Shutdown_Index + i] = 0; // OFF CNT = 0;
|
|
978
|
+ DET_DL_Shutdown_On_AlarmTimerCnt[DET_Alarm_DL1_Shutdown_Index + i]++;
|
|
979
|
+ if(DET_DL_Shutdown_On_AlarmTimerCnt[DET_Alarm_DL1_Shutdown_Index + i] == 0xFFFFFFFF){
|
|
980
|
+ DET_DL_Shutdown_On_AlarmTimerCnt[DET_Alarm_DL1_Shutdown_Index + i] = MBIC_ON_MAINTAIN_SEC;
|
|
981
|
+ }
|
|
982
|
+ }else{
|
|
983
|
+ DET_DL_Shutdown_On_AlarmTimerCnt[DET_Alarm_DL1_Shutdown_Index + i] = 0;
|
|
984
|
+ DET_DL_Shutdown_Off_AlarmTimerCnt[DET_Alarm_DL1_Shutdown_Index + i]++;
|
|
985
|
+ if(DET_DL_Shutdown_Off_AlarmTimerCnt[DET_Alarm_DL1_Shutdown_Index + i] == 0xFFFFFFFF){
|
|
986
|
+ DET_DL_Shutdown_Off_AlarmTimerCnt[DET_Alarm_DL1_Shutdown_Index + i] = MBIC_RECOVERY_SHUTDOWN_MAINTAIN_SEC;
|
|
987
|
+ }
|
|
988
|
+ }
|
|
989
|
+ if(ADC_Alarm_DL_Normal_Shutdown_Set[DET_Alarm_DL1_Shutdown_Index + i] == true){
|
|
990
|
+ DET_DL_Normal_Shutdown_On_AlarmTimerCnt[DET_Alarm_DL1_Shutdown_Index + i]++;
|
|
991
|
+ if(DET_DL_Normal_Shutdown_On_AlarmTimerCnt[DET_Alarm_DL1_Shutdown_Index + i] == 0xFFFFFFFF){
|
|
992
|
+ DET_DL_Normal_Shutdown_On_AlarmTimerCnt[DET_Alarm_DL1_Shutdown_Index + i] = MBIC_OFF_MAINTAIN_SEC;
|
|
993
|
+ }
|
|
994
|
+ }else{
|
|
995
|
+ DET_DL_Normal_Shutdown_On_AlarmTimerCnt[DET_Alarm_DL1_Shutdown_Index + i] = 0;
|
|
996
|
+ }
|
|
997
|
+ }
|
940
|
998
|
/*ALC Alarm timer start*/
|
941
|
999
|
if(ALC_AlarmSet[ALC_Alarm_UL1_Index] == true){
|
942
|
1000
|
ALC_Off_AlarmTimerCnt[ALC_Alarm_UL1_Index] = 0;
|
|
@@ -1286,7 +1344,7 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
|
1286
|
1344
|
#endif // PYJ.2020.06.19_END --
|
1287
|
1345
|
|
1288
|
1346
|
|
1289
|
|
- /*3 Sec Time Cnt */
|
|
1347
|
+ /*3 Sec Time Cnt */
|
1290
|
1348
|
|
1291
|
1349
|
if(AlarmTimerOnSet == true){
|
1292
|
1350
|
if(AlarmTimerOnCnt == 0xFFFFFFFF)
|
|
@@ -1311,6 +1369,99 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
|
1311
|
1369
|
else{
|
1312
|
1370
|
AlarmTimerOffCnt = 0;
|
1313
|
1371
|
}
|
|
1372
|
+
|
|
1373
|
+
|
|
1374
|
+ if(AlarmTimerOnSet == true){
|
|
1375
|
+ if(AlarmTimerOnCnt == 0xFFFFFFFF)
|
|
1376
|
+ AlarmTimerOnCnt = MBIC_ON_MAINTAIN_SEC;
|
|
1377
|
+ else{
|
|
1378
|
+ AlarmTimerOnCnt++;
|
|
1379
|
+ }
|
|
1380
|
+ }
|
|
1381
|
+ else{
|
|
1382
|
+ AlarmTimerOnCnt = 0;
|
|
1383
|
+ }
|
|
1384
|
+
|
|
1385
|
+
|
|
1386
|
+ /*10 Sec Time Cnt*/
|
|
1387
|
+ if(bluecell_Currdatastatus.Temp_High_Alarm == false){
|
|
1388
|
+ if(Alarm_Temp_TimerOffCnt >= 0xFFFFFFFF){
|
|
1389
|
+ Alarm_Temp_TimerOffCnt = MBIC_OFF_MAINTAIN_SEC;
|
|
1390
|
+ }
|
|
1391
|
+ else{
|
|
1392
|
+ Alarm_Temp_TimerOffCnt++;
|
|
1393
|
+ }
|
|
1394
|
+ }
|
|
1395
|
+ else{
|
|
1396
|
+ Alarm_Temp_TimerOffCnt = 0;
|
|
1397
|
+ }
|
|
1398
|
+
|
|
1399
|
+
|
|
1400
|
+ if(bluecell_Currdatastatus.Temp_High_Alarm == true){
|
|
1401
|
+ if(Alarm_Temp_TimerOnCnt >= 0xFFFFFFFF){
|
|
1402
|
+ Alarm_Temp_TimerOnCnt = MBIC_ON_MAINTAIN_SEC;
|
|
1403
|
+ }
|
|
1404
|
+ else{
|
|
1405
|
+ Alarm_Temp_TimerOnCnt++;
|
|
1406
|
+ }
|
|
1407
|
+ }
|
|
1408
|
+ else{
|
|
1409
|
+ Alarm_Temp_TimerOnCnt = 0;
|
|
1410
|
+ }
|
|
1411
|
+
|
|
1412
|
+
|
|
1413
|
+
|
|
1414
|
+
|
|
1415
|
+
|
|
1416
|
+
|
|
1417
|
+
|
|
1418
|
+ /*10 Sec Time Cnt*/
|
|
1419
|
+ if(Alarm_DL_Level_TimerOffCnt == true){
|
|
1420
|
+ if(Alarm_DL_Level_TimerOffCnt == 0xFFFFFFFF)
|
|
1421
|
+ Alarm_DL_Level_TimerOffCnt = MBIC_OFF_MAINTAIN_SEC;
|
|
1422
|
+ else{
|
|
1423
|
+ Alarm_DL_Level_TimerOffCnt++;
|
|
1424
|
+ }
|
|
1425
|
+ }
|
|
1426
|
+ else{
|
|
1427
|
+ Alarm_DL_Level_TimerOffCnt = 0;
|
|
1428
|
+ }
|
|
1429
|
+
|
|
1430
|
+
|
|
1431
|
+ if(Alarm_DL_Level_TimerOnCnt == true){
|
|
1432
|
+ if(Alarm_DL_Level_TimerOnCnt == 0xFFFFFFFF)
|
|
1433
|
+ Alarm_DL_Level_TimerOnCnt = MBIC_ON_MAINTAIN_SEC;
|
|
1434
|
+ else{
|
|
1435
|
+ Alarm_DL_Level_TimerOnCnt++;
|
|
1436
|
+ }
|
|
1437
|
+ }
|
|
1438
|
+ else{
|
|
1439
|
+ Alarm_DL_Level_TimerOnCnt = 0;
|
|
1440
|
+ }
|
|
1441
|
+
|
|
1442
|
+ /*10 Sec Time Cnt*/
|
|
1443
|
+ if(Alarm_UL_Level_TimerOffCnt == true){
|
|
1444
|
+ if(Alarm_UL_Level_TimerOffCnt == 0xFFFFFFFF)
|
|
1445
|
+ Alarm_UL_Level_TimerOffCnt = MBIC_OFF_MAINTAIN_SEC;
|
|
1446
|
+ else{
|
|
1447
|
+ Alarm_UL_Level_TimerOffCnt++;
|
|
1448
|
+ }
|
|
1449
|
+ }
|
|
1450
|
+ else{
|
|
1451
|
+ Alarm_UL_Level_TimerOffCnt = 0;
|
|
1452
|
+ }
|
|
1453
|
+
|
|
1454
|
+
|
|
1455
|
+ if(Alarm_DL_Level_TimerOnCnt == true){
|
|
1456
|
+ if(Alarm_UL_Level_TimerOnCnt == 0xFFFFFFFF)
|
|
1457
|
+ Alarm_UL_Level_TimerOnCnt = MBIC_ON_MAINTAIN_SEC;
|
|
1458
|
+ else{
|
|
1459
|
+ Alarm_UL_Level_TimerOnCnt++;
|
|
1460
|
+ }
|
|
1461
|
+ }
|
|
1462
|
+ else{
|
|
1463
|
+ Alarm_UL_Level_TimerOnCnt = 0;
|
|
1464
|
+ }
|
1314
|
1465
|
}
|
1315
|
1466
|
/* USER CODE END Callback 1 */
|
1316
|
1467
|
}
|