Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI load config dump fix #144

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions lib/Espfc/src/Cli.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ class Cli
if(args[3]) ac.ch = String(args[3]).toInt();
if(args[4]) ac.min = String(args[4]).toInt();
if(args[5]) ac.max = String(args[5]).toInt();
if(args[6]) ac.max = String(args[6]).toInt();
if(args[7]) ac.max = String(args[7]).toInt();
if(args[6]) ac.logicMode = String(args[6]).toInt();
if(args[7]) ac.linkId = String(args[7]).toInt();
}

void write(MixerEntry& ac, const char ** args) const
Expand Down Expand Up @@ -713,9 +713,11 @@ class Cli
Param(PSTR("blackbox_rate"), &c.blackboxPdenom),
Param(PSTR("blackbox_mask"), &c.blackboxFieldsDisabledMask),

Param(PSTR("model_name"), PARAM_STRING, &c.modelName[0], NULL, MODEL_NAME_LEN),

#ifdef ESPFC_SERIAL_SOFT_0_WIFI
Param(PSTR("wifi_ssid"), PARAM_STRING, &c.wireless.ssid[0], NULL, 32),
Param(PSTR("wifi_pass"), PARAM_STRING, &c.wireless.pass[0], NULL, 32),
Param(PSTR("wifi_ssid"), PARAM_STRING, &c.wireless.ssid[0], NULL, WirelessConfig::MAX_LEN),
Param(PSTR("wifi_pass"), PARAM_STRING, &c.wireless.pass[0], NULL, WirelessConfig::MAX_LEN),
Param(PSTR("wifi_tcp_port"), &c.wireless.port),
#endif

Expand Down Expand Up @@ -989,10 +991,12 @@ class Cli
//s.print(F("# "));
//printVersion(s);
//s.println();
s.println(F("defaults"));
for(size_t i = 0; _params[i].name; ++i)
{
print(_params[i], s);
}
s.println(F("save"));
}
else if(strcmp_P(cmd.args[0], PSTR("cal")) == 0)
{
Expand Down Expand Up @@ -1122,7 +1126,8 @@ class Cli
else if(strcmp_P(cmd.args[0], PSTR("save")) == 0)
{
_model.save();
s.println(F("OK"));
s.println(F("# Saved, type reboot to apply changes"));
s.println();
}
else if(strcmp_P(cmd.args[0], PSTR("eeprom")) == 0)
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Espfc/src/Control/Pid.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#define PTERM_SCALE (PTERM_SCALE_BETAFLIGHT * RAD_TO_DEG * 0.001f) // ~ 0.00183 = 0.032029f * 57.29 / 1000
#define ITERM_SCALE (ITERM_SCALE_BETAFLIGHT * RAD_TO_DEG * 0.001f) // ~ 0.014f
#define DTERM_SCALE (DTERM_SCALE_BETAFLIGHT * RAD_TO_DEG * 0.001f) // ~ 0.0000303f
#define FTERM_SCALE (FTERM_SCALE_BETAFLIGHT * RAD_TO_DEG * 0.001f) //
#define FTERM_SCALE (FTERM_SCALE_BETAFLIGHT * RAD_TO_DEG * 0.001f) // ~ 0.00000788f

#define LEVEL_PTERM_SCALE 0.1f // 1/10
#define LEVEL_ITERM_SCALE 0.1f // 1/10
Expand Down
4 changes: 3 additions & 1 deletion lib/Espfc/src/ModelConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ class ModelConfig
pid[FC_PID_ROLL] = { .P = 42, .I = 85, .D = 24, .F = 72 };
pid[FC_PID_PITCH] = { .P = 46, .I = 90, .D = 26, .F = 76 };
pid[FC_PID_YAW] = { .P = 45, .I = 90, .D = 0, .F = 72 };
pid[FC_PID_LEVEL] = { .P = 55, .I = 0, .D = 0, .F = 0 };
pid[FC_PID_LEVEL] = { .P = 45, .I = 0, .D = 0, .F = 0 };

pid[FC_PID_ALT] = { .P = 0, .I = 0, .D = 0, .F = 0 };
pid[FC_PID_POS] = { .P = 0, .I = 0, .D = 0, .F = 0 }; // POSHOLD_P * 100, POSHOLD_I * 100,
Expand Down Expand Up @@ -896,6 +896,8 @@ class ModelConfig
conditions[i].ch = AXIS_AUX_1 + 0;
conditions[i].min = 900;
conditions[i].max = 900;
conditions[i].logicMode = 0;
conditions[i].linkId = 0;
}

// actuator config - pid scaling
Expand Down