Parcourir la source

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

PYJ il y a 4 ans
Parent
commit
38b71b630a
2 fichiers modifiés avec 107 ajouts et 61 suppressions
  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 29
 extern void PE43711_UL4_atten_ctrl(uint8_t data);
30 30
 
31 31
 
32
+
32 33
 /***************************************************************************************/
33 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 108
 void Factory_Set();
108 109
 void SelfTest_Ctrl(uint8_t num,uint8_t val,uint8_t* selftest,uint8_t* DL_Atten,uint8_t* UL_Atten);
109 110
 void TimeSetting(uint8_t* data);
111
+void Temp_Shutdown_ONOFF(uint8_t val);
112
+
110 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 115
 /*                                  Valuable                                           */
@@ -2070,10 +2073,11 @@ bool Bluecell_Operate(uint8_t* data){
2070 2073
 //       printf("DL PATH 1 : %d \r\n",data[BLUECELL_DATA]);
2071 2074
        if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
2072 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 2078
        else
2076 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 2083
        DL_Path_OnOff(Path1_OnOff,
@@ -2103,10 +2107,11 @@ bool Bluecell_Operate(uint8_t* data){
2103 2107
 #else
2104 2108
         if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
2105 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 2112
         else
2109 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 2116
         UL_Path_OnOff(Path1_OnOff,
2112 2117
              data[BLUECELL_DATA],
@@ -2174,10 +2179,11 @@ bool Bluecell_Operate(uint8_t* data){
2174 2179
 #else
2175 2180
         if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
2176 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 2184
         else
2180 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 2188
         DL_Path_OnOff(Path2_OnOff,
2183 2189
              data[BLUECELL_DATA],
@@ -2209,10 +2215,11 @@ bool Bluecell_Operate(uint8_t* data){
2209 2215
 #else
2210 2216
         if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
2211 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 2220
         else
2215 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 2224
         UL_Path_OnOff(Path2_OnOff,
2218 2225
              data[BLUECELL_DATA],
@@ -2258,10 +2265,11 @@ bool Bluecell_Operate(uint8_t* data){
2258 2265
 #else
2259 2266
         if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
2260 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 2270
         else
2264 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 2274
         DL_Path_OnOff(Path3_OnOff,
2267 2275
              data[BLUECELL_DATA],
@@ -2289,10 +2297,11 @@ bool Bluecell_Operate(uint8_t* data){
2289 2297
 #else
2290 2298
         if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
2291 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 2302
         else
2295 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 2306
         UL_Path_OnOff(Path3_OnOff,
2298 2307
              data[BLUECELL_DATA],
@@ -2321,26 +2330,18 @@ bool Bluecell_Operate(uint8_t* data){
2321 2330
 //		printf("Function : %s Line %d \r\n",__func__,__LINE__);
2322 2331
 		break;
2323 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 2333
         if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
2339 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 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 2346
         DL_Path_OnOff(Path4_OnOff,
2346 2347
              data[BLUECELL_DATA],
@@ -2349,7 +2350,6 @@ bool Bluecell_Operate(uint8_t* data){
2349 2350
              &bluecell_Currdatastatus.DLI_Shutdown_Retry_Count4,
2350 2351
              &bluecell_Prevdatastatus.DLI_Shutdown_Retry_Count4)  ;  
2351 2352
 
2352
-#endif // PYJ.2020.07.03_END -- 
2353 2353
 		break;
2354 2354
 	case ATT_UL4_PATH:
2355 2355
 #if 0 // PYJ.2020.07.03_BEGIN -- 
@@ -2371,10 +2371,11 @@ bool Bluecell_Operate(uint8_t* data){
2371 2371
 #else
2372 2372
         if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
2373 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 2376
         else
2377 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 2380
         UL_Path_OnOff(Path4_OnOff,
2380 2381
              data[BLUECELL_DATA],
@@ -3067,7 +3068,9 @@ bool Bluecell_Operate(uint8_t* data){
3067 3068
         break;
3068 3069
     case Bluecell_Temp_Shutdown_Path_ON_OFF:
3069 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 3074
         break;
3072 3075
   }
3073 3076
   
@@ -3153,6 +3156,7 @@ void HFR_TypeInit(){
3153 3156
         PrevMBIC_DL_ShutdownCount[i] = 0xFF;        
3154 3157
     }
3155 3158
 #if 1 // PYJ.2020.06.17_BEGIN -- 
3159
+    printf("bluecell_Currdatastatus.Path_TempSave_Bit : %x \r\n",bluecell_Currdatastatus.Path_TempSave_Bit);
3156 3160
     if(bluecell_Currdatastatus.Path_TempSave_Bit & 0x80)
3157 3161
         bluecell_Currdatastatus.ATT_DL1_PATH = true;
3158 3162
     else
@@ -4581,7 +4585,11 @@ void Carrier_ONOFF(uint8_t val){
4581 4585
     }
4582 4586
 }
4583 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 4591
     if(val == 0){// ON //Path ON
4592
+#if 0 // PYJ.2020.08.14_BEGIN -- 
4585 4593
          bluecell_Currdatastatus.ATT_DL1_PATH= TempShutdown_DL_SaveData[0];    
4586 4594
          bluecell_Currdatastatus.ATT_DL2_PATH= TempShutdown_DL_SaveData[1];    
4587 4595
          bluecell_Currdatastatus.ATT_DL3_PATH= TempShutdown_DL_SaveData[2];    
@@ -4590,10 +4598,52 @@ void Temp_Shutdown_ONOFF(uint8_t val){
4590 4598
          bluecell_Currdatastatus.ATT_UL2_PATH= TempShutdown_UL_SaveData[1];    
4591 4599
          bluecell_Currdatastatus.ATT_UL3_PATH= TempShutdown_UL_SaveData[2];    
4592 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 4647
         TempShutdown_DL_SaveData[0] = bluecell_Currdatastatus.ATT_DL1_PATH;
4598 4648
         TempShutdown_DL_SaveData[1] = bluecell_Currdatastatus.ATT_DL2_PATH;
4599 4649
         TempShutdown_DL_SaveData[2] = bluecell_Currdatastatus.ATT_DL3_PATH;
@@ -4602,6 +4652,7 @@ void Temp_Shutdown_ONOFF(uint8_t val){
4602 4652
         TempShutdown_UL_SaveData[1] = bluecell_Currdatastatus.ATT_UL2_PATH;
4603 4653
         TempShutdown_UL_SaveData[2] = bluecell_Currdatastatus.ATT_UL3_PATH;
4604 4654
         TempShutdown_UL_SaveData[3] = bluecell_Currdatastatus.ATT_UL4_PATH;
4655
+#endif // PYJ.2020.08.14_END -- 
4605 4656
 
4606 4657
         
4607 4658
         bluecell_Currdatastatus.ATT_DL1_PATH = false;    
@@ -4612,7 +4663,7 @@ void Temp_Shutdown_ONOFF(uint8_t val){
4612 4663
         bluecell_Currdatastatus.ATT_UL2_PATH = false;    
4613 4664
         bluecell_Currdatastatus.ATT_UL3_PATH = false;    
4614 4665
         bluecell_Currdatastatus.ATT_UL4_PATH = false;   
4615
-       
4666
+        printf("Path OOF \r\n");
4616 4667
         bluecell_Currdatastatus.ALARM_TEMP_HIGH = 0;
4617 4668
         bluecell_Currdatastatus.ALARM_DLI_Level = 0;
4618 4669
         bluecell_Currdatastatus.ALARM_DLI_SHTUTDOWN = 0;
@@ -4888,12 +4939,7 @@ uint8_t* Alarm_Report_Send(uint8_t Alarm_type,uint8_t val){
4888 4939
     Alarm_ReportData[MBIC_PAYLOADSTART + (Alarm_ReportData[MBIC_PAYLOADSTART + MBIC_TableIndex_Length] ) + 5] =(( crcret  & 0xFF00)>> 8);  
4889 4940
     Alarm_ReportData[MBIC_PAYLOADSTART + (Alarm_ReportData[MBIC_PAYLOADSTART + MBIC_TableIndex_Length] ) + 6] = (( crcret  & 0x00FF));  
4890 4941
     Alarm_ReportData[MBIC_PAYLOADSTART + (Alarm_ReportData[MBIC_PAYLOADSTART + MBIC_TableIndex_Length] ) + 7] = 0x03; 
4891
-
4892 4942
     Uart1_Data_Send(Alarm_ReportData,sizeof(Alarm_ReportData));
4893
-
4894
-    
4895
-    
4896
-
4897 4943
 }
4898 4944
 
4899 4945
 bool MBIC_Operate(uint8_t* data){
@@ -5073,7 +5119,7 @@ bool MBIC_Operate(uint8_t* data){
5073 5119
                 if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
5074 5120
                     return true;
5075 5121
                 if(data[MBIC_PAYLOADSTART + 3] != 0)
5076
-                    bluecell_Currdatastatus.Path_TempSave_Bit = 0x80;
5122
+                    bluecell_Currdatastatus.Path_TempSave_Bit |= 0x80;
5077 5123
                 else
5078 5124
                    bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x80;
5079 5125
                 DL_Path_OnOff(Path1_OnOff,
@@ -5087,9 +5133,10 @@ bool MBIC_Operate(uint8_t* data){
5087 5133
                 if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
5088 5134
                     return true;
5089 5135
                 if(data[MBIC_PAYLOADSTART + 3] != 0)
5090
-                    bluecell_Currdatastatus.Path_TempSave_Bit = 0x40; 
5136
+                    bluecell_Currdatastatus.Path_TempSave_Bit |= 0x40; 
5091 5137
                 else
5092
-                   bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x40;               
5138
+                   bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x40;       
5139
+                
5093 5140
                 DL_Path_OnOff(Path2_OnOff,
5094 5141
                     data[MBIC_PAYLOADSTART + 3],
5095 5142
                     &bluecell_Currdatastatus.ATT_DL2_PATH,
@@ -5101,7 +5148,7 @@ bool MBIC_Operate(uint8_t* data){
5101 5148
                 if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
5102 5149
                     return true;
5103 5150
                 if(data[MBIC_PAYLOADSTART + 3] != 0)
5104
-                    bluecell_Currdatastatus.Path_TempSave_Bit = 0x20;
5151
+                    bluecell_Currdatastatus.Path_TempSave_Bit |= 0x20;
5105 5152
                     else
5106 5153
                    bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x20;
5107 5154
                 DL_Path_OnOff(Path3_OnOff,
@@ -5116,7 +5163,7 @@ bool MBIC_Operate(uint8_t* data){
5116 5163
                 if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
5117 5164
                     return true;
5118 5165
                 if(data[MBIC_PAYLOADSTART + 3] != 0)
5119
-                    bluecell_Currdatastatus.Path_TempSave_Bit = 0x10;
5166
+                    bluecell_Currdatastatus.Path_TempSave_Bit |= 0x10;
5120 5167
                 else
5121 5168
                    bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x10;
5122 5169
                 DL_Path_OnOff(Path4_OnOff,
@@ -5295,7 +5342,7 @@ bool MBIC_Operate(uint8_t* data){
5295 5342
                 if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
5296 5343
                     return true;
5297 5344
                 if(data[MBIC_PAYLOADSTART + 3] != 0)
5298
-                    bluecell_Currdatastatus.Path_TempSave_Bit = 0x08;
5345
+                    bluecell_Currdatastatus.Path_TempSave_Bit |= 0x08;
5299 5346
                 else
5300 5347
                    bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x08;
5301 5348
                 UL_Path_OnOff(Path1_OnOff,
@@ -5310,7 +5357,7 @@ bool MBIC_Operate(uint8_t* data){
5310 5357
                 if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
5311 5358
                   return true;
5312 5359
                 if(data[MBIC_PAYLOADSTART + 3] != 0)
5313
-                    bluecell_Currdatastatus.Path_TempSave_Bit = 0x04;
5360
+                    bluecell_Currdatastatus.Path_TempSave_Bit |= 0x04;
5314 5361
                 else
5315 5362
                     bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x04;
5316 5363
                 UL_Path_OnOff(Path2_OnOff,
@@ -5324,7 +5371,7 @@ bool MBIC_Operate(uint8_t* data){
5324 5371
                 if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
5325 5372
                   return true;
5326 5373
                 if(data[MBIC_PAYLOADSTART + 3] != 0)
5327
-                    bluecell_Currdatastatus.Path_TempSave_Bit = 0x02;
5374
+                    bluecell_Currdatastatus.Path_TempSave_Bit |= 0x02;
5328 5375
                 else
5329 5376
                     bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x02;
5330 5377
                 UL_Path_OnOff(Path3_OnOff,
@@ -5338,7 +5385,7 @@ bool MBIC_Operate(uint8_t* data){
5338 5385
                 if(bluecell_Currdatastatus.Carrier_ON_OFF == false)
5339 5386
                   return true;
5340 5387
                 if(data[MBIC_PAYLOADSTART + 3] != 0)
5341
-                    bluecell_Currdatastatus.Path_TempSave_Bit = 0x01;
5388
+                    bluecell_Currdatastatus.Path_TempSave_Bit |= 0x01;
5342 5389
                 else
5343 5390
                     bluecell_Currdatastatus.Path_TempSave_Bit &= ~0x01;
5344 5391
                 UL_Path_OnOff(Path4_OnOff,
@@ -6990,8 +7037,8 @@ void ADC_Check(void){
6990 7037
     DET_LevelAlarmCheck();/*DL UL Alarm Check*/
6991 7038
 }
6992 7039
 #else
6993
-#define Percent      2
6994
-#define Percent100 10
7040
+#define Percent       2
7041
+#define Percent100 5
6995 7042
 void ADC_Check(void){
6996 7043
 #if 1 // PYJ.2020.08.07_BEGIN -- 
6997 7044
     //static uint8_t Cnt = 0;
@@ -7000,8 +7047,6 @@ void ADC_Check(void){
7000 7047
    uint32_t ADC1_Average_value[ADC1_CNT];
7001 7048
    static uint32_t HFR_ADC1_Average_value[ADC1_CNT];
7002 7049
    uint32_t ADC3_Average_value[ADC3_CNT];
7003
-
7004
-   // double ret = 0;
7005 7050
     uint16_t MIN_ADC[ADC3_CNT] = {0,};
7006 7051
     uint16_t cnt[ADC3_CNT] = {0,};
7007 7052
     double temp;
@@ -7026,17 +7071,18 @@ void ADC_Check(void){
7026 7071
             Adc3_HFR_Array[i][Total_SamplingCnt] = ADC3_Average_value[i]; 
7027 7072
              for(int index = 0; index <6; index++){
7028 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 7079
              DascendigFunc(&Adc3_HFR_Desc_Array[i][0],6);
7033 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 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 7087
         else{
7042 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 261
 extern void ALC_Function();
262 262
 extern void Boot_LED_Toggle(void);
263 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 266
 uint8_t MBICTest_Firmdata[8]  = {1,2,3,4,5,6,7,8};
267 267
 
@@ -349,7 +349,7 @@ int main(void)
349 349
   /* USER CODE BEGIN WHILE */
350 350
   while (1)
351 351
   {
352
-//    ADC_Sampling_Func();
352
+    //ADC_Sampling_Func();
353 353
     ADC_Check();       /*Det Calc + DL/UL Alarm Check Function*/
354 354
     Boot_LED_Toggle(); /*LED Check*/
355 355
     Uart_Check();      /*Usart Rx*/