Subversion Repositories BL-Ctrl

Rev

Rev 31 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 31 Rev 40
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
       
52
#ifdef  _32KHZ 
53
#ifdef  _32KHZ 
53
    ppm = (ICR1 - tim_alt + (int) Timer1Overflow * 512) / 32;
54
    ppm = (ICR1 - tim_alt + (int) Timer1Overflow * 256) / 16;
54
#endif 
55
#endif 
55
#ifdef  _16KHZ 
56
#ifdef  _16KHZ 
56
    ppm = (ICR1 - tim_alt + (int) Timer1Overflow * 1024) / 32;
57
    ppm = (ICR1 - tim_alt + (int) Timer1Overflow * 512) / 16;
57
#endif 
58
#endif
-
 
59
 
58
    if(ppm < 280) ppm = 280;
60
    if(ppm < 280) ppm = 280;
59
    ppm -= 280;
61
    ppm -= 280;
-
 
62
       
-
 
63
        if(FILTER_PPM) // Filtern
-
 
64
        {
60
        if(PPM_Signal < ppm)  PPM_Signal++;
65
            if(PPM_Signal < ppm)  PPM_Signal++;
61
        else if(PPM_Signal > ppm)  PPM_Signal--;
66
            else if(PPM_Signal > ppm)  PPM_Signal--;
62
    if(FILTER_PPM)      ppm     = (PPM_Signal * FILTER_PPM + ppm) / (FILTER_PPM + 1);  // Filtern
67
        ppm     = (PPM_Signal * FILTER_PPM + ppm) / (FILTER_PPM + 1);
-
 
68
        }
-
 
69
       
63
    PPM_Signal = ppm;
70
    PPM_Signal = ppm;
Line 64... Line 71...
64
 
71
 
65
    ZeitZumAdWandeln = 1;
72
    ZeitZumAdWandeln = 1;
66
  }
73
  }