Rev 1227 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1227 | Rev 1240 | ||
---|---|---|---|
Line 910... | Line 910... | ||
910 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
910 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
911 | // new values from RC |
911 | // new values from RC |
912 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
912 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
913 | if(!NewPpmData-- || (MKFlags & MKFLAG_EMERGENCY_LANDING) ) // NewData = 0 means new data from RC |
913 | if(!NewPpmData-- || (MKFlags & MKFLAG_EMERGENCY_LANDING) ) // NewData = 0 means new data from RC |
914 | { |
914 | { |
- | 915 | static int16_t stick_nick = 0, stick_roll = 0; |
|
- | 916 | ||
915 | ParameterMapping(); // remapping params (online poti replacement) |
917 | ParameterMapping(); // remapping params (online poti replacement) |
- | 918 | ||
916 | // calculate Stick inputs by rc channels (P) and changing of rc channels (D) |
919 | // calculate Stick inputs by rc channels (P) and changing of rc channels (D) |
917 | StickNick = (StickNick * 3 + PPM_in[ParamSet.ChannelAssignment[CH_NICK]] * ParamSet.StickP) / 4; |
920 | stick_nick = (stick_nick * 3 + PPM_in[ParamSet.ChannelAssignment[CH_NICK]] * ParamSet.StickP) / 4; |
918 | StickNick += PPM_diff[ParamSet.ChannelAssignment[CH_NICK]] * ParamSet.StickD; |
921 | stick_nick += PPM_diff[ParamSet.ChannelAssignment[CH_NICK]] * ParamSet.StickD; |
919 | StickNick -= (GPSStickNick); |
922 | StickNick = stick_nick - GPSStickNick; |
Line 920... | Line 923... | ||
920 | 923 | ||
921 | StickRoll = (StickRoll * 3 + PPM_in[ParamSet.ChannelAssignment[CH_ROLL]] * ParamSet.StickP) / 4; |
924 | stick_roll = (stick_roll * 3 + PPM_in[ParamSet.ChannelAssignment[CH_ROLL]] * ParamSet.StickP) / 4; |
922 | StickRoll += PPM_diff[ParamSet.ChannelAssignment[CH_ROLL]] * ParamSet.StickD; |
925 | stick_roll += PPM_diff[ParamSet.ChannelAssignment[CH_ROLL]] * ParamSet.StickD; |
Line 923... | Line 926... | ||
923 | StickRoll -= (GPSStickRoll); |
926 | StickRoll = stick_roll - GPSStickRoll; |
924 | 927 | ||
925 | // mapping of yaw |
928 | // mapping of yaw |
926 | StickYaw = -PPM_in[ParamSet.ChannelAssignment[CH_YAW]]; |
929 | StickYaw = -PPM_in[ParamSet.ChannelAssignment[CH_YAW]]; |