Subversion Repositories FlightCtrl

Rev

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

Rev 1222 Rev 1239
Line 907... Line 907...
907
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
907
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
908
// new values from RC
908
// new values from RC
909
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
909
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
910
        if(!NewPpmData-- || (MKFlags & MKFLAG_EMERGENCY_LANDING) ) // NewData = 0 means new data from RC
910
        if(!NewPpmData-- || (MKFlags & MKFLAG_EMERGENCY_LANDING) ) // NewData = 0 means new data from RC
911
        {
911
        {
-
 
912
                static int16_t stick_nick = 0, stick_roll = 0;
-
 
913
 
912
                ParameterMapping(); // remapping params (online poti replacement)
914
                ParameterMapping(); // remapping params (online poti replacement)
-
 
915
 
913
                // calculate Stick inputs by rc channels (P) and changing of rc channels (D)
916
                // calculate Stick inputs by rc channels (P) and changing of rc channels (D)
914
                StickNick = (StickNick * 3 + PPM_in[ParamSet.ChannelAssignment[CH_NICK]] * ParamSet.StickP) / 4;
917
                stick_nick = (stick_nick * 3 + PPM_in[ParamSet.ChannelAssignment[CH_NICK]] * ParamSet.StickP) / 4;
915
                StickNick += PPM_diff[ParamSet.ChannelAssignment[CH_NICK]] * ParamSet.StickD;
918
                stick_nick += PPM_diff[ParamSet.ChannelAssignment[CH_NICK]] * ParamSet.StickD;
916
                StickNick -= (GPSStickNick);
919
                StickNick = stick_nick - GPSStickNick;
Line 917... Line 920...
917
 
920
 
918
                StickRoll = (StickRoll * 3 + PPM_in[ParamSet.ChannelAssignment[CH_ROLL]] * ParamSet.StickP) / 4;
921
                stick_roll = (stick_roll * 3 + PPM_in[ParamSet.ChannelAssignment[CH_ROLL]] * ParamSet.StickP) / 4;
919
                StickRoll += PPM_diff[ParamSet.ChannelAssignment[CH_ROLL]] * ParamSet.StickD;
922
                stick_roll += PPM_diff[ParamSet.ChannelAssignment[CH_ROLL]] * ParamSet.StickD;
Line 920... Line 923...
920
                StickRoll -= (GPSStickRoll);
923
                StickRoll = stick_roll - GPSStickRoll;
921
 
924
 
922
                // mapping of yaw
925
                // mapping of yaw
923
                StickYaw = -PPM_in[ParamSet.ChannelAssignment[CH_YAW]];
926
                StickYaw = -PPM_in[ParamSet.ChannelAssignment[CH_YAW]];