Subversion Repositories FlightCtrl

Rev

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

Rev 1180 Rev 1238
Line 934... Line 934...
934
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
934
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
935
// new values from RC
935
// new values from RC
936
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
936
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
937
        if(!NewPpmData-- || (MKFlags & MKFLAG_EMERGENCY_LANDING) ) // NewData = 0 means new data from RC
937
        if(!NewPpmData-- || (MKFlags & MKFLAG_EMERGENCY_LANDING) ) // NewData = 0 means new data from RC
938
        {
938
        {
-
 
939
                static int16_t stick_nick = 0, stick_roll = 0;
-
 
940
 
939
                ParameterMapping(); // remapping params (online poti replacement)
941
                ParameterMapping(); // remapping params (online poti replacement)
-
 
942
 
940
                // calculate Stick inputs by rc channels (P) and changing of rc channels (D)
943
                // calculate Stick inputs by rc channels (P) and changing of rc channels (D)
941
                StickNick = (StickNick * 3 + PPM_in[ParamSet.ChannelAssignment[CH_NICK]] * ParamSet.StickP) / 4;
944
                stick_nick = (stick_nick * 3 + PPM_in[ParamSet.ChannelAssignment[CH_NICK]] * ParamSet.StickP) / 4;
942
                StickNick += PPM_diff[ParamSet.ChannelAssignment[CH_NICK]] * ParamSet.StickD;
945
                stick_nick += PPM_diff[ParamSet.ChannelAssignment[CH_NICK]] * ParamSet.StickD;
943
                StickNick -= (GPSStickNick);
946
                StickNick = stick_nick - GPSStickNick;
Line 944... Line 947...
944
 
947
 
945
                StickRoll = (StickRoll * 3 + PPM_in[ParamSet.ChannelAssignment[CH_ROLL]] * ParamSet.StickP) / 4;
948
                stick_roll = (stick_roll * 3 + PPM_in[ParamSet.ChannelAssignment[CH_ROLL]] * ParamSet.StickP) / 4;
946
                StickRoll += PPM_diff[ParamSet.ChannelAssignment[CH_ROLL]] * ParamSet.StickD;
949
                stick_roll += PPM_diff[ParamSet.ChannelAssignment[CH_ROLL]] * ParamSet.StickD;
Line 947... Line 950...
947
                StickRoll -= (GPSStickRoll);
950
                StickRoll = stick_roll - GPSStickRoll;
948
 
951
 
949
                // mapping of yaw
952
                // mapping of yaw
950
                StickYaw = -PPM_in[ParamSet.ChannelAssignment[CH_YAW]];
953
                StickYaw = -PPM_in[ParamSet.ChannelAssignment[CH_YAW]];