Przeglądaj źródła

ALC 계산 식 자료형 변경

PYJ 5 lat temu
rodzic
commit
3e63d48f73
1 zmienionych plików z 6 dodań i 3 usunięć
  1. 6 3
      Bluecell_Src/Bluecell_operate.c

+ 6 - 3
Bluecell_Src/Bluecell_operate.c

@@ -6251,7 +6251,7 @@ int8_t Bluecell_TestPro2(double value ){
6251 6251
     int8_t remine = 0;
6252 6252
     double originval = value;
6253 6253
     uint8_t temp = 0;
6254
-    printf("value : %f \r\n",value);
6254
+//    printf("value : %f \r\n",value);
6255 6255
     if(value < 0){
6256 6256
         value *= -1;
6257 6257
         originval *= -1;
@@ -6659,8 +6659,9 @@ int16_t ALC_Calc(uint8_t num,double CurrAtten ,int8_t threshold,double CurrDet){
6659 6659
 void ALC_Alarm_TimerSet(uint8_t num,int16_t threshold,int16_t CurrDet,int16_t Atten,int16_t MainAtten){
6660 6660
     int16_t ret =0;
6661 6661
     int16_t CurrAtten = 0;
6662
-    double M_Atten = 0;
6663
-    M_Atten = (MainAtten*0.1);
6662
+    int16_t M_Atten = 0;
6663
+    M_Atten = (MainAtten * 0.1);
6664
+//    printf("MainAtten : %d \r\n",MainAtten);
6664 6665
     CurrAtten = Atten * 0.1;
6665 6666
         if(CurrAtten + M_Atten >= -18){
6666 6667
             ALC_AlarmSet[num] = false;
@@ -6670,6 +6671,7 @@ void ALC_Alarm_TimerSet(uint8_t num,int16_t threshold,int16_t CurrDet,int16_t At
6670 6671
             ret = CurrDet - threshold ;
6671 6672
             ret = Bluecell_TestPro(ret +( CurrAtten * 0.1 * -1));
6672 6673
             ret *= -1;  
6674
+//            printf("CurrAtten : %d   M_Atten : %d \r\n",CurrAtten,M_Atten);
6673 6675
             if(CurrAtten + M_Atten <= -20){
6674 6676
                 ALC_AlarmSet[num] = true;
6675 6677
 //                printf("Alarm 1 \r\n");
@@ -6760,6 +6762,7 @@ void ALC_Package_Operate(uint8_t*ULO_ADC_Level,uint8_t* ULO_Level,DET_TABLEUL_st
6760 6762
 //    printf("ResdBm : UL%d : %f \r\n",TableIndex + 1,ResdBm);    
6761 6763
 //    printf("ORIGIN ResdBm : %f  %d\r\n",ResdBm,Main_Atten);
6762 6764
 //    printf("After ResdBm : %f \r\n",ResdBm);
6765
+
6763 6766
     ResdBm = HFR_CntUpCalc(ResdBm);
6764 6767
     ResultData = ResdBm;
6765 6768
 //    printf("HFR CALC RET : %d \r\n",ResultData);