From fe9561efed68dbd1fb5024e4995ca3d214903aca Mon Sep 17 00:00:00 2001 From: skyfpv Date: Tue, 23 Apr 2024 15:34:01 -0600 Subject: [PATCH] unlocked firmware, added boost mode to modes --- src/main/cli/settings.c | 1 - src/main/fc/rc_modes.h | 1 + src/main/flight/mixer.c | 2 +- src/main/flight/mixer_init.c | 14 +++++++------- src/main/msp/msp_box.c | 2 ++ 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main/cli/settings.c b/src/main/cli/settings.c index ccce1ffd6c..b7749f74ee 100644 --- a/src/main/cli/settings.c +++ b/src/main/cli/settings.c @@ -948,7 +948,6 @@ const clivalue_t valueTable[] = { { "rpm_limiter_afterburner_reset", VAR_INT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_MIXER_CONFIG, offsetof(mixerConfig_t, govenor_rpm_afterburner_reset) }, { "rpm_limiter_acceleration_limit", VAR_UINT16 | MASTER_VALUE, .config.minmaxUnsigned = { 0, 1000 }, PG_MIXER_CONFIG, offsetof(mixerConfig_t, govenor_acceleration_limit) }, //Street League customization - //{ "rpm_limiter_idle_rpm", VAR_UINT16 | MASTER_VALUE, .config.minmaxUnsigned = { 0, 30 }, PG_MIXER_CONFIG, offsetof(mixerConfig_t, govenor_idle_rpm) }, { "rpm_limiter_idle_rpm", VAR_UINT16 | MASTER_VALUE, .config.minmaxUnsigned = { 0, 999 }, PG_MIXER_CONFIG, offsetof(mixerConfig_t, govenor_idle_rpm) }, { "rpm_limiter_full_linearization", VAR_INT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_MIXER_CONFIG, offsetof(mixerConfig_t, govenor_rpm_linearization) }, diff --git a/src/main/fc/rc_modes.h b/src/main/fc/rc_modes.h index 89a1ae4fed..1162cca4db 100644 --- a/src/main/fc/rc_modes.h +++ b/src/main/fc/rc_modes.h @@ -78,6 +78,7 @@ typedef enum { BOXSTICKCOMMANDDISABLE, BOXBEEPERMUTE, BOXREADY, + BOXBOOST, CHECKBOX_ITEM_COUNT } boxId_e; diff --git a/src/main/flight/mixer.c b/src/main/flight/mixer.c index fe892f03dc..f8ef4f4b4d 100644 --- a/src/main/flight/mixer.c +++ b/src/main/flight/mixer.c @@ -370,7 +370,7 @@ static void applyRPMLimiter(void) //if drone is armed if (ARMING_FLAG(ARMED)) { //if the afterburner switch is engaged - if(IS_RC_MODE_ACTIVE(BOXBEEPERON)) { + if(IS_RC_MODE_ACTIVE(BOXBOOST)) { //if the afterburner isn't initiated if(mixerRuntime.afterburnerInitiated == false) { //if there's charge in the tank diff --git a/src/main/flight/mixer_init.c b/src/main/flight/mixer_init.c index 27400ebd28..1fb55131e0 100644 --- a/src/main/flight/mixer_init.c +++ b/src/main/flight/mixer_init.c @@ -52,17 +52,17 @@ PG_RESET_TEMPLATE(mixerConfig_t, mixerConfig, .crashflip_motor_percent = 0, .crashflip_expo = 0, .govenor = true, - .govenor_p = 20, - .govenor_i = 15, - .govenor_d = 10, + .govenor_p = 20.0f, + .govenor_i = 15.0f, + .govenor_d = 10.0f, .govenor_rpm_linearization = true, .govenor_idle_rpm = 17, .govenor_acceleration_limit = 60, .govenor_deceleration_limit = 60, - .govenor_rpm_limit = 130, + .govenor_rpm_limit = 130.0f, .govenor_rpm_afterburner = 16, .govenor_rpm_afterburner_duration = 5, - .govenor_rpm_afterburner_reset = true, + .govenor_rpm_afterburner_reset = false, .govenor_rpm_afterburner_hold_to_use = false, .govenor_rpm_afterburner_tank_count = 3, .mixer_type = MIXER_LEGACY, @@ -343,7 +343,7 @@ mixerRuntime.motorPoleCount = 14; mixerRuntime.govenorEnabled = true; //Unlocked rpm settings -/*mixerRuntime.govenorPGain = mixerConfig()->govenor_p * 0.0000015f; +mixerRuntime.govenorPGain = mixerConfig()->govenor_p * 0.0000015f; mixerRuntime.govenorIGain = mixerConfig()->govenor_i * 0.0001f * pidGetDT(); mixerRuntime.govenorDGain = mixerConfig()->govenor_d * 0.00000003f * pidGetPidFrequency(); mixerRuntime.govenorAccelerationLimit = mixerConfig()->govenor_acceleration_limit * 1000.0f * pidGetDT(); @@ -356,7 +356,7 @@ mixerRuntime.afterburnerHoldToBoost = mixerConfig()->govenor_rpm_afterburner_hol mixerRuntime.rpmLinearization = mixerConfig()->govenor_rpm_linearization; mixerRuntime.RPMLimit = mixerConfig()->govenor_rpm_limit; mixerRuntime.motorPoleCount = motorConfig()->motorPoleCount; -mixerRuntime.govenorEnabled = mixerConfig()->govenor;*/ +mixerRuntime.govenorEnabled = mixerConfig()->govenor; mixerRuntime.govenorI = 0; diff --git a/src/main/msp/msp_box.c b/src/main/msp/msp_box.c index 16a299f4b3..f64eab9ed2 100644 --- a/src/main/msp/msp_box.c +++ b/src/main/msp/msp_box.c @@ -101,6 +101,7 @@ static const box_t boxes[CHECKBOX_ITEM_COUNT] = { { .boxId = BOXSTICKCOMMANDDISABLE, .boxName = "STICK COMMANDS DISABLE", .permanentId = 51}, { .boxId = BOXBEEPERMUTE, .boxName = "BEEPER MUTE", .permanentId = 52}, { .boxId = BOXREADY, .boxName = "READY", .permanentId = 53}, + { .boxId = BOXBOOST, .boxName = "BOOST", .permanentId = 54}, }; // mask of enabled IDs, calculated on startup based on enabled features. boxId_e is used as bit index @@ -187,6 +188,7 @@ void initActiveBoxIds(void) #define BME(boxId) do { bitArraySet(&ena, boxId); } while (0) BME(BOXARM); BME(BOXPREARM); + BME(BOXBOOST); if (!featureIsEnabled(FEATURE_AIRMODE)) { BME(BOXAIRMODE); }