Explorar o código

HFR ADC - > Bluecell ADC Algorithm 으로 변경
Temp Shutdown 기능 실행시 각 Path data 변경 할 때 전부 Save 할 수 있도록 변경

PYJ %!s(int64=4) %!d(string=hai) anos
pai
achega
38b71b630a
Modificáronse 2 ficheiros con 107 adicións e 61 borrados
  1. 105 59
      Bluecell_Src/Bluecell_operate.c
  2. 2 2
      Src/main.c

+ 105 - 59
Bluecell_Src/Bluecell_operate.c

@@ -29,6 +29,7 @@ extern void PE43711_atten_ctrl2(PE43711_st* ATT ,uint8_t data);
29
 extern void PE43711_UL4_atten_ctrl(uint8_t data);
29
 extern void PE43711_UL4_atten_ctrl(uint8_t data);
30
 
30
 
31
 
31
 
32
+
32
 /***************************************************************************************/
33
 /***************************************************************************************/
33
 /*                                  Extern Valuable                                    */
34
 /*                                  Extern Valuable                                    */
34
 /***************************************************************************************/
35
 /***************************************************************************************/
@@ -107,6 +108,8 @@ void DL_Path_OnOff(uint8_t Index,uint8_t value,uint8_t* path,uint8_t* PrevAtten,
107
 void Factory_Set();
108
 void Factory_Set();
108
 void SelfTest_Ctrl(uint8_t num,uint8_t val,uint8_t* selftest,uint8_t* DL_Atten,uint8_t* UL_Atten);
109
 void SelfTest_Ctrl(uint8_t num,uint8_t val,uint8_t* selftest,uint8_t* DL_Atten,uint8_t* UL_Atten);
109
 void TimeSetting(uint8_t* data);
110
 void TimeSetting(uint8_t* data);
111
+void Temp_Shutdown_ONOFF(uint8_t val);
112
+
110
 void UL_Path_OnOff(uint8_t Index,uint8_t value,uint8_t* path,uint8_t* PrevAtten,uint8_t* retrycnt,uint8_t* PrevRetryCnt);
113
 void UL_Path_OnOff(uint8_t Index,uint8_t value,uint8_t* path,uint8_t* PrevAtten,uint8_t* retrycnt,uint8_t* PrevRetryCnt);
111
 /***************************************************************************************/
114
 /***************************************************************************************/
112
 /*                                  Valuable                                           */
115
 /*                                  Valuable                                           */
@@ -2070,10 +2073,11 @@ bool Bluecell_Operate(uint8_t* data){
2070
 //       printf("DL PATH 1 : %d \r\n",data[BLUECELL_DATA]);
2073
 //       printf("DL PATH 1 : %d \r\n",data[BLUECELL_DATA]);
2071
        if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
2074
        if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
2072
               return true;
2075
               return true;
2073
-       if(data[MBIC_PAYLOADSTART] != 0)
2074
-           bluecell_Currdatastatus.Path_TempSave_Bit = 0x80;
2076
+       if(data[BLUECELL_DATA] != 0)
2077
+           bluecell_Currdatastatus.Path_TempSave_Bit |= 0x80;
2075
        else
2078
        else
2076
           bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x80;
2079
           bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x80;
2080
+       printf("%d :  bluecell_Currdatastatus.Path_TempSave_Bit : %x \r\n",data[BLUECELL_DATA], bluecell_Currdatastatus.Path_TempSave_Bit);
2077
 
2081
 
2078
 
2082
 
2079
        DL_Path_OnOff(Path1_OnOff,
2083
        DL_Path_OnOff(Path1_OnOff,
@@ -2103,10 +2107,11 @@ bool Bluecell_Operate(uint8_t* data){
2103
 #else
2107
 #else
2104
         if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
2108
         if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
2105
                return true;
2109
                return true;
2106
-        if(data[MBIC_PAYLOADSTART] != 0)
2107
-            bluecell_Currdatastatus.Path_TempSave_Bit = 0x08;
2110
+        if(data[BLUECELL_DATA] != 0)
2111
+            bluecell_Currdatastatus.Path_TempSave_Bit |= 0x08;
2108
         else
2112
         else
2109
            bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x08;
2113
            bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x08;
2114
+        printf("%d :  bluecell_Currdatastatus.Path_TempSave_Bit : %x \r\n",data[BLUECELL_DATA], bluecell_Currdatastatus.Path_TempSave_Bit);
2110
 
2115
 
2111
         UL_Path_OnOff(Path1_OnOff,
2116
         UL_Path_OnOff(Path1_OnOff,
2112
              data[BLUECELL_DATA],
2117
              data[BLUECELL_DATA],
@@ -2174,10 +2179,11 @@ bool Bluecell_Operate(uint8_t* data){
2174
 #else
2179
 #else
2175
         if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
2180
         if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
2176
           return true;
2181
           return true;
2177
-        if(data[MBIC_PAYLOADSTART] != 0)
2178
-            bluecell_Currdatastatus.Path_TempSave_Bit = 0x40;
2182
+        if(data[BLUECELL_DATA] != 0)
2183
+            bluecell_Currdatastatus.Path_TempSave_Bit |= 0x40;
2179
         else
2184
         else
2180
            bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x40;
2185
            bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x40;
2186
+        printf("%d :  bluecell_Currdatastatus.Path_TempSave_Bit : %x \r\n",data[BLUECELL_DATA], bluecell_Currdatastatus.Path_TempSave_Bit);
2181
 
2187
 
2182
         DL_Path_OnOff(Path2_OnOff,
2188
         DL_Path_OnOff(Path2_OnOff,
2183
              data[BLUECELL_DATA],
2189
              data[BLUECELL_DATA],
@@ -2209,10 +2215,11 @@ bool Bluecell_Operate(uint8_t* data){
2209
 #else
2215
 #else
2210
         if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
2216
         if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
2211
           return true;
2217
           return true;
2212
-        if(data[MBIC_PAYLOADSTART] != 0)
2213
-            bluecell_Currdatastatus.Path_TempSave_Bit = 0x04;
2218
+        if(data[BLUECELL_DATA] != 0)
2219
+            bluecell_Currdatastatus.Path_TempSave_Bit |= 0x04;
2214
         else
2220
         else
2215
            bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x04;
2221
            bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x04;
2222
+        printf("%d :  bluecell_Currdatastatus.Path_TempSave_Bit : %x \r\n",data[BLUECELL_DATA], bluecell_Currdatastatus.Path_TempSave_Bit);
2216
 
2223
 
2217
         UL_Path_OnOff(Path2_OnOff,
2224
         UL_Path_OnOff(Path2_OnOff,
2218
              data[BLUECELL_DATA],
2225
              data[BLUECELL_DATA],
@@ -2258,10 +2265,11 @@ bool Bluecell_Operate(uint8_t* data){
2258
 #else
2265
 #else
2259
         if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
2266
         if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
2260
           return true;
2267
           return true;
2261
-        if(data[MBIC_PAYLOADSTART] != 0)
2262
-            bluecell_Currdatastatus.Path_TempSave_Bit = 0x20;
2268
+        if(data[BLUECELL_DATA] != 0)
2269
+            bluecell_Currdatastatus.Path_TempSave_Bit |= 0x20;
2263
         else
2270
         else
2264
            bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x20;
2271
            bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x20;
2272
+        printf("%d :  bluecell_Currdatastatus.Path_TempSave_Bit : %x \r\n",data[BLUECELL_DATA], bluecell_Currdatastatus.Path_TempSave_Bit);
2265
 
2273
 
2266
         DL_Path_OnOff(Path3_OnOff,
2274
         DL_Path_OnOff(Path3_OnOff,
2267
              data[BLUECELL_DATA],
2275
              data[BLUECELL_DATA],
@@ -2289,10 +2297,11 @@ bool Bluecell_Operate(uint8_t* data){
2289
 #else
2297
 #else
2290
         if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
2298
         if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
2291
           return true;
2299
           return true;
2292
-        if(data[MBIC_PAYLOADSTART] != 0)
2293
-            bluecell_Currdatastatus.Path_TempSave_Bit = 0x02;
2300
+        if(data[BLUECELL_DATA] != 0)
2301
+            bluecell_Currdatastatus.Path_TempSave_Bit |= 0x02;
2294
         else
2302
         else
2295
            bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x02;
2303
            bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x02;
2304
+        printf("%d :  bluecell_Currdatastatus.Path_TempSave_Bit : %x \r\n",data[BLUECELL_DATA], bluecell_Currdatastatus.Path_TempSave_Bit);
2296
 
2305
 
2297
         UL_Path_OnOff(Path3_OnOff,
2306
         UL_Path_OnOff(Path3_OnOff,
2298
              data[BLUECELL_DATA],
2307
              data[BLUECELL_DATA],
@@ -2321,26 +2330,18 @@ bool Bluecell_Operate(uint8_t* data){
2321
 //		printf("Function : %s Line %d \r\n",__func__,__LINE__);
2330
 //		printf("Function : %s Line %d \r\n",__func__,__LINE__);
2322
 		break;
2331
 		break;
2323
 	case ATT_DL4_PATH :
2332
 	case ATT_DL4_PATH :
2324
-#if 0 // PYJ.2020.07.03_BEGIN -- 
2325
-        if(data[BLUECELL_DATA]==0){
2326
-            HAL_GPIO_WritePin(PATH_EN_DL4_GPIO_Port,PATH_EN_DL4_Pin,GPIO_PIN_RESET);//CLOCK
2327
-            bluecell_Currdatastatus.DLI_Shutdown_Retry_Count4 = 0;
2328
-        }else{
2329
-            HAL_GPIO_WritePin(PATH_EN_DL4_GPIO_Port,PATH_EN_DL4_Pin,GPIO_PIN_SET);//CLOCK    
2330
-            bluecell_Prevdatastatus.ATT_DL4_H =0xFF;
2331
-            bluecell_Prevdatastatus.ATT_DL4_L = 0xFF;
2332
-            CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);
2333
-
2334
-        }
2335
-        bluecell_Currdatastatus.ATT_DL4_PATH = data[BLUECELL_DATA];
2336
-//		printf("Function : %s Line %d \r\n",__func__,__LINE__);
2337
-#else
2338
         if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
2333
         if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
2339
           return true;
2334
           return true;
2340
-        if(data[MBIC_PAYLOADSTART] != 0)
2341
-            bluecell_Currdatastatus.Path_TempSave_Bit = 0x10;
2342
-        else
2335
+        if(data[BLUECELL_DATA] != 0){
2336
+            bluecell_Currdatastatus.Path_TempSave_Bit |= 0x10;
2337
+        }
2338
+        else{
2343
            bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x10;
2339
            bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x10;
2340
+        }
2341
+
2342
+        printf("data[BLUECELL_DATA] : %d \r\n",data[BLUECELL_DATA]);
2343
+        
2344
+        printf("3.bluecell_Currdatastatus.Path_TempSave_Bit : %x \r\n",bluecell_Currdatastatus.Path_TempSave_Bit);
2344
 
2345
 
2345
         DL_Path_OnOff(Path4_OnOff,
2346
         DL_Path_OnOff(Path4_OnOff,
2346
              data[BLUECELL_DATA],
2347
              data[BLUECELL_DATA],
@@ -2349,7 +2350,6 @@ bool Bluecell_Operate(uint8_t* data){
2349
              &bluecell_Currdatastatus.DLI_Shutdown_Retry_Count4,
2350
              &bluecell_Currdatastatus.DLI_Shutdown_Retry_Count4,
2350
              &bluecell_Prevdatastatus.DLI_Shutdown_Retry_Count4)  ;  
2351
              &bluecell_Prevdatastatus.DLI_Shutdown_Retry_Count4)  ;  
2351
 
2352
 
2352
-#endif // PYJ.2020.07.03_END -- 
2353
 		break;
2353
 		break;
2354
 	case ATT_UL4_PATH:
2354
 	case ATT_UL4_PATH:
2355
 #if 0 // PYJ.2020.07.03_BEGIN -- 
2355
 #if 0 // PYJ.2020.07.03_BEGIN -- 
@@ -2371,10 +2371,11 @@ bool Bluecell_Operate(uint8_t* data){
2371
 #else
2371
 #else
2372
         if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
2372
         if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
2373
           return true;
2373
           return true;
2374
-        if(data[MBIC_PAYLOADSTART] != 0)
2375
-            bluecell_Currdatastatus.Path_TempSave_Bit = 0x01;
2374
+        if(data[BLUECELL_DATA] != 0)
2375
+            bluecell_Currdatastatus.Path_TempSave_Bit |= 0x01;
2376
         else
2376
         else
2377
            bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x01;
2377
            bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x01;
2378
+        printf("%d :  bluecell_Currdatastatus.Path_TempSave_Bit : %x \r\n",data[BLUECELL_DATA], bluecell_Currdatastatus.Path_TempSave_Bit);
2378
 
2379
 
2379
         UL_Path_OnOff(Path4_OnOff,
2380
         UL_Path_OnOff(Path4_OnOff,
2380
              data[BLUECELL_DATA],
2381
              data[BLUECELL_DATA],
@@ -3067,7 +3068,9 @@ bool Bluecell_Operate(uint8_t* data){
3067
         break;
3068
         break;
3068
     case Bluecell_Temp_Shutdown_Path_ON_OFF:
3069
     case Bluecell_Temp_Shutdown_Path_ON_OFF:
3069
          bluecell_Currdatastatus.Path_TempShutdown_Set = data[BLUECELL_DATA];
3070
          bluecell_Currdatastatus.Path_TempShutdown_Set = data[BLUECELL_DATA];
3070
-         Temp_Shutdown_ONOFF(bluecell_Prevdatastatus.Path_TempShutdown_Set);
3071
+         printf("data[BLUECELL_DATA] : %d \r\n",data[BLUECELL_DATA]);
3072
+         printf("Path_TempShutdown_Set : %d \r\n",bluecell_Currdatastatus.Path_TempShutdown_Set);    
3073
+         Temp_Shutdown_ONOFF(bluecell_Currdatastatus.Path_TempShutdown_Set);
3071
         break;
3074
         break;
3072
   }
3075
   }
3073
   
3076
   
@@ -3153,6 +3156,7 @@ void HFR_TypeInit(){
3153
         PrevMBIC_DL_ShutdownCount[i] = 0xFF;        
3156
         PrevMBIC_DL_ShutdownCount[i] = 0xFF;        
3154
     }
3157
     }
3155
 #if 1 // PYJ.2020.06.17_BEGIN -- 
3158
 #if 1 // PYJ.2020.06.17_BEGIN -- 
3159
+    printf("bluecell_Currdatastatus.Path_TempSave_Bit : %x \r\n",bluecell_Currdatastatus.Path_TempSave_Bit);
3156
     if(bluecell_Currdatastatus.Path_TempSave_Bit & 0x80)
3160
     if(bluecell_Currdatastatus.Path_TempSave_Bit & 0x80)
3157
         bluecell_Currdatastatus.ATT_DL1_PATH = true;
3161
         bluecell_Currdatastatus.ATT_DL1_PATH = true;
3158
     else
3162
     else
@@ -4581,7 +4585,11 @@ void Carrier_ONOFF(uint8_t val){
4581
     }
4585
     }
4582
 }
4586
 }
4583
 void Temp_Shutdown_ONOFF(uint8_t val){
4587
 void Temp_Shutdown_ONOFF(uint8_t val){
4588
+    printf("val :%d \r\n",val);
4589
+    printf("Path_TempShutdown_Set : %d \r\n",bluecell_Currdatastatus.Path_TempShutdown_Set);    
4590
+    printf(" bluecell_Currdatastatus.Path_TempSave_Bit : %x \r\n", bluecell_Currdatastatus.Path_TempSave_Bit);
4584
     if(val == 0){// ON //Path ON
4591
     if(val == 0){// ON //Path ON
4592
+#if 0 // PYJ.2020.08.14_BEGIN -- 
4585
          bluecell_Currdatastatus.ATT_DL1_PATH= TempShutdown_DL_SaveData[0];    
4593
          bluecell_Currdatastatus.ATT_DL1_PATH= TempShutdown_DL_SaveData[0];    
4586
          bluecell_Currdatastatus.ATT_DL2_PATH= TempShutdown_DL_SaveData[1];    
4594
          bluecell_Currdatastatus.ATT_DL2_PATH= TempShutdown_DL_SaveData[1];    
4587
          bluecell_Currdatastatus.ATT_DL3_PATH= TempShutdown_DL_SaveData[2];    
4595
          bluecell_Currdatastatus.ATT_DL3_PATH= TempShutdown_DL_SaveData[2];    
@@ -4590,10 +4598,52 @@ void Temp_Shutdown_ONOFF(uint8_t val){
4590
          bluecell_Currdatastatus.ATT_UL2_PATH= TempShutdown_UL_SaveData[1];    
4598
          bluecell_Currdatastatus.ATT_UL2_PATH= TempShutdown_UL_SaveData[1];    
4591
          bluecell_Currdatastatus.ATT_UL3_PATH= TempShutdown_UL_SaveData[2];    
4599
          bluecell_Currdatastatus.ATT_UL3_PATH= TempShutdown_UL_SaveData[2];    
4592
          bluecell_Currdatastatus.ATT_UL4_PATH= TempShutdown_UL_SaveData[3];   
4600
          bluecell_Currdatastatus.ATT_UL4_PATH= TempShutdown_UL_SaveData[3];   
4601
+#endif // PYJ.2020.08.14_END -- 
4602
+        if(bluecell_Currdatastatus.Path_TempSave_Bit & 0x80)
4603
+            bluecell_Currdatastatus.ATT_DL1_PATH = true;
4604
+        else
4605
+            bluecell_Currdatastatus.ATT_DL1_PATH = false;
4606
+        
4607
+        if(bluecell_Currdatastatus.Path_TempSave_Bit & 0x40)
4608
+            bluecell_Currdatastatus.ATT_DL2_PATH = true;
4609
+        else
4610
+            bluecell_Currdatastatus.ATT_DL2_PATH = false;
4611
+        
4612
+        if(bluecell_Currdatastatus.Path_TempSave_Bit & 0x20)
4613
+            bluecell_Currdatastatus.ATT_DL3_PATH = true;
4614
+        else
4615
+            bluecell_Currdatastatus.ATT_DL3_PATH = false;
4616
+        
4617
+        if(bluecell_Currdatastatus.Path_TempSave_Bit & 0x10)
4618
+            bluecell_Currdatastatus.ATT_DL4_PATH = true;
4619
+        else
4620
+            bluecell_Currdatastatus.ATT_DL4_PATH = false;
4621
+        
4622
+        if(bluecell_Currdatastatus.Path_TempSave_Bit & 0x08)
4623
+            bluecell_Currdatastatus.ATT_UL1_PATH = true;
4624
+        else
4625
+            bluecell_Currdatastatus.ATT_UL1_PATH = false;
4626
+        
4627
+        if(bluecell_Currdatastatus.Path_TempSave_Bit & 0x04)
4628
+            bluecell_Currdatastatus.ATT_UL2_PATH = true;
4629
+        else
4630
+            bluecell_Currdatastatus.ATT_UL2_PATH = false;
4631
+        
4632
+        if(bluecell_Currdatastatus.Path_TempSave_Bit & 0x02)
4633
+            bluecell_Currdatastatus.ATT_UL3_PATH = true;
4634
+        else
4635
+            bluecell_Currdatastatus.ATT_UL3_PATH = false;
4636
+        
4637
+        if(bluecell_Currdatastatus.Path_TempSave_Bit & 0x01)
4638
+            bluecell_Currdatastatus.ATT_UL4_PATH = true;
4639
+        else
4640
+            bluecell_Currdatastatus.ATT_UL4_PATH = false;
4641
+          printf("Path ON \r\n");
4593
 
4642
 
4643
+    }
4644
+    else{// OFF
4594
 
4645
 
4595
-    }else{// OFF
4596
-
4646
+#if 0 // PYJ.2020.08.14_BEGIN -- 
4597
         TempShutdown_DL_SaveData[0] = bluecell_Currdatastatus.ATT_DL1_PATH;
4647
         TempShutdown_DL_SaveData[0] = bluecell_Currdatastatus.ATT_DL1_PATH;
4598
         TempShutdown_DL_SaveData[1] = bluecell_Currdatastatus.ATT_DL2_PATH;
4648
         TempShutdown_DL_SaveData[1] = bluecell_Currdatastatus.ATT_DL2_PATH;
4599
         TempShutdown_DL_SaveData[2] = bluecell_Currdatastatus.ATT_DL3_PATH;
4649
         TempShutdown_DL_SaveData[2] = bluecell_Currdatastatus.ATT_DL3_PATH;
@@ -4602,6 +4652,7 @@ void Temp_Shutdown_ONOFF(uint8_t val){
4602
         TempShutdown_UL_SaveData[1] = bluecell_Currdatastatus.ATT_UL2_PATH;
4652
         TempShutdown_UL_SaveData[1] = bluecell_Currdatastatus.ATT_UL2_PATH;
4603
         TempShutdown_UL_SaveData[2] = bluecell_Currdatastatus.ATT_UL3_PATH;
4653
         TempShutdown_UL_SaveData[2] = bluecell_Currdatastatus.ATT_UL3_PATH;
4604
         TempShutdown_UL_SaveData[3] = bluecell_Currdatastatus.ATT_UL4_PATH;
4654
         TempShutdown_UL_SaveData[3] = bluecell_Currdatastatus.ATT_UL4_PATH;
4655
+#endif // PYJ.2020.08.14_END -- 
4605
 
4656
 
4606
         
4657
         
4607
         bluecell_Currdatastatus.ATT_DL1_PATH = false;    
4658
         bluecell_Currdatastatus.ATT_DL1_PATH = false;    
@@ -4612,7 +4663,7 @@ void Temp_Shutdown_ONOFF(uint8_t val){
4612
         bluecell_Currdatastatus.ATT_UL2_PATH = false;    
4663
         bluecell_Currdatastatus.ATT_UL2_PATH = false;    
4613
         bluecell_Currdatastatus.ATT_UL3_PATH = false;    
4664
         bluecell_Currdatastatus.ATT_UL3_PATH = false;    
4614
         bluecell_Currdatastatus.ATT_UL4_PATH = false;   
4665
         bluecell_Currdatastatus.ATT_UL4_PATH = false;   
4615
-       
4666
+        printf("Path OOF \r\n");
4616
         bluecell_Currdatastatus.ALARM_TEMP_HIGH = 0;
4667
         bluecell_Currdatastatus.ALARM_TEMP_HIGH = 0;
4617
         bluecell_Currdatastatus.ALARM_DLI_Level = 0;
4668
         bluecell_Currdatastatus.ALARM_DLI_Level = 0;
4618
         bluecell_Currdatastatus.ALARM_DLI_SHTUTDOWN = 0;
4669
         bluecell_Currdatastatus.ALARM_DLI_SHTUTDOWN = 0;
@@ -4888,12 +4939,7 @@ uint8_t* Alarm_Report_Send(uint8_t Alarm_type,uint8_t val){
4888
     Alarm_ReportData[MBIC_PAYLOADSTART + (Alarm_ReportData[MBIC_PAYLOADSTART + MBIC_TableIndex_Length] ) + 5] =(( crcret  & 0xFF00)>> 8);  
4939
     Alarm_ReportData[MBIC_PAYLOADSTART + (Alarm_ReportData[MBIC_PAYLOADSTART + MBIC_TableIndex_Length] ) + 5] =(( crcret  & 0xFF00)>> 8);  
4889
     Alarm_ReportData[MBIC_PAYLOADSTART + (Alarm_ReportData[MBIC_PAYLOADSTART + MBIC_TableIndex_Length] ) + 6] = (( crcret  & 0x00FF));  
4940
     Alarm_ReportData[MBIC_PAYLOADSTART + (Alarm_ReportData[MBIC_PAYLOADSTART + MBIC_TableIndex_Length] ) + 6] = (( crcret  & 0x00FF));  
4890
     Alarm_ReportData[MBIC_PAYLOADSTART + (Alarm_ReportData[MBIC_PAYLOADSTART + MBIC_TableIndex_Length] ) + 7] = 0x03; 
4941
     Alarm_ReportData[MBIC_PAYLOADSTART + (Alarm_ReportData[MBIC_PAYLOADSTART + MBIC_TableIndex_Length] ) + 7] = 0x03; 
4891
-
4892
     Uart1_Data_Send(Alarm_ReportData,sizeof(Alarm_ReportData));
4942
     Uart1_Data_Send(Alarm_ReportData,sizeof(Alarm_ReportData));
4893
-
4894
-    
4895
-    
4896
-
4897
 }
4943
 }
4898
 
4944
 
4899
 bool MBIC_Operate(uint8_t* data){
4945
 bool MBIC_Operate(uint8_t* data){
@@ -5073,7 +5119,7 @@ bool MBIC_Operate(uint8_t* data){
5073
                 if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
5119
                 if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
5074
                     return true;
5120
                     return true;
5075
                 if(data[MBIC_PAYLOADSTART + 3] != 0)
5121
                 if(data[MBIC_PAYLOADSTART + 3] != 0)
5076
-                    bluecell_Currdatastatus.Path_TempSave_Bit = 0x80;
5122
+                    bluecell_Currdatastatus.Path_TempSave_Bit |= 0x80;
5077
                 else
5123
                 else
5078
                    bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x80;
5124
                    bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x80;
5079
                 DL_Path_OnOff(Path1_OnOff,
5125
                 DL_Path_OnOff(Path1_OnOff,
@@ -5087,9 +5133,10 @@ bool MBIC_Operate(uint8_t* data){
5087
                 if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
5133
                 if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
5088
                     return true;
5134
                     return true;
5089
                 if(data[MBIC_PAYLOADSTART + 3] != 0)
5135
                 if(data[MBIC_PAYLOADSTART + 3] != 0)
5090
-                    bluecell_Currdatastatus.Path_TempSave_Bit = 0x40; 
5136
+                    bluecell_Currdatastatus.Path_TempSave_Bit |= 0x40; 
5091
                 else
5137
                 else
5092
-                   bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x40;               
5138
+                   bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x40;       
5139
+                
5093
                 DL_Path_OnOff(Path2_OnOff,
5140
                 DL_Path_OnOff(Path2_OnOff,
5094
                     data[MBIC_PAYLOADSTART + 3],
5141
                     data[MBIC_PAYLOADSTART + 3],
5095
                     &bluecell_Currdatastatus.ATT_DL2_PATH,
5142
                     &bluecell_Currdatastatus.ATT_DL2_PATH,
@@ -5101,7 +5148,7 @@ bool MBIC_Operate(uint8_t* data){
5101
                 if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
5148
                 if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
5102
                     return true;
5149
                     return true;
5103
                 if(data[MBIC_PAYLOADSTART + 3] != 0)
5150
                 if(data[MBIC_PAYLOADSTART + 3] != 0)
5104
-                    bluecell_Currdatastatus.Path_TempSave_Bit = 0x20;
5151
+                    bluecell_Currdatastatus.Path_TempSave_Bit |= 0x20;
5105
                     else
5152
                     else
5106
                    bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x20;
5153
                    bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x20;
5107
                 DL_Path_OnOff(Path3_OnOff,
5154
                 DL_Path_OnOff(Path3_OnOff,
@@ -5116,7 +5163,7 @@ bool MBIC_Operate(uint8_t* data){
5116
                 if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
5163
                 if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
5117
                     return true;
5164
                     return true;
5118
                 if(data[MBIC_PAYLOADSTART + 3] != 0)
5165
                 if(data[MBIC_PAYLOADSTART + 3] != 0)
5119
-                    bluecell_Currdatastatus.Path_TempSave_Bit = 0x10;
5166
+                    bluecell_Currdatastatus.Path_TempSave_Bit |= 0x10;
5120
                 else
5167
                 else
5121
                    bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x10;
5168
                    bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x10;
5122
                 DL_Path_OnOff(Path4_OnOff,
5169
                 DL_Path_OnOff(Path4_OnOff,
@@ -5295,7 +5342,7 @@ bool MBIC_Operate(uint8_t* data){
5295
                 if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
5342
                 if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
5296
                     return true;
5343
                     return true;
5297
                 if(data[MBIC_PAYLOADSTART + 3] != 0)
5344
                 if(data[MBIC_PAYLOADSTART + 3] != 0)
5298
-                    bluecell_Currdatastatus.Path_TempSave_Bit = 0x08;
5345
+                    bluecell_Currdatastatus.Path_TempSave_Bit |= 0x08;
5299
                 else
5346
                 else
5300
                    bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x08;
5347
                    bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x08;
5301
                 UL_Path_OnOff(Path1_OnOff,
5348
                 UL_Path_OnOff(Path1_OnOff,
@@ -5310,7 +5357,7 @@ bool MBIC_Operate(uint8_t* data){
5310
                 if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
5357
                 if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
5311
                   return true;
5358
                   return true;
5312
                 if(data[MBIC_PAYLOADSTART + 3] != 0)
5359
                 if(data[MBIC_PAYLOADSTART + 3] != 0)
5313
-                    bluecell_Currdatastatus.Path_TempSave_Bit = 0x04;
5360
+                    bluecell_Currdatastatus.Path_TempSave_Bit |= 0x04;
5314
                 else
5361
                 else
5315
                     bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x04;
5362
                     bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x04;
5316
                 UL_Path_OnOff(Path2_OnOff,
5363
                 UL_Path_OnOff(Path2_OnOff,
@@ -5324,7 +5371,7 @@ bool MBIC_Operate(uint8_t* data){
5324
                 if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
5371
                 if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
5325
                   return true;
5372
                   return true;
5326
                 if(data[MBIC_PAYLOADSTART + 3] != 0)
5373
                 if(data[MBIC_PAYLOADSTART + 3] != 0)
5327
-                    bluecell_Currdatastatus.Path_TempSave_Bit = 0x02;
5374
+                    bluecell_Currdatastatus.Path_TempSave_Bit |= 0x02;
5328
                 else
5375
                 else
5329
                     bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x02;
5376
                     bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x02;
5330
                 UL_Path_OnOff(Path3_OnOff,
5377
                 UL_Path_OnOff(Path3_OnOff,
@@ -5338,7 +5385,7 @@ bool MBIC_Operate(uint8_t* data){
5338
                 if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
5385
                 if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
5339
                   return true;
5386
                   return true;
5340
                 if(data[MBIC_PAYLOADSTART + 3] != 0)
5387
                 if(data[MBIC_PAYLOADSTART + 3] != 0)
5341
-                    bluecell_Currdatastatus.Path_TempSave_Bit = 0x01;
5388
+                    bluecell_Currdatastatus.Path_TempSave_Bit |= 0x01;
5342
                 else
5389
                 else
5343
                     bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x01;
5390
                     bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x01;
5344
                 UL_Path_OnOff(Path4_OnOff,
5391
                 UL_Path_OnOff(Path4_OnOff,
@@ -6990,8 +7037,8 @@ void ADC_Check(void){
6990
     DET_LevelAlarmCheck();/*DL UL Alarm Check*/
7037
     DET_LevelAlarmCheck();/*DL UL Alarm Check*/
6991
 }
7038
 }
6992
 #else
7039
 #else
6993
-#define Percent      2
6994
-#define Percent100 10
7040
+#define Percent       2
7041
+#define Percent100 5
6995
 void ADC_Check(void){
7042
 void ADC_Check(void){
6996
 #if 1 // PYJ.2020.08.07_BEGIN -- 
7043
 #if 1 // PYJ.2020.08.07_BEGIN -- 
6997
     //static uint8_t Cnt = 0;
7044
     //static uint8_t Cnt = 0;
@@ -7000,8 +7047,6 @@ void ADC_Check(void){
7000
    uint32_t ADC1_Average_value[ADC1_CNT];
7047
    uint32_t ADC1_Average_value[ADC1_CNT];
7001
    static uint32_t HFR_ADC1_Average_value[ADC1_CNT];
7048
    static uint32_t HFR_ADC1_Average_value[ADC1_CNT];
7002
    uint32_t ADC3_Average_value[ADC3_CNT];
7049
    uint32_t ADC3_Average_value[ADC3_CNT];
7003
-
7004
-   // double ret = 0;
7005
     uint16_t MIN_ADC[ADC3_CNT] = {0,};
7050
     uint16_t MIN_ADC[ADC3_CNT] = {0,};
7006
     uint16_t cnt[ADC3_CNT] = {0,};
7051
     uint16_t cnt[ADC3_CNT] = {0,};
7007
     double temp;
7052
     double temp;
@@ -7026,17 +7071,18 @@ void ADC_Check(void){
7026
             Adc3_HFR_Array[i][Total_SamplingCnt] = ADC3_Average_value[i]; 
7071
             Adc3_HFR_Array[i][Total_SamplingCnt] = ADC3_Average_value[i]; 
7027
              for(int index = 0; index <6; index++){
7072
              for(int index = 0; index <6; index++){
7028
                  Adc3_HFR_Desc_Array[i][index] = Adc3_HFR_Array[i][index] ;
7073
                  Adc3_HFR_Desc_Array[i][index] = Adc3_HFR_Array[i][index] ;
7074
+//                 if(i == 4)
7075
+//                 printf("%d   Adc3_HFR_Desc_Array : %d \r\n",index,Adc3_HFR_Desc_Array[i][index]);
7029
              }                  
7076
              }                  
7030
             
7077
             
7031
 
7078
 
7032
              DascendigFunc(&Adc3_HFR_Desc_Array[i][0],6);
7079
              DascendigFunc(&Adc3_HFR_Desc_Array[i][0],6);
7033
              ADC3_Average_value[i] = 0;
7080
              ADC3_Average_value[i] = 0;
7034
-             
7035
-            for(int index = 0; index <Percent; index++)
7081
+
7082
+            for(int index = 0; index <Percent; index++){
7036
                  ADC3_Average_value[i] += Adc3_HFR_Desc_Array[i][index];
7083
                  ADC3_Average_value[i] += Adc3_HFR_Desc_Array[i][index];
7037
-            
7038
-            ADC3_Average_value[i] /= Percent;                
7039
-            
7084
+            }
7085
+            ADC3_Average_value[i] /= Percent;
7040
         }
7086
         }
7041
         else{
7087
         else{
7042
             Adc3_HFR_Array[i][Total_SamplingCnt] = ADC3_Average_value[i];
7088
             Adc3_HFR_Array[i][Total_SamplingCnt] = ADC3_Average_value[i];

+ 2 - 2
Src/main.c

@@ -261,7 +261,7 @@ extern void DET_LevelAlarmCheck();
261
 extern void ALC_Function();
261
 extern void ALC_Function();
262
 extern void Boot_LED_Toggle(void);
262
 extern void Boot_LED_Toggle(void);
263
 extern void ADC_Check(void);
263
 extern void ADC_Check(void);
264
-extern void ADC_Sampling_Func(uint8_t mode,uint16_t Timer2ms_AdcValue,uint8_t index);
264
+extern void ADC_Sampling_Func();
265
 
265
 
266
 uint8_t MBICTest_Firmdata[8]  = {1,2,3,4,5,6,7,8};
266
 uint8_t MBICTest_Firmdata[8]  = {1,2,3,4,5,6,7,8};
267
 
267
 
@@ -349,7 +349,7 @@ int main(void)
349
   /* USER CODE BEGIN WHILE */
349
   /* USER CODE BEGIN WHILE */
350
   while (1)
350
   while (1)
351
   {
351
   {
352
-//    ADC_Sampling_Func();
352
+    //ADC_Sampling_Func();
353
     ADC_Check();       /*Det Calc + DL/UL Alarm Check Function*/
353
     ADC_Check();       /*Det Calc + DL/UL Alarm Check Function*/
354
     Boot_LED_Toggle(); /*LED Check*/
354
     Boot_LED_Toggle(); /*LED Check*/
355
     Uart_Check();      /*Usart Rx*/
355
     Uart_Check();      /*Usart Rx*/