mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 04:15:44 +03:00
Remove gps_common.c's dependencies on the mw.h/board.h.
Moved some GPS code from mw.c into gps_common.c. Moved pid values into a pidProfile_t structure; this was done so that gps_common.c does not have a dependency on config_profile.h. pidProfile_t lives in flight_common.h now. Moved gps profile settings from profile_t into gpsProfile_t for the same reason. Removed gps_common.c's dependency on masterConfig_t by passing needed variables into gpsInit().
This commit is contained in:
parent
f8d0dd98f7
commit
2c80094b0e
14 changed files with 332 additions and 251 deletions
|
@ -201,38 +201,38 @@ const clivalue_t valueTable[] = {
|
|||
{ "baro_cf_vel", VAR_FLOAT, ¤tProfile.baro_cf_vel, 0, 1 },
|
||||
{ "baro_cf_alt", VAR_FLOAT, ¤tProfile.baro_cf_alt, 0, 1 },
|
||||
{ "mag_declination", VAR_INT16, ¤tProfile.mag_declination, -18000, 18000 },
|
||||
{ "gps_pos_p", VAR_UINT8, ¤tProfile.P8[PIDPOS], 0, 200 },
|
||||
{ "gps_pos_i", VAR_UINT8, ¤tProfile.I8[PIDPOS], 0, 200 },
|
||||
{ "gps_pos_d", VAR_UINT8, ¤tProfile.D8[PIDPOS], 0, 200 },
|
||||
{ "gps_posr_p", VAR_UINT8, ¤tProfile.P8[PIDPOSR], 0, 200 },
|
||||
{ "gps_posr_i", VAR_UINT8, ¤tProfile.I8[PIDPOSR], 0, 200 },
|
||||
{ "gps_posr_d", VAR_UINT8, ¤tProfile.D8[PIDPOSR], 0, 200 },
|
||||
{ "gps_nav_p", VAR_UINT8, ¤tProfile.P8[PIDNAVR], 0, 200 },
|
||||
{ "gps_nav_i", VAR_UINT8, ¤tProfile.I8[PIDNAVR], 0, 200 },
|
||||
{ "gps_nav_d", VAR_UINT8, ¤tProfile.D8[PIDNAVR], 0, 200 },
|
||||
{ "gps_wp_radius", VAR_UINT16, ¤tProfile.gps_wp_radius, 0, 2000 },
|
||||
{ "nav_controls_heading", VAR_UINT8, ¤tProfile.nav_controls_heading, 0, 1 },
|
||||
{ "nav_speed_min", VAR_UINT16, ¤tProfile.nav_speed_min, 10, 2000 },
|
||||
{ "nav_speed_max", VAR_UINT16, ¤tProfile.nav_speed_max, 10, 2000 },
|
||||
{ "nav_slew_rate", VAR_UINT8, ¤tProfile.nav_slew_rate, 0, 100 },
|
||||
{ "p_pitch", VAR_UINT8, ¤tProfile.P8[PITCH], 0, 200 },
|
||||
{ "i_pitch", VAR_UINT8, ¤tProfile.I8[PITCH], 0, 200 },
|
||||
{ "d_pitch", VAR_UINT8, ¤tProfile.D8[PITCH], 0, 200 },
|
||||
{ "p_roll", VAR_UINT8, ¤tProfile.P8[ROLL], 0, 200 },
|
||||
{ "i_roll", VAR_UINT8, ¤tProfile.I8[ROLL], 0, 200 },
|
||||
{ "d_roll", VAR_UINT8, ¤tProfile.D8[ROLL], 0, 200 },
|
||||
{ "p_yaw", VAR_UINT8, ¤tProfile.P8[YAW], 0, 200 },
|
||||
{ "i_yaw", VAR_UINT8, ¤tProfile.I8[YAW], 0, 200 },
|
||||
{ "d_yaw", VAR_UINT8, ¤tProfile.D8[YAW], 0, 200 },
|
||||
{ "p_alt", VAR_UINT8, ¤tProfile.P8[PIDALT], 0, 200 },
|
||||
{ "i_alt", VAR_UINT8, ¤tProfile.I8[PIDALT], 0, 200 },
|
||||
{ "d_alt", VAR_UINT8, ¤tProfile.D8[PIDALT], 0, 200 },
|
||||
{ "p_level", VAR_UINT8, ¤tProfile.P8[PIDLEVEL], 0, 200 },
|
||||
{ "i_level", VAR_UINT8, ¤tProfile.I8[PIDLEVEL], 0, 200 },
|
||||
{ "d_level", VAR_UINT8, ¤tProfile.D8[PIDLEVEL], 0, 200 },
|
||||
{ "p_vel", VAR_UINT8, ¤tProfile.P8[PIDVEL], 0, 200 },
|
||||
{ "i_vel", VAR_UINT8, ¤tProfile.I8[PIDVEL], 0, 200 },
|
||||
{ "d_vel", VAR_UINT8, ¤tProfile.D8[PIDVEL], 0, 200 },
|
||||
{ "gps_pos_p", VAR_UINT8, ¤tProfile.pidProfile.P8[PIDPOS], 0, 200 },
|
||||
{ "gps_pos_i", VAR_UINT8, ¤tProfile.pidProfile.I8[PIDPOS], 0, 200 },
|
||||
{ "gps_pos_d", VAR_UINT8, ¤tProfile.pidProfile.D8[PIDPOS], 0, 200 },
|
||||
{ "gps_posr_p", VAR_UINT8, ¤tProfile.pidProfile.P8[PIDPOSR], 0, 200 },
|
||||
{ "gps_posr_i", VAR_UINT8, ¤tProfile.pidProfile.I8[PIDPOSR], 0, 200 },
|
||||
{ "gps_posr_d", VAR_UINT8, ¤tProfile.pidProfile.D8[PIDPOSR], 0, 200 },
|
||||
{ "gps_nav_p", VAR_UINT8, ¤tProfile.pidProfile.P8[PIDNAVR], 0, 200 },
|
||||
{ "gps_nav_i", VAR_UINT8, ¤tProfile.pidProfile.I8[PIDNAVR], 0, 200 },
|
||||
{ "gps_nav_d", VAR_UINT8, ¤tProfile.pidProfile.D8[PIDNAVR], 0, 200 },
|
||||
{ "gps_wp_radius", VAR_UINT16, ¤tProfile.gpsProfile.gps_wp_radius, 0, 2000 },
|
||||
{ "nav_controls_heading", VAR_UINT8, ¤tProfile.gpsProfile.nav_controls_heading, 0, 1 },
|
||||
{ "nav_speed_min", VAR_UINT16, ¤tProfile.gpsProfile.nav_speed_min, 10, 2000 },
|
||||
{ "nav_speed_max", VAR_UINT16, ¤tProfile.gpsProfile.nav_speed_max, 10, 2000 },
|
||||
{ "nav_slew_rate", VAR_UINT8, ¤tProfile.gpsProfile.nav_slew_rate, 0, 100 },
|
||||
{ "p_pitch", VAR_UINT8, ¤tProfile.pidProfile.P8[PITCH], 0, 200 },
|
||||
{ "i_pitch", VAR_UINT8, ¤tProfile.pidProfile.I8[PITCH], 0, 200 },
|
||||
{ "d_pitch", VAR_UINT8, ¤tProfile.pidProfile.D8[PITCH], 0, 200 },
|
||||
{ "p_roll", VAR_UINT8, ¤tProfile.pidProfile.P8[ROLL], 0, 200 },
|
||||
{ "i_roll", VAR_UINT8, ¤tProfile.pidProfile.I8[ROLL], 0, 200 },
|
||||
{ "d_roll", VAR_UINT8, ¤tProfile.pidProfile.D8[ROLL], 0, 200 },
|
||||
{ "p_yaw", VAR_UINT8, ¤tProfile.pidProfile.P8[YAW], 0, 200 },
|
||||
{ "i_yaw", VAR_UINT8, ¤tProfile.pidProfile.I8[YAW], 0, 200 },
|
||||
{ "d_yaw", VAR_UINT8, ¤tProfile.pidProfile.D8[YAW], 0, 200 },
|
||||
{ "p_alt", VAR_UINT8, ¤tProfile.pidProfile.P8[PIDALT], 0, 200 },
|
||||
{ "i_alt", VAR_UINT8, ¤tProfile.pidProfile.I8[PIDALT], 0, 200 },
|
||||
{ "d_alt", VAR_UINT8, ¤tProfile.pidProfile.D8[PIDALT], 0, 200 },
|
||||
{ "p_level", VAR_UINT8, ¤tProfile.pidProfile.P8[PIDLEVEL], 0, 200 },
|
||||
{ "i_level", VAR_UINT8, ¤tProfile.pidProfile.I8[PIDLEVEL], 0, 200 },
|
||||
{ "d_level", VAR_UINT8, ¤tProfile.pidProfile.D8[PIDLEVEL], 0, 200 },
|
||||
{ "p_vel", VAR_UINT8, ¤tProfile.pidProfile.P8[PIDVEL], 0, 200 },
|
||||
{ "i_vel", VAR_UINT8, ¤tProfile.pidProfile.I8[PIDVEL], 0, 200 },
|
||||
{ "d_vel", VAR_UINT8, ¤tProfile.pidProfile.D8[PIDVEL], 0, 200 },
|
||||
};
|
||||
|
||||
#define VALUE_COUNT (sizeof(valueTable) / sizeof(clivalue_t))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue