Subversion Repositories BL-Ctrl

Rev

Rev 40 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 40 Rev 42
Line 47... Line 47...
47
   PPM_Timeout = 100;
47
   PPM_Timeout = 100;
48
  }
48
  }
49
 else                      // Negative Flanke
49
 else                      // Negative Flanke
50
  {
50
  {
51
    ICP_POS_FLANKE;
51
    ICP_POS_FLANKE;
52
       
-
 
53
#ifdef  _32KHZ 
52
#ifdef  _32KHZ 
54
    ppm = (ICR1 - tim_alt + (int) Timer1Overflow * 256) / 16;
53
    ppm = (ICR1 - tim_alt + (int) Timer1Overflow * 256) / 16;
55
#endif 
54
#endif 
56
#ifdef  _16KHZ 
55
#ifdef  _16KHZ 
57
    ppm = (ICR1 - tim_alt + (int) Timer1Overflow * 512) / 16;
56
    ppm = (ICR1 - tim_alt + (int) Timer1Overflow * 512) / 16;
58
#endif
57
#endif 
59
 
-
 
60
    if(ppm < 280) ppm = 280;
58
    if(ppm < 280) ppm = 280;
61
    ppm -= 280;
59
    ppm -= 280;
62
       
-
 
63
        if(FILTER_PPM) // Filtern
-
 
64
        {
-
 
65
            if(PPM_Signal < ppm)  PPM_Signal++;
60
        if(PPM_Signal < ppm)  PPM_Signal++;
66
            else if(PPM_Signal > ppm)  PPM_Signal--;
61
        else if(PPM_Signal > ppm)  PPM_Signal--;
67
        ppm     = (PPM_Signal * FILTER_PPM + ppm) / (FILTER_PPM + 1);
62
    if(FILTER_PPM)      ppm     = (PPM_Signal * FILTER_PPM + ppm) / (FILTER_PPM + 1);  // Filtern
68
        }
-
 
69
       
-
 
70
    PPM_Signal = ppm;
63
    PPM_Signal = ppm;
71
 
64
       
72
    ZeitZumAdWandeln = 1;
65
    ZeitZumAdWandeln = 1;
73
  }
66
  }
74
}
67
}
Line 75... Line 68...
75
 
68