|
@@ -78,6 +78,9 @@ extern volatile uint32_t Alarm_DL_Level_TimerOnCnt ;
|
78
|
78
|
extern volatile uint32_t Alarm_UL_Level_TimerOffCnt ;
|
79
|
79
|
extern volatile uint32_t Alarm_UL_Level_TimerOnCnt ;
|
80
|
80
|
|
|
81
|
+extern volatile uint32_t SelfTestLifeCnt[4];
|
|
82
|
+
|
|
83
|
+
|
81
|
84
|
/***************************************************************************************/
|
82
|
85
|
/* Function */
|
83
|
86
|
/***************************************************************************************/
|
|
@@ -3487,7 +3490,7 @@ uint32_t MBIC_DataSend(uint8_t* data){
|
3487
|
3490
|
uint32_t Length = 0;
|
3488
|
3491
|
uint16_t Crcret = 0;
|
3489
|
3492
|
int16_t tmpdata = 0;
|
3490
|
|
- uint32_t HeaderLength = 75;
|
|
3493
|
+ uint32_t HeaderLength = 79;
|
3491
|
3494
|
|
3492
|
3495
|
|
3493
|
3496
|
|
|
@@ -4182,6 +4185,26 @@ uint32_t MBIC_DataSend(uint8_t* data){
|
4182
|
4185
|
data[MBIC_PAYLOADSTART + i++] = (tmpdata & 0x00FF);
|
4183
|
4186
|
|
4184
|
4187
|
|
|
4188
|
+ data[MBIC_PAYLOADSTART + i++] = MBIC_AID;
|
|
4189
|
+ data[MBIC_PAYLOADSTART + i++] = ULO_SelfTest1;
|
|
4190
|
+ data[MBIC_PAYLOADSTART + i++] = 1; // LENGTH
|
|
4191
|
+ Length += 1 ;
|
|
4192
|
+ data[MBIC_PAYLOADSTART + i++] = bluecell_Currdatastatus.Selftest1;
|
|
4193
|
+ data[MBIC_PAYLOADSTART + i++] = MBIC_AID;
|
|
4194
|
+ data[MBIC_PAYLOADSTART + i++] = ULO_SelfTest2;
|
|
4195
|
+ data[MBIC_PAYLOADSTART + i++] = 1; // LENGTH
|
|
4196
|
+ Length += 1 ;
|
|
4197
|
+ data[MBIC_PAYLOADSTART + i++] = bluecell_Currdatastatus.Selftest2;
|
|
4198
|
+ data[MBIC_PAYLOADSTART + i++] = MBIC_AID;
|
|
4199
|
+ data[MBIC_PAYLOADSTART + i++] = ULO_SelfTest3;
|
|
4200
|
+ data[MBIC_PAYLOADSTART + i++] = 1; // LENGTH
|
|
4201
|
+ Length += 1 ;
|
|
4202
|
+ data[MBIC_PAYLOADSTART + i++] = bluecell_Currdatastatus.Selftest3;
|
|
4203
|
+ data[MBIC_PAYLOADSTART + i++] = MBIC_AID;
|
|
4204
|
+ data[MBIC_PAYLOADSTART + i++] = ULO_SelfTest4;
|
|
4205
|
+ data[MBIC_PAYLOADSTART + i++] = 1; // LENGTH
|
|
4206
|
+ Length += 1 ;
|
|
4207
|
+ data[MBIC_PAYLOADSTART + i++] = bluecell_Currdatastatus.Selftest4;
|
4185
|
4208
|
|
4186
|
4209
|
|
4187
|
4210
|
|
|
@@ -5403,6 +5426,50 @@ bool MBIC_Operate(uint8_t* data){
|
5403
|
5426
|
bluecell_Currdatastatus.ULO_Level_High_Threshold_L = ((tempdata & 0x00FF));
|
5404
|
5427
|
// bluecell_Currdatastatus.ULO_Level_High_Threshold_default = data[MBIC_PAYLOADSTART + 3];
|
5405
|
5428
|
break;
|
|
5429
|
+ case ULO_SelfTest1:
|
|
5430
|
+ if(data[MBIC_PAYLOADSTART + 3]==0){
|
|
5431
|
+ HAL_GPIO_WritePin(_PATH_SW1_GPIO_Port,_PATH_SW1_Pin,GPIO_PIN_RESET);//CLOCK
|
|
5432
|
+ HAL_GPIO_WritePin(PATH_SW1_GPIO_Port,PATH_SW1_Pin,GPIO_PIN_SET);//CLOCK
|
|
5433
|
+ }
|
|
5434
|
+ else{
|
|
5435
|
+ HAL_GPIO_WritePin(_PATH_SW1_GPIO_Port,_PATH_SW1_Pin,GPIO_PIN_SET);//CLOCK
|
|
5436
|
+ HAL_GPIO_WritePin(PATH_SW1_GPIO_Port,PATH_SW1_Pin,GPIO_PIN_RESET);//CLOCK
|
|
5437
|
+ }
|
|
5438
|
+ bluecell_Currdatastatus.Selftest1 = data[MBIC_PAYLOADSTART + 3];
|
|
5439
|
+ break;
|
|
5440
|
+ case ULO_SelfTest2:
|
|
5441
|
+ if(data[MBIC_PAYLOADSTART + 3]==0){
|
|
5442
|
+ HAL_GPIO_WritePin(_PATH_SW2_GPIO_Port,_PATH_SW2_Pin,GPIO_PIN_RESET);//CLOCK
|
|
5443
|
+ HAL_GPIO_WritePin(PATH_SW2_GPIO_Port,PATH_SW2_Pin,GPIO_PIN_SET);//CLOCK
|
|
5444
|
+ }
|
|
5445
|
+ else{
|
|
5446
|
+ HAL_GPIO_WritePin(_PATH_SW2_GPIO_Port,_PATH_SW2_Pin,GPIO_PIN_SET);//CLOCK
|
|
5447
|
+ HAL_GPIO_WritePin(PATH_SW2_GPIO_Port,PATH_SW2_Pin,GPIO_PIN_RESET);//CLOCK
|
|
5448
|
+ }
|
|
5449
|
+ bluecell_Currdatastatus.Selftest2 = data[MBIC_PAYLOADSTART + 3];
|
|
5450
|
+ break;
|
|
5451
|
+ case ULO_SelfTest3:
|
|
5452
|
+ if(data[MBIC_PAYLOADSTART + 3]==0){
|
|
5453
|
+ HAL_GPIO_WritePin(_PATH_SW3_GPIO_Port,_PATH_SW3_Pin,GPIO_PIN_RESET);//CLOCK
|
|
5454
|
+ HAL_GPIO_WritePin(PATH_SW3_GPIO_Port,PATH_SW3_Pin,GPIO_PIN_SET);//CLOCK
|
|
5455
|
+ }
|
|
5456
|
+ else{
|
|
5457
|
+ HAL_GPIO_WritePin(_PATH_SW3_GPIO_Port,_PATH_SW3_Pin,GPIO_PIN_SET);//CLOCK
|
|
5458
|
+ HAL_GPIO_WritePin(PATH_SW3_GPIO_Port,PATH_SW3_Pin,GPIO_PIN_RESET);//CLOCK
|
|
5459
|
+ }
|
|
5460
|
+ bluecell_Currdatastatus.Selftest3 = data[MBIC_PAYLOADSTART + 3];
|
|
5461
|
+ break;
|
|
5462
|
+ case ULO_SelfTest4:
|
|
5463
|
+ if(data[MBIC_PAYLOADSTART + 3]==0){
|
|
5464
|
+ HAL_GPIO_WritePin(_PATH_SW4_GPIO_Port,_PATH_SW4_Pin,GPIO_PIN_RESET);//CLOCK
|
|
5465
|
+ HAL_GPIO_WritePin(PATH_SW4_GPIO_Port,PATH_SW4_Pin,GPIO_PIN_SET);//CLOCK
|
|
5466
|
+ }
|
|
5467
|
+ else{
|
|
5468
|
+ HAL_GPIO_WritePin(_PATH_SW4_GPIO_Port,_PATH_SW4_Pin,GPIO_PIN_SET);//CLOCK
|
|
5469
|
+ HAL_GPIO_WritePin(PATH_SW4_GPIO_Port,PATH_SW4_Pin,GPIO_PIN_RESET);//CLOCK
|
|
5470
|
+ }
|
|
5471
|
+ bluecell_Currdatastatus.Selftest4 = data[MBIC_PAYLOADSTART + 3];
|
|
5472
|
+ break;
|
5406
|
5473
|
case ULO_ALC_ON_OFF :
|
5407
|
5474
|
bluecell_Currdatastatus.ULO_ALC_ON_OFF = data[MBIC_PAYLOADSTART + 3];
|
5408
|
5475
|
if(bluecell_Currdatastatus.ULO_ALC_ON_OFF == 0)
|
|
@@ -9397,8 +9464,62 @@ void FRBT_Tracking_Package(uint8_t Index, uint8_t* FRBT,uint8_t* DL_MainAtten,ui
|
9397
|
9464
|
FRBT[FRBT_L] = DL_MainAtten[FRBT_L];
|
9398
|
9465
|
|
9399
|
9466
|
}
|
9400
|
|
-
|
9401
|
|
-
|
|
9467
|
+typedef enum{
|
|
9468
|
+ SelfTest1 = 0,
|
|
9469
|
+ SelfTest2,
|
|
9470
|
+ SelfTest3,
|
|
9471
|
+ SelfTest4,
|
|
9472
|
+};
|
|
9473
|
+void SelfTest_TimerOff(uint8_t num,uint8_t* selftest){
|
|
9474
|
+ GPIO_TypeDef *Port = 0;
|
|
9475
|
+ uint16_t Pin = 0;
|
|
9476
|
+ GPIO_TypeDef *_Port = 0;
|
|
9477
|
+ uint16_t _Pin = 0;
|
|
9478
|
+ if(SelfTestLifeCnt[0] < MBIC_RECOVERY_LAST_SHUTDOWN_MAINTAIN_SEC){
|
|
9479
|
+ return;
|
|
9480
|
+ }
|
|
9481
|
+ switch(num){
|
|
9482
|
+ case SelfTest1:
|
|
9483
|
+ _Port = _PATH_SW1_GPIO_Port;
|
|
9484
|
+ _Pin = _PATH_SW1_Pin;
|
|
9485
|
+
|
|
9486
|
+ Port = PATH_SW1_GPIO_Port;
|
|
9487
|
+ Pin = PATH_SW1_Pin;
|
|
9488
|
+ break;
|
|
9489
|
+ case SelfTest2:
|
|
9490
|
+ _Port = _PATH_SW2_GPIO_Port;
|
|
9491
|
+ _Pin = _PATH_SW2_Pin;
|
|
9492
|
+
|
|
9493
|
+ Port = PATH_SW2_GPIO_Port;
|
|
9494
|
+ Pin = PATH_SW2_Pin;
|
|
9495
|
+ break;
|
|
9496
|
+ case SelfTest3:
|
|
9497
|
+ _Port = _PATH_SW3_GPIO_Port;
|
|
9498
|
+ _Pin = _PATH_SW3_Pin;
|
|
9499
|
+
|
|
9500
|
+ Port = PATH_SW3_GPIO_Port;
|
|
9501
|
+ Pin = PATH_SW3_Pin;
|
|
9502
|
+ break;
|
|
9503
|
+ case SelfTest4:
|
|
9504
|
+ _Port = _PATH_SW4_GPIO_Port;
|
|
9505
|
+ _Pin = _PATH_SW4_Pin;
|
|
9506
|
+
|
|
9507
|
+ Port = PATH_SW4_GPIO_Port;
|
|
9508
|
+ Pin = PATH_SW4_Pin;
|
|
9509
|
+ break;
|
|
9510
|
+ }
|
|
9511
|
+ *selftest = false;
|
|
9512
|
+ HAL_GPIO_WritePin(_Port,_Pin,GPIO_PIN_RESET);//CLOCK
|
|
9513
|
+ HAL_GPIO_WritePin(Port,Pin,GPIO_PIN_SET);//CLOCK
|
|
9514
|
+
|
|
9515
|
+}
|
|
9516
|
+void SelfTestTimer_Operate()
|
|
9517
|
+{
|
|
9518
|
+ SelfTest_TimerOff(SelfTest1,&bluecell_Currdatastatus.Selftest1);
|
|
9519
|
+ SelfTest_TimerOff(SelfTest2,&bluecell_Currdatastatus.Selftest2);
|
|
9520
|
+ SelfTest_TimerOff(SelfTest3,&bluecell_Currdatastatus.Selftest3);
|
|
9521
|
+ SelfTest_TimerOff(SelfTest4,&bluecell_Currdatastatus.Selftest4);
|
|
9522
|
+}
|
9402
|
9523
|
void FRBT_Operate(){
|
9403
|
9524
|
|
9404
|
9525
|
if(bluecell_Currdatastatus.DLI_AGC_ON_OFF == false){ /*AGC ON ONLY*/
|