Selaa lähdekoodia

HFR ADC 알고리즘 적용
타이머 7 제거

PYJ 4 vuotta sitten
vanhempi
commit
64906f15bb

+ 2 - 2
.settings/language.settings.xml

@@ -4,7 +4,7 @@
4 4
 		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
5 5
 			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
6 6
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
7
-			<provider class="com.atollic.truestudio.mbs.GCCSpecsDetectorAtollicArm" console="false" env-hash="-190117911751186495" id="com.atollic.truestudio.mbs.provider" keep-relative-paths="false" name="Atollic ARM Tools Language Settings" parameter="${COMMAND} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
7
+			<provider class="com.atollic.truestudio.mbs.GCCSpecsDetectorAtollicArm" console="false" env-hash="1395387303521902045" id="com.atollic.truestudio.mbs.provider" keep-relative-paths="false" name="Atollic ARM Tools Language Settings" parameter="${COMMAND} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
8 8
 				<language-scope id="org.eclipse.cdt.core.gcc"/>
9 9
 				<language-scope id="org.eclipse.cdt.core.g++"/>
10 10
 			</provider>
@@ -14,7 +14,7 @@
14 14
 		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
15 15
 			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
16 16
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
17
-			<provider class="com.atollic.truestudio.mbs.GCCSpecsDetectorAtollicArm" console="false" env-hash="-190117911751186495" id="com.atollic.truestudio.mbs.provider" keep-relative-paths="false" name="Atollic ARM Tools Language Settings" parameter="${COMMAND} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
17
+			<provider class="com.atollic.truestudio.mbs.GCCSpecsDetectorAtollicArm" console="false" env-hash="1395387303521902045" id="com.atollic.truestudio.mbs.provider" keep-relative-paths="false" name="Atollic ARM Tools Language Settings" parameter="${COMMAND} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
18 18
 				<language-scope id="org.eclipse.cdt.core.gcc"/>
19 19
 				<language-scope id="org.eclipse.cdt.core.g++"/>
20 20
 			</provider>

+ 4 - 2
Bluecell_Inc/Bluecell_operate.h

@@ -632,7 +632,8 @@ enum DATATYPE
632 632
     Bluecell_UL_Det_Path1_Offset,    
633 633
     Bluecell_UL_Det_Path2_Offset,    
634 634
     Bluecell_UL_Det_Path3_Offset,    
635
-    Bluecell_UL_Det_Path4_Offset,        
635
+    Bluecell_UL_Det_Path4_Offset, 
636
+    Bluecell_Temp_Shutdown_Path_ON_OFF
636 637
 };
