sndae / gentlenav

Automatically exported from code.google.com/p/gentlenav
0 stars 0 forks source link

Frsky CPPM 18ms support (solution included) #91

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Connect CPPM Frsky 18ms CPPM signal
2. Set most of the chanels to 100%
3. Try to control throttle, or see RC channels using any mavlink compatible 
ground station

What is the expected output? What do you see instead?
The controll should be possible, but it's not because to short CPPM frame gap.

What version of the product are you using? On what operating system?
N/A

Please provide any additional information below.

The solution is really simple, if we make assumption, that during start up, the 
gap between CPPM frames has correct length, we can use channel counting to 
determine start of new frame.

So you need to modify one line radioIn.c checking if ppm_ch == 
PPM_NUMBER_OF_CHANNELS+1.

#if (USE_PPM_INPUT == 1)
    if (__IC_PIN(PPM_IC) == PPM_PULSE_VALUE)
    {
        uint16_t pulse = time - rise_ppm;
        rise_ppm = time;

                // kku
        //if (pulse > MIN_SYNC_PULSE_WIDTH)
                if ( (pulse > MIN_SYNC_PULSE_WIDTH) || (ppm_ch == PPM_NUMBER_OF_CHANNELS+1))
        {
            ppm_ch = 1;
        }

It works fine, and without any problems.
Regards
Krzysiek

Original issue reported on code.google.com by krzyszto...@gmail.com on 28 Aug 2014 at 8:01