637 638
 typedef enum{    
638 639
 	DLI_P1_Level_Table_Number = 0x00,
@@ -1044,7 +1045,8 @@ typedef struct{
1044 1045
     uint8_t DL_Det_ALL_Offset;
1045 1046
     uint8_t MBIC_Download_Auto_Restart_Set;    
1046 1047
     uint8_t Path_TempSave_Bit;/*DL1 / DL 2 /DL3 /DL4 /UL1/UL2/UL3/UL4*/
1047
-    int8_t UL_Det_Path_Offset[2];
1048
+    uint8_t Path_TempShutdown_Set;/*DL1 / DL 2 /DL3 /DL4 /UL1/UL2/UL3/UL4*/
1049
+    int8_t UL_Det_Path_Offset[1];
1048 1050
     uint8_t bluecell_crc_H;
1049 1051
     uint8_t bluecell_crc_L;
1050 1052
     uint8_t bluecell_etx;

+ 380 - 44
Bluecell_Src/Bluecell_operate.c

@@ -44,8 +44,8 @@ extern volatile uint32_t DET_DL_Normal_Shutdown_On_AlarmTimerCnt[DET_Alarm_UL_In
44 44
 extern volatile uint32_t DET_UL_Normal_Shutdown_On_AlarmTimerCnt[DET_Alarm_UL_Index_MAX] ;
45 45
 
46 46
 extern ALL_PE43711_st ALL_ATT;
47
-extern volatile uint16_t ADC1valuearray[4][ADC_AVERAGECNT];
48
-extern volatile uint16_t ADC3valuearray[5][ADC_AVERAGECNT];
47
+//extern volatile uint16_t ADC1valuearray[4][ADC_AVERAGECNT];
48
+//extern volatile uint16_t ADC3valuearray[5][ADC_AVERAGECNT];
49 49
 
50 50
 extern volatile uint32_t LedTimerCnt;
51 51
 extern volatile uint32_t AdcTimerCnt;
@@ -78,6 +78,9 @@ extern volatile uint32_t Alarm_UL_Level_TimerOnCnt ;
78 78
 extern volatile uint32_t SelfTestLifeCnt[4];
79 79
 extern volatile uint32_t ADC_100ms_Cnt;
80 80
 
81
+extern volatile uint32_t HFR_ADC1value[ADC1_CNT];
82
+extern volatile uint32_t HFR_ADC3value[ADC3_CNT];
83
+
81 84
 uint8_t Selftest_DL_PrevAttenSave[8] = {0,};
82 85
 uint8_t Selftest_UL_PrevAttenSave[8] = {0,};
83 86
 uint8_t TempShutdown_DL_SaveData[4] = {false,};
@@ -1954,11 +1957,11 @@ bool Bluecell_Operate(uint8_t* data){
1954 1957
         if(bluecell_Currdatastatus.ULO_ALC_ON_OFF == true){
1955 1958
             Tmpdata = bluecell_Currdatastatus.MBIC_ULO_ALC_Atten1_H << 8 | bluecell_Currdatastatus.MBIC_ULO_ALC_Atten1_L;
1956 1959
             Tmpdata2 = bluecell_Currdatastatus.ATT_UL1_H << 8 | bluecell_Currdatastatus.ATT_UL1_L;
1957
-//            if(Tmpdata + Tmpdata2 <= -200){
1958
-//                Tmpdata2 = -200 + (Tmpdata * -1);
1959
-//                bluecell_Currdatastatus.ATT_UL1_H = ((Tmpdata2 & 0xFF00) >> 8);
1960
-//                bluecell_Currdatastatus.ATT_UL1_L = Tmpdata2 & 0x00FF;                    
1961
-//            }
1960
+            if(Tmpdata + Tmpdata2 <= -200){
1961
+                Tmpdata2 = -200 + (Tmpdata * -1);
1962
+                bluecell_Currdatastatus.ATT_UL1_H = ((Tmpdata2 & 0xFF00) >> 8);
1963
+                bluecell_Currdatastatus.ATT_UL1_L = Tmpdata2 & 0x00FF;                    
1964
+            }
1962 1965
             UL_ALC_GainAttenSet[ALC_Alarm_UL1_Index] = true;
1963 1966
             ALC_Level_Save[ALC_Alarm_UL1_Index] = bluecell_Currdatastatus.ULO_Level1_H << 8 | bluecell_Currdatastatus.ULO_Level1_L;
1964 1967
         }
@@ -1980,15 +1983,15 @@ bool Bluecell_Operate(uint8_t* data){
1980 1983
         if(bluecell_Currdatastatus.ULO_ALC_ON_OFF == true){
1981 1984
             Tmpdata = bluecell_Currdatastatus.MBIC_ULO_ALC_Atten2_H << 8 | bluecell_Currdatastatus.MBIC_ULO_ALC_Atten2_L;
1982 1985
             Tmpdata2 = bluecell_Currdatastatus.ATT_UL2_H << 8 | bluecell_Currdatastatus.ATT_UL2_L;
1983
-//            if(Tmpdata + Tmpdata2 <= -200){
1984
-//                Tmpdata2 = -200 + (Tmpdata * -1);
1985
-//                bluecell_Currdatastatus.ATT_UL2_H = ((Tmpdata2 & 0xFF00) >> 8);
1986
-//                bluecell_Currdatastatus.ATT_UL2_L = Tmpdata2 & 0x00FF;                    
1987
-//            }
1986
+            if(Tmpdata + Tmpdata2 <= -200){
1987
+                Tmpdata2 = -200 + (Tmpdata * -1);
1988
+                bluecell_Currdatastatus.ATT_UL2_H = ((Tmpdata2 & 0xFF00) >> 8);
1989
+                bluecell_Currdatastatus.ATT_UL2_L = Tmpdata2 & 0x00FF;                    
1990
+            }
1988 1991
             UL_ALC_GainAttenSet[ALC_Alarm_UL2_Index] = true;
1989 1992
             ALC_Level_Save[ALC_Alarm_UL2_Index] = bluecell_Currdatastatus.ULO_Level2_H << 8 | bluecell_Currdatastatus.ULO_Level2_L;
1990 1993
         }
1991
-//        CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);
1994
+        CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);
1992 1995
 
1993 1996
 
1994 1997
         /*
@@ -2003,15 +2006,15 @@ bool Bluecell_Operate(uint8_t* data){
2003 2006
         if(bluecell_Currdatastatus.ULO_ALC_ON_OFF == true){
2004 2007
             Tmpdata = bluecell_Currdatastatus.MBIC_ULO_ALC_Atten3_H << 8 | bluecell_Currdatastatus.MBIC_ULO_ALC_Atten3_L;
2005 2008
             Tmpdata2 = bluecell_Currdatastatus.ATT_UL3_H << 8 | bluecell_Currdatastatus.ATT_UL3_L;
2006
-//            if(Tmpdata + Tmpdata2 <= -200){
2007
-//                Tmpdata2 = -200 + (Tmpdata * -2);
2008
-//                bluecell_Currdatastatus.ATT_UL3_H = ((Tmpdata2 & 0xFF00) >> 8);
2009
-//                bluecell_Currdatastatus.ATT_UL3_L = Tmpdata2 & 0x00FF;                    
2010
-//            }
2009
+            if(Tmpdata + Tmpdata2 <= -200){
2010
+                Tmpdata2 = -200 + (Tmpdata * -2);
2011
+                bluecell_Currdatastatus.ATT_UL3_H = ((Tmpdata2 & 0xFF00) >> 8);
2012
+                bluecell_Currdatastatus.ATT_UL3_L = Tmpdata2 & 0x00FF;                    
2013
+            }
2011 2014
             UL_ALC_GainAttenSet[ALC_Alarm_UL3_Index] = true;
2012 2015
             ALC_Level_Save[ALC_Alarm_UL3_Index] = bluecell_Currdatastatus.ULO_Level3_H << 8 | bluecell_Currdatastatus.ULO_Level3_L;
2013 2016
         }
2014
-//        CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);
2017
+        CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);
2015 2018
 
2016 2019
         /*
2017 2020
             Atten Ctrl Function
@@ -2025,15 +2028,15 @@ bool Bluecell_Operate(uint8_t* data){
2025 2028
         if(bluecell_Currdatastatus.ULO_ALC_ON_OFF == true){
2026 2029
             Tmpdata = bluecell_Currdatastatus.MBIC_ULO_ALC_Atten4_H << 8 | bluecell_Currdatastatus.MBIC_ULO_ALC_Atten4_L;
2027 2030
             Tmpdata2 = bluecell_Currdatastatus.ATT_UL4_H << 8 | bluecell_Currdatastatus.ATT_UL4_L;
2028
-//            if(Tmpdata + Tmpdata2 <= -200){
2029
-//                Tmpdata2 = -200 + (Tmpdata * -2);
2030
-//                bluecell_Currdatastatus.ATT_UL4_H = ((Tmpdata2 & 0xFF00) >> 8);
2031
-//                bluecell_Currdatastatus.ATT_UL4_L = Tmpdata2 & 0x00FF;                    
2032
-//            }
2031
+            if(Tmpdata + Tmpdata2 <= -200){
2032
+                Tmpdata2 = -200 + (Tmpdata * -2);
2033
+                bluecell_Currdatastatus.ATT_UL4_H = ((Tmpdata2 & 0xFF00) >> 8);
2034
+                bluecell_Currdatastatus.ATT_UL4_L = Tmpdata2 & 0x00FF;                    
2035
+            }
2033 2036
             UL_ALC_GainAttenSet[ALC_Alarm_UL4_Index] = true;
2034 2037
             ALC_Level_Save[ALC_Alarm_UL4_Index] = bluecell_Currdatastatus.ULO_Level4_H << 8 | bluecell_Currdatastatus.ULO_Level4_L;
2035 2038
         }
2036
-//        CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);
2039
+        CompareAttenData(bluecell_Currdatastatus,bluecell_Prevdatastatus);
2037 2040
 
2038 2041
         ALCTimerCnt = 0;
2039 2042
 
@@ -3027,6 +3030,10 @@ bool Bluecell_Operate(uint8_t* data){
3027 3030
         bluecell_Currdatastatus.UL_Det_Path_Offset[3] = data[BLUECELL_DATA]; 
3028 3031
 //        printf("Bluecell_UL_Det_Path4_Offset : %d \r\n",bluecell_Currdatastatus.UL_Det_Path_Offset[3]);        
3029 3032
         break;
3033
+    case Bluecell_Temp_Shutdown_Path_ON_OFF:
3034
+         bluecell_Prevdatastatus.Path_TempShutdown_Set = data[MBIC_PAYLOADSTART + 3];
3035
+         Temp_Shutdown_ONOFF(bluecell_Prevdatastatus.Path_TempShutdown_Set);
3036
+        break;
3030 3037
   }
3031 3038
   
3032 3039
   if(datatype != Bluecell_StatusReq
@@ -4532,7 +4539,7 @@ void Carrier_ONOFF(uint8_t val){
4532 4539
     }
4533 4540
 }
4534 4541
 void Temp_Shutdown_ONOFF(uint8_t val){
4535
-    if(val == 0){// ON
4542
+    if(val == 0){// ON //Path ON
4536 4543
          bluecell_Currdatastatus.ATT_DL1_PATH= TempShutdown_DL_SaveData[0];    
4537 4544
          bluecell_Currdatastatus.ATT_DL2_PATH= TempShutdown_DL_SaveData[1];    
4538 4545
          bluecell_Currdatastatus.ATT_DL3_PATH= TempShutdown_DL_SaveData[2];    
@@ -4553,6 +4560,8 @@ void Temp_Shutdown_ONOFF(uint8_t val){
4553 4560
         TempShutdown_UL_SaveData[1] = bluecell_Currdatastatus.ATT_UL2_PATH;
4554 4561
         TempShutdown_UL_SaveData[2] = bluecell_Currdatastatus.ATT_UL3_PATH;
4555 4562
         TempShutdown_UL_SaveData[3] = bluecell_Currdatastatus.ATT_UL4_PATH;
4563
+
4564
+        
4556 4565
         bluecell_Currdatastatus.ATT_DL1_PATH = false;    
4557 4566
         bluecell_Currdatastatus.ATT_DL2_PATH = false;    
4558 4567
         bluecell_Currdatastatus.ATT_DL3_PATH = false;    
@@ -4813,8 +4822,8 @@ bool MBIC_Operate(uint8_t* data){
4813 4822
                     bluecell_Currdatastatus.Manufacture_Date[i] = data[MBIC_PAYLOADSTART + 3 + i]; 
4814 4823
                 break;
4815 4824
             case Temp_Shutdown_Path_ON_OFF:
4816
-                bluecell_Prevdatastatus.MBIC_Download_Auto_Restart_Set = data[MBIC_PAYLOADSTART + 3];
4817
-                Temp_Shutdown_ONOFF(bluecell_Prevdatastatus.MBIC_Download_Auto_Restart_Set);
4825
+                bluecell_Prevdatastatus.Path_TempShutdown_Set = data[MBIC_PAYLOADSTART + 3];
4826
+                Temp_Shutdown_ONOFF(bluecell_Prevdatastatus.Path_TempShutdown_Set);
4818 4827
                 break;
4819 4828
             case  Carrier_ON_OFF                          :
4820 4829
                 bluecell_Currdatastatus.Carrier_ON_OFF = data[MBIC_PAYLOADSTART + 3]; 
@@ -5284,7 +5293,6 @@ bool MBIC_Operate(uint8_t* data){
5284 5293
         }
5285 5294
          data[MBIC_CMD_0] = 0x81;//MBIC_ERRRESPONSE;
5286 5295
         Length = MBIC_DataSend(data);
5287
-//        if(Temp_Shutdown_Path_ON_OFF)
5288 5296
         Bluecell_StructCpy(&DataWrite[0],&bluecell_Currdatastatus.bluecell_header,sizeof(BLUESTATUS_st));
5289 5297
         EEPROM_M24C08_write(EEPROM_M24C08_ID ,(EEPROM_WINDOW_STATUS_ADDRESDS),&DataWrite[0],sizeof(BLUESTATUS_st));
5290 5298
     }
@@ -6106,23 +6114,24 @@ void ADC_Sampling_Func(){
6106 6114
         Total_SamplingCnt = 5;
6107 6115
 }
6108 6116
 #else
6117
+uint32_t Adc1_ret[ADC1_CNT] = {0,};
6118
+uint16_t Adc1_arrange[ADC1_CNT] = {0,};
6119
+uint16_t Adc1_HFR_Array[ADC1_CNT][6] = {0,};
6120
+uint16_t Adc1_HFR_Desc_Array[ADC1_CNT][6] = {0,};
6121
+uint32_t Adc1_HFR_Ret[ADC1_CNT]= {0,};
6122
+
6123
+uint32_t Adc3_ret[ADC3_CNT] = {0,};
6124
+uint16_t Adc3_arrange[ADC3_CNT] = {0,};
6125
+uint16_t Adc3_HFR_Array[ADC3_CNT][6] = {0,};
6126
+uint16_t Adc3_HFR_Desc_Array[ADC3_CNT][6] = {0,};
6127
+uint32_t Adc3_HFR_Ret[ADC3_CNT]= {0,};
6128
+
6129
+uint8_t Sampling_Cnt = 0; // 1cbt 100ms
6130
+uint8_t Total_SamplingCnt = 0; // 6 Cnt - 600ms
6131
+#if 0 // PYJ.2020.08.11_BEGIN -- 
6109 6132
 void ADC_Sampling_Func(){
6110 6133
     uint8_t ret = ADC_100ms_Cnt % 2;
6111 6134
     
6112
-    static uint32_t Adc1_ret[ADC1_CNT] = {0,};
6113
-    static uint16_t Adc1_arrange[ADC1_CNT] = {0,};
6114
-    static uint16_t Adc1_HFR_Array[ADC1_CNT][6] = {0,};
6115
-    static uint16_t Adc1_HFR_Desc_Array[ADC1_CNT][6] = {0,};
6116
-    static uint32_t Adc1_HFR_Ret[ADC1_CNT]= {0,};
6117
-    
6118
-    static uint32_t Adc3_ret[ADC3_CNT] = {0,};
6119
-    static uint16_t Adc3_arrange[ADC3_CNT] = {0,};
6120
-    static uint16_t Adc3_HFR_Array[ADC3_CNT][6] = {0,};
6121
-    static uint16_t Adc3_HFR_Desc_Array[ADC3_CNT][6] = {0,};
6122
-    static uint32_t Adc3_HFR_Ret[ADC3_CNT]= {0,};
6123
-    
6124
-    static uint8_t Sampling_Cnt = 0; // 1cbt 100ms
6125
-    static uint8_t Total_SamplingCnt = 0; // 6 Cnt - 600ms
6126 6135
 
6127 6136
     double ADC1DoubleRet[ADC1_CNT];
6128 6137
     double ADC3DoubleRet[ADC3_CNT];
@@ -6143,6 +6152,9 @@ void ADC_Sampling_Func(){
6143 6152
         adc1cnt = 0;
6144 6153
         adc3cnt = 0;
6145 6154
         Sampling_Cnt++;
6155
+        printf("ADC_100ms_Cnt : %d \r\n",ADC_100ms_Cnt);
6156
+    }else{
6157
+        return;
6146 6158
     }
6147 6159
     
6148 6160
 
@@ -6276,6 +6288,192 @@ void ADC_Sampling_Func(){
6276 6288
     if(Total_SamplingCnt >= 5)
6277 6289
         Total_SamplingCnt = 5;
6278 6290
 }
6291
+//#else 
6292
+void ADC_Sampling_Func(uint8_t mode,uint16_t Timer2ms_AdcValue,uint8_t index){
6293
+    static uint32_t TempAdc1[ADC1_CNT] = {0,};
6294
+    static uint32_t TempAdc3[ADC3_CNT] = {0,}; 
6295
+    static uint8_t ADC1_TotalCnt[ADC1_CNT] = {0,} ;
6296
+    static uint8_t ADC3_TotalCnt[ADC3_CNT] = {0,} ;  
6297
+    
6298
+    static uint8_t ADC1_TotalSamplingCnt[ADC1_CNT] = {0,} ;
6299
+    static uint8_t ADC3_TotalSamplingCnt[ADC3_CNT] = {0,} ;  
6300
+    double temp = 0;
6301
+    double ADC1DoubleRet[ADC1_CNT];
6302
+    double ADC3DoubleRet[ADC3_CNT];
6303
+
6304
+
6305
+    if(mode == 1){
6306
+        TempAdc1[index] += Timer2ms_AdcValue;
6307
+        ADC1_TotalCnt[index]++;
6308
+
6309
+        if(ADC1_TotalCnt[index] >= 50){
6310
+            TempAdc1[index] /= ADC1_TotalCnt[index];
6311
+           /* ADC1DoubleRet[index]  = ((TempAdc1[index] * 3.3 /4096) * 1000);
6312
+            TempAdc1[index] = ADC1DoubleRet[index];*/
6313
+            /**/
6314
+
6315
+            
6316
+           if(ADC1_TotalSamplingCnt[index] == HFR_REQUSET_TOTAL_CNT - 1){
6317
+               ArrayMoveBack(&Adc1_HFR_Array[index][0],HFR_REQUSET_TOTAL_CNT);
6318
+               Adc1_HFR_Array[index][HFR_REQUSET_TOTAL_CNT - 1] 
6319
+                   = TempAdc1[index];
6320
+           }
6321
+           else{
6322
+               Adc1_HFR_Array[index][ADC1_TotalSamplingCnt[index]] 
6323
+                   = TempAdc1[index];
6324
+           }
6325
+
6326
+           for(int repl = 0; repl < 6; repl++){
6327
+              Adc1_HFR_Desc_Array[index][repl] = Adc1_HFR_Array[index][repl];
6328
+//               if(index == 3)
6329
+//                printf("Adc1_HFR_Array[index] : %d \r\n",Adc1_HFR_Array[index][repl]);
6330
+              
6331
+           }
6332
+           
6333
+           DascendigFunc(&Adc1_HFR_Desc_Array[index][0],HFR_REQUSET_TOTAL_CNT);
6334
+           for(int a = 1; a < 5; a++){
6335
+               Adc1_HFR_Ret[index] += Adc1_HFR_Desc_Array[index][a];
6336
+               
6337
+           }
6338
+           Adc1_HFR_Ret[index] /= 4;
6339
+
6340
+           ADC1DoubleRet[index] = ((Adc1_HFR_Ret[index] * 3.3 /4096) * 1000);
6341
+           ADC1Ret[index] = ADC1DoubleRet[index];
6342
+
6343
+
6344
+
6345
+            /**/
6346
+            if(index == 0){
6347
+                bluecell_Currdatastatus.ULO_P1_Level1_H 
6348
+                    = (((uint16_t)ADC1Ret[index] & 0xFF00) >> 8);
6349
+                bluecell_Currdatastatus.ULO_P1_Level1_L 
6350
+                        = (((uint16_t)ADC1Ret[index] & 0x00FF) );
6351
+            }
6352
+            else if(index == 1){
6353
+                bluecell_Currdatastatus.ULO_P2_Level2_H 
6354
+                    = (((uint16_t)ADC1Ret[index] & 0xFF00) >> 8);
6355
+                bluecell_Currdatastatus.ULO_P2_Level2_L 
6356
+                    = (((uint16_t)ADC1Ret[index] & 0x00FF) );
6357
+            }
6358
+            else if(index == 2){
6359
+
6360
+                bluecell_Currdatastatus.ULO_P3_Level3_H 
6361
+                    = (((uint16_t)ADC1Ret[index] & 0xFF00) >> 8);
6362
+                bluecell_Currdatastatus.ULO_P3_Level3_L 
6363
+                    = (((uint16_t)ADC1Ret[index] & 0x00FF) );
6364
+            }
6365
+            /* *
6366
+            온도 소수점 제거
6367
+            */
6368
+            else if(index == 3){
6369
+//                printf("Temp %d \r\n",ADC1Ret[index]);
6370
+                temp = ((uint16_t)ADC1Ret[index] * 0.001);
6371
+                bluecell_Currdatastatus.DET_TEMP =  ((temp - 0.5) * 100);
6372
+                bluecell_Currdatastatus.DET_TEMP  += bluecell_Currdatastatus.bluecell_User_TEMP_OFFSET;        
6373
+            }
6374
+            Adc1_ret[index] = 0;
6375
+            Adc1_arrange[index] = 0;
6376
+            Adc1_HFR_Ret[index] = 0;            
6377
+            ADC1_TotalCnt[index] = 0;
6378
+            TempAdc1[index] = 0;
6379
+            ADC1_TotalSamplingCnt[index]++;
6380
+        }        
6381
+    }
6382
+    else if(mode == 3){
6383
+        TempAdc3[index] += Timer2ms_AdcValue;    
6384
+        ADC3_TotalCnt[index]++;
6385
+
6386
+        if(ADC3_TotalCnt[index] >= 50){
6387
+            TempAdc3[index] /= ADC3_TotalCnt[index];
6388
+//            ADC3DoubleRet[index]  = ((TempAdc3[index] * 3.3 /4096) * 1000);
6389
+//            TempAdc3[index] = ADC3DoubleRet[index];
6390
+
6391
+
6392
+
6393
+/**/
6394
+
6395
+            
6396
+           if(ADC3_TotalSamplingCnt[index] == HFR_REQUSET_TOTAL_CNT - 1){
6397
+               ArrayMoveBack(&Adc3_HFR_Array[index][0],HFR_REQUSET_TOTAL_CNT);
6398
+               Adc3_HFR_Array[index][HFR_REQUSET_TOTAL_CNT - 1] 
6399
+                   = TempAdc3[index];
6400
+           }
6401
+           else{
6402
+               Adc3_HFR_Array[index][ADC3_TotalSamplingCnt[index]] 
6403
+                   = TempAdc3[index];
6404
+           }
6405
+
6406
+           for(int repl = 0; repl < 6; repl++){
6407
+              Adc3_HFR_Desc_Array[index][repl] = Adc3_HFR_Array[index][repl];
6408
+//               if(index == 3)
6409
+//                printf("Adc3_HFR_Array[index] : %d \r\n",Adc3_HFR_Array[index][repl]);
6410
+              
6411
+           }
6412
+           
6413
+           DascendigFunc(&Adc3_HFR_Desc_Array[index][0],HFR_REQUSET_TOTAL_CNT);
6414
+           for(int a = 1; a < 5; a++){
6415
+               Adc3_HFR_Ret[index] += Adc3_HFR_Desc_Array[index][a];
6416
+               
6417
+           }
6418
+           Adc3_HFR_Ret[index] /= 4;
6419
+
6420
+           ADC3DoubleRet[index] = ((Adc3_HFR_Ret[index] * 3.3 /4096) * 1000);
6421
+           ADC3Ret[index] = ADC3DoubleRet[index];
6422
+
6423
+
6424
+
6425
+            /**/
6426
+
6427
+            if(index == 1){
6428
+                bluecell_Currdatastatus.DLI_P1_Level1_H 
6429
+                    = (((uint16_t)TempAdc3[index] & 0xFF00) >> 8);
6430
+                bluecell_Currdatastatus.DLI_P1_Level1_L 
6431
+                    = (((uint16_t)TempAdc3[index] & 0x00FF));
6432
+            }
6433
+            else if(index == 2){
6434
+                bluecell_Currdatastatus.DLI_P2_Level2_H 
6435
+                    = (((uint16_t)TempAdc3[index] & 0xFF00) >> 8);
6436
+                bluecell_Currdatastatus.DLI_P2_Level2_L 
6437
+                    = (((uint16_t)TempAdc3[index] & 0x00FF) );
6438
+            }
6439
+            else if(index == 3){                
6440
+                bluecell_Currdatastatus.DLI_P3_Level3_H 
6441
+                    = (((uint16_t)TempAdc3[index] & 0xFF00) >> 8);
6442
+                bluecell_Currdatastatus.DLI_P3_Level3_L 
6443
+                    = (((uint16_t)TempAdc3[index] & 0x00FF) );
6444
+            }
6445
+            else if(index == 4){                
6446
+                bluecell_Currdatastatus.DLI_P4_Level4_H 
6447
+                    = (((uint16_t)TempAdc3[index] & 0xFF00) >> 8);
6448
+                bluecell_Currdatastatus.DLI_P4_Level4_L 
6449
+                    = (((uint16_t)TempAdc3[index] & 0x00FF) );
6450
+            }
6451
+            else if(index == 0){                
6452
+                bluecell_Currdatastatus.ULO_P4_Level4_H 
6453
+                    = (((uint16_t)TempAdc3[index] & 0xFF00) >> 8);
6454
+                bluecell_Currdatastatus.ULO_P4_Level4_L 
6455
+                    = (((uint16_t)TempAdc3[index] & 0x00FF) );           
6456
+            }
6457
+            Adc3_ret[index] = 0;
6458
+            Adc3_arrange[index] = 0;
6459
+            Adc3_HFR_Ret[index] = 0;            
6460
+            ADC3_TotalCnt[index] = 0;
6461
+            TempAdc3[index] = 0;
6462
+            ADC3_TotalSamplingCnt[index]++;
6463
+
6464
+        }        
6465
+
6466
+    }
6467
+
6468
+    if(ADC1_TotalSamplingCnt[index] >= 5)
6469
+        ADC1_TotalSamplingCnt[index] = 5;   
6470
+    if(ADC3_TotalSamplingCnt[index] >= 5)
6471
+        ADC3_TotalSamplingCnt[index] = 5;   
6472
+    
6473
+    
6474
+}
6475
+
6476
+#endif // PYJ.2020.08.11_END -- 
6279 6477
 
6280 6478
 
6281 6479
 #endif // PYJ.2020.08.07_END -- 
@@ -6299,7 +6497,10 @@ void ADC_Check(void){
6299 6497
 //        printf("%d\r\n",ADC_100ms_Cnt);
6300 6498
 //    }
6301 6499
 
6302
-    if(adc3cnt >= ADC_AVERAGECNT){
6500
+//    if(adc3cnt >= ADC_AVERAGECNT){
6501
+    if(ADC_100ms_Cnt >= 100){
6502
+        ADC_100ms_Cnt = 0;
6503
+        printf("adc3cnt : %d \r\n",adc3cnt);
6303 6504
 #if 1 // PYJ.2020.05.25_BEGIN -- 
6304 6505
       for(int i = 0; i < ADC3_CNT; i++){
6305 6506
                 DascendigFunc(&ADC3valuearray[i][0],ADC_AVERAGECNT);
@@ -6404,10 +6605,145 @@ void ADC_Check(void){
6404 6605
         adc1cnt = 0;
6405 6606
 
6406 6607
     }
6608
+#else    
6609
+    //static uint8_t Cnt = 0;
6610
+   double ADC1DoubleRet[4];
6611
+   double ADC3DoubleRet[5];
6612
+   uint32_t ADC1_Average_value[ADC1_CNT];
6613
+   static uint32_t HFR_ADC1_Average_value[ADC1_CNT];
6614
+   uint32_t ADC3_Average_value[ADC3_CNT];
6615
+
6616
+   // double ret = 0;
6617
+    uint16_t MIN_ADC[ADC3_CNT] = {0,};
6618
+    uint16_t cnt[ADC3_CNT] = {0,};
6619
+    double temp;
6620
+//    if(AdcTimerCnt > 10){
6621
+    // 정렬할 배열, 요소 개수, 요소 크기, 비교 함수를 넣어줌
6622
+//
6623
+//    if(ADC_100ms_Cnt >= 100){
6624
+//        printf("%d\r\n",ADC_100ms_Cnt);
6625
+//    }
6626
+
6627
+//    if(adc3cnt >= ADC_AVERAGECNT){
6628
+    if(ADC_100ms_Cnt >= 100){
6629
+        
6630
+        //        printf("adc3cnt : %d \r\n",adc3cnt);
6631
+        for(int i = 0; i < ADC3_CNT; i++){
6632
+            ADC3DoubleRet[i] = HFR_ADC3value[i] / adc3cnt;
6633
+            
6634
+            Adc3_HFR_Array[i][Total_SamplingCnt] = ADC3DoubleRet[i];
6635
+            if(Total_SamplingCnt == HFR_REQUSET_TOTAL_CNT - 1){
6636
+                ArrayMoveBack(&Adc3_HFR_Array[i][0],HFR_REQUSET_TOTAL_CNT);
6637
+            }
6638
+            for(int repl = 0; repl < 6; repl++){
6639
+               Adc3_HFR_Desc_Array[i][repl] = Adc3_HFR_Array[i][repl];
6640
+               
6641
+            }
6642
+            DascendigFunc(&Adc3_HFR_Desc_Array[i][0],HFR_REQUSET_TOTAL_CNT);
6643
+            for(int a = 1; a < 5; a++){
6644
+                Adc3_HFR_Ret[i] += Adc3_HFR_Desc_Array[i][a];
6645
+                
6646
+            }
6647
+            Adc3_HFR_Ret[i] /= 4;
6648
+            ADC3DoubleRet[i] = ((Adc3_HFR_Ret[i] * 3.3 /4096) * 1000);
6649
+            ADC3Ret[i] = ADC3DoubleRet[i];
6650
+            Adc3_HFR_Ret[i] = 0;      
6651
+            HFR_ADC3value[i] =0 ;
6652
+        }
6653
+        bluecell_Currdatastatus.DLI_P1_Level1_H 
6654
+            = ((ADC3Ret[1] & 0xFF00) >> 8);
6655
+        bluecell_Currdatastatus.DLI_P1_Level1_L 
6656
+            = ((ADC3Ret[1] & 0x00FF));
6657
+        
6658
+        
6659
+        bluecell_Currdatastatus.DLI_P2_Level2_H 
6660
+            = ((ADC3Ret[2] & 0xFF00) >> 8);
6661
+        bluecell_Currdatastatus.DLI_P2_Level2_L 
6662
+            = ((ADC3Ret[2] & 0x00FF) );
6663
+        
6664
+            
6665
+        bluecell_Currdatastatus.DLI_P3_Level3_H 
6666
+            = ((ADC3Ret[3] & 0xFF00) >> 8);
6667
+        bluecell_Currdatastatus.DLI_P3_Level3_L 
6668
+            = ((ADC3Ret[3] & 0x00FF) );
6669
+        
6670
+            
6671
+        bluecell_Currdatastatus.DLI_P4_Level4_H 
6672
+            = ((ADC3Ret[4] & 0xFF00) >> 8);
6673
+        bluecell_Currdatastatus.DLI_P4_Level4_L 
6674
+            = ((ADC3Ret[4] & 0x00FF) );
6675
+        
6676
+            
6677
+        bluecell_Currdatastatus.ULO_P4_Level4_H 
6678
+            = ((ADC3Ret[0] & 0xFF00) >> 8);
6679
+        bluecell_Currdatastatus.ULO_P4_Level4_L 
6680
+            = ((ADC3Ret[0] & 0x00FF) );
6681
+
6682
+        
6683
+        for(int i = 0; i < ADC1_CNT; i++){
6684
+            ADC1DoubleRet[i] = HFR_ADC1value[i] / adc1cnt;
6685
+            Adc1_HFR_Array[i][Total_SamplingCnt] = ADC1DoubleRet[i];
6686
+            if(Total_SamplingCnt == HFR_REQUSET_TOTAL_CNT - 1){
6687
+                ArrayMoveBack(&Adc1_HFR_Array[i][0],HFR_REQUSET_TOTAL_CNT);
6688
+            }
6689
+            for(int repl = 0; repl < 6; repl++){
6690
+               Adc1_HFR_Desc_Array[i][repl] = Adc1_HFR_Array[i][repl];
6691
+               
6692
+            }
6693
+            DascendigFunc(&Adc1_HFR_Desc_Array[i][0],HFR_REQUSET_TOTAL_CNT);
6694
+            for(int a = 1; a < 5; a++){
6695
+                Adc1_HFR_Ret[i] += Adc1_HFR_Desc_Array[i][a];
6696
+                
6697
+            }
6698
+            Adc1_HFR_Ret[i] /= 4;
6699
+            ADC1DoubleRet[i] = ((Adc1_HFR_Ret[i] * 3.3 /4096) * 1000);
6700
+            ADC1Ret[i] = ADC1DoubleRet[i];
6701
+            Adc1_HFR_Ret[i] = 0;     
6702
+            HFR_ADC1value[i] = 0;
6703
+        }
6704
+        bluecell_Currdatastatus.ULO_P1_Level1_H 
6705
+            = ((ADC1Ret[0] & 0xFF00) >> 8);
6706
+        bluecell_Currdatastatus.ULO_P1_Level1_L 
6707
+            = ((ADC1Ret[0] & 0x00FF) );
6708
+
6709
+            
6710
+        bluecell_Currdatastatus.ULO_P2_Level2_H 
6711
+            = ((ADC1Ret[1] & 0xFF00) >> 8);
6712
+        bluecell_Currdatastatus.ULO_P2_Level2_L 
6713
+            = ((ADC1Ret[1] & 0x00FF) );
6714
+
6715
+            
6716
+        bluecell_Currdatastatus.ULO_P3_Level3_H 
6717
+            = ((ADC1Ret[2] & 0xFF00) >> 8);
6718
+        bluecell_Currdatastatus.ULO_P3_Level3_L 
6719
+            = ((ADC1Ret[2] & 0x00FF) );
6720
+
6721
+/* *
6722
+온도 소수점 제거
6723
+*/
6724
+        temp = (ADC1Ret[3] * 0.001);
6725
+        bluecell_Currdatastatus.DET_TEMP =  ((temp - 0.5) * 100);
6726
+        bluecell_Currdatastatus.DET_TEMP  += bluecell_Currdatastatus.bluecell_User_TEMP_OFFSET;        
6727
+
6728
+
6729
+        Total_SamplingCnt++;
6730
+        
6731
+        if(Total_SamplingCnt >=5)
6732
+            Total_SamplingCnt = 5;
6733
+         
6734
+        adc3cnt = 0;
6735
+        adc1cnt = 0;
6736
+        ADC_100ms_Cnt = 0;
6737
+
6738
+    }
6739
+
6407 6740
 #endif // PYJ.2020.08.07_END -- 
6741
+//    ADC_Sampling_Func();
6742
+
6408 6743
     /*
6409 6744
         After ADC calculation is completed, start Det Alarm check.
6410 6745
     */
6746
+
6411 6747
     DET_LevelAlarmCheck();/*DL UL Alarm Check*/
6412 6748
 }
6413 6749
 

+ 40 - 0
Bluecell_Src/eeprom.c

@@ -250,6 +250,46 @@ void EEPROM_M24C08_Init(void){
250 250
     bluecell_Currdatastatus.Type = 0;
251 251
 
252 252
 
253
+    if(bluecell_Currdatastatus.Path_TempSave_Bit == 0x80)
254
+        bluecell_Currdatastatus.ATT_DL1_PATH = true;
255
+    else
256
+        bluecell_Currdatastatus.ATT_DL1_PATH = false;
257
+
258
+    if(bluecell_Currdatastatus.Path_TempSave_Bit == 0x40)
259
+        bluecell_Currdatastatus.ATT_DL2_PATH = true;
260
+    else
261
+        bluecell_Currdatastatus.ATT_DL2_PATH = false;
262
+
263
+    if(bluecell_Currdatastatus.Path_TempSave_Bit == 0x20)
264
+        bluecell_Currdatastatus.ATT_DL3_PATH = true;
265
+    else
266
+        bluecell_Currdatastatus.ATT_DL3_PATH = false;
267
+
268
+    if(bluecell_Currdatastatus.Path_TempSave_Bit == 0x10)
269
+        bluecell_Currdatastatus.ATT_DL4_PATH = true;
270
+    else
271
+        bluecell_Currdatastatus.ATT_DL4_PATH = false;
272
+
273
+    if(bluecell_Currdatastatus.Path_TempSave_Bit == 0x08)
274
+        bluecell_Currdatastatus.ATT_UL1_PATH = true;
275
+    else
276
+        bluecell_Currdatastatus.ATT_UL1_PATH = false;
277
+
278
+    if(bluecell_Currdatastatus.Path_TempSave_Bit == 0x04)
279
+        bluecell_Currdatastatus.ATT_UL2_PATH = true;
280
+    else
281
+        bluecell_Currdatastatus.ATT_UL2_PATH = false;
282
+
283
+    if(bluecell_Currdatastatus.Path_TempSave_Bit == 0x02)
284
+        bluecell_Currdatastatus.ATT_UL3_PATH = true;
285
+    else
286
+        bluecell_Currdatastatus.ATT_UL3_PATH = false;
287
+
288
+    if(bluecell_Currdatastatus.Path_TempSave_Bit == 0x01)
289
+        bluecell_Currdatastatus.ATT_UL4_PATH = true;
290
+    else
291
+        bluecell_Currdatastatus.ATT_UL4_PATH = false;
292
+
253 293
 //    printf("PCB Version : %d.%d \r\n",bluecell_Currdatastatus.PCB_Version[0],bluecell_Currdatastatus.PCB_Version[1]);
254 294
 //    printf("Serial Number : ");
255 295
 //    for(int a = 0; a < 20; a++){

+ 1 - 1
STM32F103ZET_JDASMBIC.ioc

@@ -177,7 +177,7 @@ Mcu.UserConstants=
177 177
 Mcu.UserName=STM32F103ZETx
178 178
 MxCube.Version=5.6.1
179 179
 MxDb.Version=DB.5.0.60
180
-NVIC.ADC1_2_IRQn=true\:0\:0\:false\:false\:true\:true\:true
180
+NVIC.ADC1_2_IRQn=true\:0\:0\:false\:true\:true\:11\:true\:true
181 181
 NVIC.ADC3_IRQn=true\:0\:0\:false\:true\:true\:6\:true\:true
182 182
 NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
183 183
 NVIC.DMA1_Channel1_IRQn=true\:0\:0\:false\:true\:true\:1\:false\:true

+ 38 - 7
Src/main.c

@@ -67,8 +67,11 @@ DMA_HandleTypeDef hdma_usart2_tx;
67 67
 volatile uint16_t ADC1value[ADC1_CNT];
68 68
 volatile uint16_t ADC3value[ADC3_CNT];
69 69
 
70
-volatile uint16_t ADC1valuearray[ADC1_CNT][ADC_AVERAGECNT];
71
-volatile uint16_t ADC3valuearray[ADC3_CNT][ADC_AVERAGECNT];
70
+volatile uint32_t HFR_ADC1value[ADC1_CNT];
71
+volatile uint32_t HFR_ADC3value[ADC3_CNT];
72
+
73
+//volatile uint16_t ADC1valuearray[ADC1_CNT][ADC_AVERAGECNT];
74
+//volatile uint16_t ADC3valuearray[ADC3_CNT][ADC_AVERAGECNT];
72 75
 
73 76
 volatile uint32_t AdcTimerCnt = 0;
74 77
 volatile uint32_t LedTimerCnt = 0;
@@ -221,10 +224,16 @@ void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc)
221 224
         }
222 225
     }
223 226
 #else
227
+//    if(adc1cnt == ADC_AVERAGECNT)
228
+//        adc1cnt = 0;
229
+//    if(adc3cnt == ADC_AVERAGECNT)
230
+//        adc3cnt = 0;
224 231
     if(hadc->Instance == hadc1.Instance)
225 232
     {
226 233
         for(int i = 0; i < 4; i++){
227
-            ADC1valuearray[i][adc1cnt] = ADC1value[i];
234
+//            ADC1valuearray[i][adc1cnt] = ADC1value[i];
235
+            HFR_ADC1value[i] += ADC1value[i];
236
+
228 237
         }
229 238
         adc1cnt++;
230 239
     }
@@ -232,10 +241,13 @@ void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc)
232 241
     if(hadc->Instance == hadc3.Instance)
233 242
     {
234 243
         for(int i = 0; i < 5; i++){
235
-            ADC3valuearray[i][adc3cnt] = ADC3value[i];
244
+//            ADC3valuearray[i][adc3cnt] = ADC3value[i];
245
+            HFR_ADC3value[i] += ADC3value[i];            
236 246
         }
237 247
         adc3cnt++;
238 248
     }    
249
+//    printf("ADC_100ms_Cnt : %d \r\n",ADC_100ms_Cnt);
250
+    
239 251
 
240 252
 #endif // PYJ.2020.08.07_END -- 
241 253
 }
@@ -246,7 +258,7 @@ extern void DET_LevelAlarmCheck();
246 258
 extern void ALC_Function();
247 259
 extern void Boot_LED_Toggle(void);
248 260
 extern void ADC_Check(void);
249
-extern void ADC_Sampling_Func();
261
+extern void ADC_Sampling_Func(uint8_t mode,uint16_t Timer2ms_AdcValue,uint8_t index);
250 262
 
251 263
 uint8_t MBICTest_Firmdata[8]  = {1,2,3,4,5,6,7,8};
252 264
 
@@ -299,6 +311,7 @@ int main(void)
299 311
   HAL_ADC_Start_DMA(&hadc1, (uint16_t*)ADC1value, 4);
300 312
   HAL_TIM_Base_Start_IT(&htim6);
301 313
 
314
+
302 315
   setbuf(stdout, NULL);
303 316
   uint32_t  CurrApiAddress = 0,Bank1Address=0,Bank2Address = 0;
304 317
   int32_t CrcLength = 0;
@@ -333,18 +346,33 @@ int main(void)
333 346
   /* USER CODE BEGIN WHILE */
334 347
   while (1)
335 348
   {
349
+//    ADC_Sampling_Func();
350
+    ADC_Check();       /*Det Calc + DL/UL Alarm Check Function*/
336 351
     Boot_LED_Toggle(); /*LED Check*/
337 352
     Uart_Check();      /*Usart Rx*/
338 353
     ALC_Function();    /*ALC Function*/
339 354
     AGC_Function();    /*AGC Function*/
340
-    ADC_Check();       /*Det Calc + DL/UL Alarm Check Function*/
341 355
     Alarm_Check();     /*Function to check all alarm status variables*/
342 356
     FRBT_Operate();
343 357
     SelfTestTimer_Operate();
344 358
     HAL_IWDG_Refresh(&hiwdg);
359
+#if 0 // PYJ.2020.08.11_BEGIN -- 
360
+      for(int i = 0; i < ADC1_CNT; i++){
361
+          ADC_Sampling_Func(1,HFR_ADC1value[i]/adc1cnt,i);
362
+          HFR_ADC1value[i] = 0;
363
+      }
364
+      for(int i = 0; i < ADC3_CNT; i++){
365
+          ADC_Sampling_Func(3,HFR_ADC3value[i]/adc3cnt,i);
366
+          HFR_ADC3value[i] = 0;
367
+      }
368
+      
369
+      adc1cnt = 0;
370
+      adc3cnt = 0;     
371
+#endif // PYJ.2020.08.11_END -- 
345 372
     /* USER CODE END WHILE */
346 373
 
347 374
     /* USER CODE BEGIN 3 */
375
+ 
348 376
   }
349 377
   /* USER CODE END 3 */
350 378
 }
@@ -426,6 +454,9 @@ static void MX_NVIC_Init(void)
426 454
   /* DMA1_Channel5_IRQn interrupt configuration */
427 455
   HAL_NVIC_SetPriority(DMA1_Channel5_IRQn, 0, 0);
428 456
   HAL_NVIC_EnableIRQ(DMA1_Channel5_IRQn);
457
+  /* ADC1_2_IRQn interrupt configuration */
458
+  HAL_NVIC_SetPriority(ADC1_2_IRQn, 0, 0);
459
+  HAL_NVIC_EnableIRQ(ADC1_2_IRQn);
429 460
 }
430 461
 
431 462
 /**
@@ -938,8 +969,8 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
938 969
       LDTimerCnt++;
939 970
       ALCTimerCnt++;
940 971
       AGCTimerCnt++;
941
-      ADC_Sampling_Func();
942 972
       ADC_100ms_Cnt++;
973
+
943 974
 //    pdata = &bluecell_Currdatastatus.ATT_UL1_PATH;
944 975
     UL_Shutdown_Timer(DET_Alarm_UL1_Shutdown_Index);
945 976
 //    pdata = &bluecell_Currdatastatus.ATT_UL2_PATH;

+ 0 - 3
Src/stm32f1xx_hal_msp.c

@@ -140,9 +140,6 @@ void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc)
140 140
 
141 141
     __HAL_LINKDMA(hadc,DMA_Handle,hdma_adc1);
142 142
 
143
-    /* ADC1 interrupt Init */
144
-    HAL_NVIC_SetPriority(ADC1_2_IRQn, 0, 0);
145
-    HAL_NVIC_EnableIRQ(ADC1_2_IRQn);
146 143
   /* USER CODE BEGIN ADC1_MspInit 1 */
147 144
 
148 145
   /* USER CODE END ADC1_MspInit 1 */