From b5e7069a8a1d2a6d6f4edeb97822aca587dc1630 Mon Sep 17 00:00:00 2001 From: Ivan Efimov Date: Tue, 9 Jan 2024 19:42:57 -0600 Subject: [PATCH 01/44] Force define USE_RACE_PRO --- src/main/target/common_pre.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/target/common_pre.h b/src/main/target/common_pre.h index ca2f2fa452..11e7e97fd0 100644 --- a/src/main/target/common_pre.h +++ b/src/main/target/common_pre.h @@ -53,6 +53,10 @@ #define USE_DSHOT #endif +#if !defined(USE_RACE_PRO) +#define USE_RACE_PRO +#endif + #ifdef USE_DSHOT #define USE_DSHOT_BITBANG #define USE_DSHOT_TELEMETRY From d9044b532236c8e5faa4a3aa0908abc5342030d5 Mon Sep 17 00:00:00 2001 From: Ivan Efimov Date: Mon, 26 Dec 2022 22:00:08 -0600 Subject: [PATCH 02/44] Changing default OSD background to BLACK --- src/main/osd/osd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/osd/osd.c b/src/main/osd/osd.c index 7bff7f4c21..4089166383 100644 --- a/src/main/osd/osd.c +++ b/src/main/osd/osd.c @@ -403,7 +403,7 @@ void pgResetFn_osdConfig(osdConfig_t *osdConfig) osdConfig->stat_show_cell_value = false; osdConfig->framerate_hz = OSD_FRAMERATE_DEFAULT_HZ; - osdConfig->cms_background_type = DISPLAY_BACKGROUND_TRANSPARENT; + osdConfig->cms_background_type = DISPLAY_BACKGROUND_BLACK; #ifdef USE_CRAFTNAME_MSGS osdConfig->osd_craftname_msgs = false; // Insert LQ/RSSI-dBm and warnings into CraftName #endif //USE_CRAFTNAME_MSGS From ffa9a0ee48d01a62b47a925dd6b7ead3ba2ca8d8 Mon Sep 17 00:00:00 2001 From: Ivan Efimov Date: Thu, 29 Dec 2022 11:02:30 -0600 Subject: [PATCH 03/44] Funny OSD --- src/main/cli/settings.c | 5 +++++ src/main/config/config.c | 18 ++++++++++++++++++ src/main/config/config.h | 5 +++++ src/main/osd/osd.c | 2 +- src/main/osd/osd_elements.c | 12 ++++++++++-- src/main/osd/osd_elements.h | 1 + src/main/osd/osd_warnings.c | 8 ++++---- src/test/unit/link_quality_unittest.cc | 2 +- src/test/unit/osd_unittest.cc | 2 +- 9 files changed, 46 insertions(+), 9 deletions(-) diff --git a/src/main/cli/settings.c b/src/main/cli/settings.c index 7c81b4cf41..88c8724958 100644 --- a/src/main/cli/settings.c +++ b/src/main/cli/settings.c @@ -1763,6 +1763,11 @@ const clivalue_t valueTable[] = { { "craft_name", VAR_UINT8 | MASTER_VALUE | MODE_STRING, .config.string = { 1, MAX_NAME_LENGTH, STRING_FLAGS_NONE }, PG_PILOT_CONFIG, offsetof(pilotConfig_t, craftName) }, #ifdef USE_OSD { "pilot_name", VAR_UINT8 | MASTER_VALUE | MODE_STRING, .config.string = { 1, MAX_NAME_LENGTH, STRING_FLAGS_NONE }, PG_PILOT_CONFIG, offsetof(pilotConfig_t, pilotName) }, + { "extra_100_throttle", VAR_UINT8 | MASTER_VALUE | MODE_STRING, .config.string = { 1, MAX_NAME_LENGTH, STRING_FLAGS_NONE }, PG_PILOT_CONFIG, offsetof(pilotConfig_t, extra100Throttle) }, + { "extra_fc_hot_warning", VAR_UINT8 | MASTER_VALUE | MODE_STRING, .config.string = { 1, MAX_NAME_LENGTH, STRING_FLAGS_NONE }, PG_PILOT_CONFIG, offsetof(pilotConfig_t, extraFcHotWarning) }, + { "extra_turtle_mode_warning", VAR_UINT8 | MASTER_VALUE | MODE_STRING, .config.string = { 1, MAX_NAME_LENGTH, STRING_FLAGS_NONE }, PG_PILOT_CONFIG, offsetof(pilotConfig_t, extraTurtleModeWarning) }, + { "extra_low_battery_warning", VAR_UINT8 | MASTER_VALUE | MODE_STRING, .config.string = { 1, MAX_NAME_LENGTH, STRING_FLAGS_NONE }, PG_PILOT_CONFIG, offsetof(pilotConfig_t, extraLowBatteryWarning) }, + { "extra_armed_warning", VAR_UINT8 | MASTER_VALUE | MODE_STRING, .config.string = { 1, MAX_NAME_LENGTH, STRING_FLAGS_NONE }, PG_PILOT_CONFIG, offsetof(pilotConfig_t, extraArmedWarning) }, #endif // PG_POSITION diff --git a/src/main/config/config.c b/src/main/config/config.c index c65faed48d..5dbccad29e 100644 --- a/src/main/config/config.c +++ b/src/main/config/config.c @@ -22,6 +22,7 @@ #include #include #include +#include #include "platform.h" @@ -94,6 +95,8 @@ #include "drivers/dshot.h" +#include "osd/osd_elements.h" + static bool configIsDirty; /* someone indicated that the config is modified and it is not yet saved */ static bool rebootRequired = false; // set if a config change requires a reboot to take effect @@ -111,6 +114,11 @@ PG_REGISTER_WITH_RESET_TEMPLATE(pilotConfig_t, pilotConfig, PG_PILOT_CONFIG, 2); PG_RESET_TEMPLATE(pilotConfig_t, pilotConfig, .craftName = { 0 }, .pilotName = { 0 }, + .extra100Throttle = "KAACK", + .extraFcHotWarning = "B*TCH IS HOT", + .extraTurtleModeWarning = "SORRY BRYAN", + .extraLowBatteryWarning = "AINT LEAVING", + .extraArmedWarning = "LETS GO", ); PG_REGISTER_WITH_RESET_TEMPLATE(systemConfig_t, systemConfig, PG_SYSTEM_CONFIG, 3); @@ -210,6 +218,15 @@ static void validateAndFixRatesSettings(void) } } +void makeStringsUpperCase(void) +{ + toUpperCase(pilotConfigMutable()->extra100Throttle, pilotConfig()->extra100Throttle, MAX_NAME_LENGTH); + toUpperCase(pilotConfigMutable()->extraFcHotWarning, pilotConfig()->extraFcHotWarning, MAX_NAME_LENGTH); + toUpperCase(pilotConfigMutable()->extraTurtleModeWarning, pilotConfig()->extraTurtleModeWarning, MAX_NAME_LENGTH); + toUpperCase(pilotConfigMutable()->extraLowBatteryWarning, pilotConfig()->extraLowBatteryWarning, MAX_NAME_LENGTH); + toUpperCase(pilotConfigMutable()->extraArmedWarning, pilotConfig()->extraArmedWarning, MAX_NAME_LENGTH); +} + static void validateAndFixConfig(void) { #if !defined(USE_QUAD_MIXER_ONLY) @@ -602,6 +619,7 @@ if (systemConfig()->configurationState == CONFIGURATION_STATE_UNCONFIGURED) { #endif validateAndfixMotorOutputReordering(motorConfigMutable()->dev.motorOutputReordering, MAX_SUPPORTED_MOTORS); + makeStringsUpperCase(); // validate that the minimum battery cell voltage is less than the maximum cell voltage // reset to defaults if not diff --git a/src/main/config/config.h b/src/main/config/config.h index 1ccd3c2faf..61c3fd170e 100644 --- a/src/main/config/config.h +++ b/src/main/config/config.h @@ -35,6 +35,11 @@ typedef enum { typedef struct pilotConfig_s { char craftName[MAX_NAME_LENGTH + 1]; char pilotName[MAX_NAME_LENGTH + 1]; + char extra100Throttle[MAX_NAME_LENGTH + 1]; + char extraFcHotWarning[MAX_NAME_LENGTH + 1]; + char extraTurtleModeWarning[MAX_NAME_LENGTH + 1]; + char extraLowBatteryWarning[MAX_NAME_LENGTH + 1]; + char extraArmedWarning[MAX_NAME_LENGTH + 1]; } pilotConfig_t; PG_DECLARE(pilotConfig_t, pilotConfig); diff --git a/src/main/osd/osd.c b/src/main/osd/osd.c index 4089166383..0609529a28 100644 --- a/src/main/osd/osd.c +++ b/src/main/osd/osd.c @@ -1198,7 +1198,7 @@ static timeDelta_t osdShowArmed(void) } else { ret = (REFRESH_1S / 2); } - displayWrite(osdDisplayPort, midCol - (strlen("ARMED") / 2), midRow, DISPLAYPORT_SEVERITY_NORMAL, "ARMED"); + displayWrite(osdDisplayPort, midCol - (strlen(pilotConfig()->extraArmedWarning) / 2), midRow, DISPLAYPORT_SEVERITY_NORMAL, pilotConfig()->extraArmedWarning); if (isFlipOverAfterCrashActive()) { displayWrite(osdDisplayPort, midCol - (strlen(CRASH_FLIP_WARNING) / 2), midRow + 1, DISPLAYPORT_SEVERITY_NORMAL, CRASH_FLIP_WARNING); diff --git a/src/main/osd/osd_elements.c b/src/main/osd/osd_elements.c index 23ebe72afb..073b801101 100644 --- a/src/main/osd/osd_elements.c +++ b/src/main/osd/osd_elements.c @@ -853,7 +853,7 @@ static void osdBackgroundCameraFrame(osdElementParms_t *element) } } -static void toUpperCase(char* dest, const char* src, unsigned int maxSrcLength) +void toUpperCase(char* dest, const char* src, unsigned int maxSrcLength) { unsigned int i; for (i = 0; i < maxSrcLength && src[i]; i++) { @@ -1642,7 +1642,15 @@ static void osdElementStickOverlay(osdElementParms_t *element) static void osdElementThrottlePosition(osdElementParms_t *element) { - tfp_sprintf(element->buff, "%c%3d", SYM_THR, calculateThrottlePercent()); + const uint8_t throttleValue = calculateThrottlePercent(); + if (strlen(pilotConfig()->extra100Throttle) == 0 || throttleValue < 100) + { + tfp_sprintf(element->buff, "%c%3d", SYM_THR, calculateThrottlePercent()); + } + else + { + tfp_sprintf(element->buff, pilotConfig()->extra100Throttle); + } } static void osdElementTimer(osdElementParms_t *element) diff --git a/src/main/osd/osd_elements.h b/src/main/osd/osd_elements.h index 9f08c5ee33..eae51ce409 100644 --- a/src/main/osd/osd_elements.h +++ b/src/main/osd/osd_elements.h @@ -72,3 +72,4 @@ bool osdElementsNeedAccelerometer(void); #ifdef USE_SPEC_PREARM_SCREEN bool osdDrawSpec(displayPort_t *osdDisplayPort); #endif // USE_SPEC_PREARM_SCREEN +void toUpperCase(char* dest, const char* src, unsigned int maxSrcLength); diff --git a/src/main/osd/osd_warnings.c b/src/main/osd/osd_warnings.c index 4b5e57ccb2..378b581b32 100644 --- a/src/main/osd/osd_warnings.c +++ b/src/main/osd/osd_warnings.c @@ -137,7 +137,7 @@ void renderOsdWarning(char *warningText, bool *blinking, uint8_t *displayAttr) // Warn when in flip over after crash mode if (osdWarnGetState(OSD_WARNING_CRASH_FLIP) && IS_RC_MODE_ACTIVE(BOXFLIPOVERAFTERCRASH)) { if (isFlipOverAfterCrashActive()) { // if was armed in crash flip mode - tfp_sprintf(warningText, CRASH_FLIP_WARNING); + tfp_sprintf(warningText, pilotConfig()->extraTurtleModeWarning); *displayAttr = DISPLAYPORT_SEVERITY_INFO; return; } else if (!ARMING_FLAG(ARMED)) { // if disarmed, but crash flip mode is activated @@ -207,7 +207,7 @@ void renderOsdWarning(char *warningText, bool *blinking, uint8_t *displayAttr) #endif // USE_RX_LINK_QUALITY_INFO if (osdWarnGetState(OSD_WARNING_BATTERY_CRITICAL) && batteryState == BATTERY_CRITICAL) { - tfp_sprintf(warningText, " LAND NOW"); + tfp_sprintf(warningText, ">>> LAND NOW <<<"); *displayAttr = DISPLAYPORT_SEVERITY_CRITICAL; *blinking = true; return; @@ -259,7 +259,7 @@ void renderOsdWarning(char *warningText, bool *blinking, uint8_t *displayAttr) #ifdef USE_ADC_INTERNAL const int16_t coreTemperature = getCoreTemperatureCelsius(); if (osdWarnGetState(OSD_WARNING_CORE_TEMPERATURE) && coreTemperature >= osdConfig()->core_temp_alarm) { - tfp_sprintf(warningText, "CORE %c: %3d%c", SYM_TEMPERATURE, osdConvertTemperatureToSelectedUnit(coreTemperature), osdGetTemperatureSymbolForSelectedUnit()); + tfp_sprintf(warningText, "%s %c: %3d%c", pilotConfig()->extraFcHotWarning, SYM_TEMPERATURE, osdConvertTemperatureToSelectedUnit(coreTemperature), osdGetTemperatureSymbolForSelectedUnit()); *displayAttr = DISPLAYPORT_SEVERITY_WARNING; *blinking = true; return; @@ -378,7 +378,7 @@ void renderOsdWarning(char *warningText, bool *blinking, uint8_t *displayAttr) #endif if (osdWarnGetState(OSD_WARNING_BATTERY_WARNING) && batteryState == BATTERY_WARNING) { - tfp_sprintf(warningText, "LOW BATTERY"); + tfp_sprintf(warningText, pilotConfig()->extraLowBatteryWarning); *displayAttr = DISPLAYPORT_SEVERITY_WARNING; *blinking = true; return; diff --git a/src/test/unit/link_quality_unittest.cc b/src/test/unit/link_quality_unittest.cc index fae1992215..3886d2f086 100644 --- a/src/test/unit/link_quality_unittest.cc +++ b/src/test/unit/link_quality_unittest.cc @@ -137,7 +137,7 @@ void doTestArm(bool testEmpty = true) // then // arming alert displayed - displayPortTestBufferSubstring(13, 8, "ARMED"); + displayPortTestBufferSubstring(13, 8, "%s", pilotConfig()->extraArmedWarning); // given // armed alert times out (0.5 seconds) diff --git a/src/test/unit/osd_unittest.cc b/src/test/unit/osd_unittest.cc index f89bdd35d0..ff8884f4f7 100644 --- a/src/test/unit/osd_unittest.cc +++ b/src/test/unit/osd_unittest.cc @@ -168,7 +168,7 @@ void doTestArm(bool testEmpty = true) // then // arming alert displayed - displayPortTestBufferSubstring(13, 8, "ARMED"); + displayPortTestBufferSubstring(13, 8, "%s", pilotConfig()->extraArmedWarning); // given // armed alert times out (0.5 seconds) From fd3b05d8ea7ce0a510b4166b708838d870e64073 Mon Sep 17 00:00:00 2001 From: Ivan Efimov Date: Sat, 18 Feb 2023 00:12:01 -0600 Subject: [PATCH 04/44] Extra: added extra_ledstrip_blinkmask --- src/main/cli/settings.c | 1 + src/main/io/ledstrip.c | 3 ++- src/main/io/ledstrip.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/cli/settings.c b/src/main/cli/settings.c index 88c8724958..e6f3a358e2 100644 --- a/src/main/cli/settings.c +++ b/src/main/cli/settings.c @@ -1329,6 +1329,7 @@ const clivalue_t valueTable[] = { { "ledstrip_brightness", VAR_UINT8 | MASTER_VALUE, .config.minmaxUnsigned = { 5, 100 }, PG_LED_STRIP_CONFIG, offsetof(ledStripConfig_t, ledstrip_brightness) }, { "ledstrip_rainbow_delta", VAR_UINT16 | MASTER_VALUE, .config.minmaxUnsigned = { 0, HSV_HUE_MAX }, PG_LED_STRIP_CONFIG, offsetof(ledStripConfig_t, ledstrip_rainbow_delta) }, { "ledstrip_rainbow_freq", VAR_UINT16 | MASTER_VALUE, .config.minmaxUnsigned = { 1, 2000 }, PG_LED_STRIP_CONFIG, offsetof(ledStripConfig_t, ledstrip_rainbow_freq) }, + { "extra_ledstrip_blinkmask", VAR_UINT16 | MASTER_VALUE, .config.minmaxUnsigned = { 1, UINT16_MAX }, PG_LED_STRIP_CONFIG, offsetof(ledStripConfig_t, extra_ledstrip_blinkmask) }, #endif // PG_SDCARD_CONFIG diff --git a/src/main/io/ledstrip.c b/src/main/io/ledstrip.c index bd90a3ae8c..6c53273b02 100644 --- a/src/main/io/ledstrip.c +++ b/src/main/io/ledstrip.c @@ -149,6 +149,7 @@ void pgResetFn_ledStripConfig(ledStripConfig_t *ledStripConfig) ledStripConfig->ledstrip_brightness = 100; ledStripConfig->ledstrip_rainbow_delta = 0; ledStripConfig->ledstrip_rainbow_freq = 120; + ledStripConfig->extra_ledstrip_blinkmask = 0x8005; // 0b1000000000000101; #ifndef UNIT_TEST #ifdef LED_STRIP_PIN ledStripConfig->ioTag = IO_TAG(LED_STRIP_PIN); @@ -1014,7 +1015,7 @@ static void applyLarsonScannerLayer(bool updateNow, timeUs_t *timer) // blink twice, then wait ; either always or just when landing static void applyLedBlinkLayer(bool updateNow, timeUs_t *timer) { - const uint16_t blinkPattern = 0x8005; // 0b1000000000000101; + const uint16_t blinkPattern = ledStripConfig()->extra_ledstrip_blinkmask; static uint16_t blinkMask; if (updateNow) { diff --git a/src/main/io/ledstrip.h b/src/main/io/ledstrip.h index 308475132f..27c0d06465 100644 --- a/src/main/io/ledstrip.h +++ b/src/main/io/ledstrip.h @@ -182,6 +182,7 @@ typedef struct ledStripConfig_s { uint8_t ledstrip_brightness; uint16_t ledstrip_rainbow_delta; uint16_t ledstrip_rainbow_freq; + uint16_t extra_ledstrip_blinkmask; } ledStripConfig_t; PG_DECLARE(ledStripConfig_t, ledStripConfig); From 1399fb2a9e99066377b25a0c131dcb389ee6d1f5 Mon Sep 17 00:00:00 2001 From: Ivan Efimov Date: Sun, 4 Jun 2023 17:21:43 -0500 Subject: [PATCH 05/44] Extra land now text --- src/main/cli/settings.c | 1 + src/main/config/config.c | 1 + src/main/config/config.h | 1 + src/main/osd/osd_warnings.c | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/cli/settings.c b/src/main/cli/settings.c index e6f3a358e2..3dd06553df 100644 --- a/src/main/cli/settings.c +++ b/src/main/cli/settings.c @@ -1769,6 +1769,7 @@ const clivalue_t valueTable[] = { { "extra_turtle_mode_warning", VAR_UINT8 | MASTER_VALUE | MODE_STRING, .config.string = { 1, MAX_NAME_LENGTH, STRING_FLAGS_NONE }, PG_PILOT_CONFIG, offsetof(pilotConfig_t, extraTurtleModeWarning) }, { "extra_low_battery_warning", VAR_UINT8 | MASTER_VALUE | MODE_STRING, .config.string = { 1, MAX_NAME_LENGTH, STRING_FLAGS_NONE }, PG_PILOT_CONFIG, offsetof(pilotConfig_t, extraLowBatteryWarning) }, { "extra_armed_warning", VAR_UINT8 | MASTER_VALUE | MODE_STRING, .config.string = { 1, MAX_NAME_LENGTH, STRING_FLAGS_NONE }, PG_PILOT_CONFIG, offsetof(pilotConfig_t, extraArmedWarning) }, + { "extra_land_now_warning", VAR_UINT8 | MASTER_VALUE | MODE_STRING, .config.string = { 1, MAX_NAME_LENGTH, STRING_FLAGS_NONE }, PG_PILOT_CONFIG, offsetof(pilotConfig_t, extraLandNowWarning) }, #endif // PG_POSITION diff --git a/src/main/config/config.c b/src/main/config/config.c index 5dbccad29e..e1edf0b594 100644 --- a/src/main/config/config.c +++ b/src/main/config/config.c @@ -119,6 +119,7 @@ PG_RESET_TEMPLATE(pilotConfig_t, pilotConfig, .extraTurtleModeWarning = "SORRY BRYAN", .extraLowBatteryWarning = "AINT LEAVING", .extraArmedWarning = "LETS GO", + .extraLandNowWarning = ">> LAND NOW <<", ); PG_REGISTER_WITH_RESET_TEMPLATE(systemConfig_t, systemConfig, PG_SYSTEM_CONFIG, 3); diff --git a/src/main/config/config.h b/src/main/config/config.h index 61c3fd170e..0d550e2f3f 100644 --- a/src/main/config/config.h +++ b/src/main/config/config.h @@ -40,6 +40,7 @@ typedef struct pilotConfig_s { char extraTurtleModeWarning[MAX_NAME_LENGTH + 1]; char extraLowBatteryWarning[MAX_NAME_LENGTH + 1]; char extraArmedWarning[MAX_NAME_LENGTH + 1]; + char extraLandNowWarning[MAX_NAME_LENGTH + 1]; } pilotConfig_t; PG_DECLARE(pilotConfig_t, pilotConfig); diff --git a/src/main/osd/osd_warnings.c b/src/main/osd/osd_warnings.c index 378b581b32..83c5f4205d 100644 --- a/src/main/osd/osd_warnings.c +++ b/src/main/osd/osd_warnings.c @@ -207,7 +207,7 @@ void renderOsdWarning(char *warningText, bool *blinking, uint8_t *displayAttr) #endif // USE_RX_LINK_QUALITY_INFO if (osdWarnGetState(OSD_WARNING_BATTERY_CRITICAL) && batteryState == BATTERY_CRITICAL) { - tfp_sprintf(warningText, ">>> LAND NOW <<<"); + tfp_sprintf(warningText, pilotConfig()->extraLandNowWarning); *displayAttr = DISPLAYPORT_SEVERITY_CRITICAL; *blinking = true; return; From d9e96e711b46ba2818a102420ee32e5db43bd1a7 Mon Sep 17 00:00:00 2001 From: Ivan Efimov Date: Tue, 9 Jan 2024 19:49:53 -0600 Subject: [PATCH 06/44] Version change to V2 --- src/main/build/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/build/version.h b/src/main/build/version.h index c2313453c8..3dbd84fc78 100644 --- a/src/main/build/version.h +++ b/src/main/build/version.h @@ -28,7 +28,7 @@ #define FC_VERSION_MINOR 5 // increment when a minor release is made (small new feature, change etc) #define FC_VERSION_PATCH_LEVEL 3 // increment when a bug is fixed -#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) +#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".RPM_KAACK_V2" extern const char* const targetName; From da9e2bcaa0994161a9e3b8102f564adc4f407b3d Mon Sep 17 00:00:00 2001 From: Ivan Efimov Date: Wed, 20 Mar 2024 02:03:57 -0500 Subject: [PATCH 07/44] extra_ledstrip_color --- src/main/cli/settings.c | 1 + src/main/cms/cms_menu_quick.c | 40 +++++++++++++++++++++++++++++++++-- src/main/io/ledstrip.c | 4 ++++ src/main/io/ledstrip.h | 1 + 4 files changed, 44 insertions(+), 2 deletions(-) diff --git a/src/main/cli/settings.c b/src/main/cli/settings.c index 3dd06553df..907da31bb8 100644 --- a/src/main/cli/settings.c +++ b/src/main/cli/settings.c @@ -1330,6 +1330,7 @@ const clivalue_t valueTable[] = { { "ledstrip_rainbow_delta", VAR_UINT16 | MASTER_VALUE, .config.minmaxUnsigned = { 0, HSV_HUE_MAX }, PG_LED_STRIP_CONFIG, offsetof(ledStripConfig_t, ledstrip_rainbow_delta) }, { "ledstrip_rainbow_freq", VAR_UINT16 | MASTER_VALUE, .config.minmaxUnsigned = { 1, 2000 }, PG_LED_STRIP_CONFIG, offsetof(ledStripConfig_t, ledstrip_rainbow_freq) }, { "extra_ledstrip_blinkmask", VAR_UINT16 | MASTER_VALUE, .config.minmaxUnsigned = { 1, UINT16_MAX }, PG_LED_STRIP_CONFIG, offsetof(ledStripConfig_t, extra_ledstrip_blinkmask) }, + { "extra_ledstrip_color", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_LEDSTRIP_COLOR }, PG_LED_STRIP_CONFIG, offsetof(ledStripConfig_t, extra_ledstrip_color) }, #endif // PG_SDCARD_CONFIG diff --git a/src/main/cms/cms_menu_quick.c b/src/main/cms/cms_menu_quick.c index b8cda64562..d193371220 100644 --- a/src/main/cms/cms_menu_quick.c +++ b/src/main/cms/cms_menu_quick.c @@ -32,6 +32,8 @@ #include "cms/cms_menu_main.h" #include "cms/cms_menu_vtx_common.h" #include "cms/cms_menu_rpm_limit.h" + +#include "io/ledstrip.h" #include "common/printf.h" #include "config/config.h" @@ -54,6 +56,7 @@ static uint8_t rateProfileIndex; static batteryConfig_t batteryProfile; static uint8_t cmsx_motorOutputLimit; static uint8_t pidProfileIndex; +static uint8_t cmsx_extraLedstripColor; static pidProfile_t *pidProfile; static const void *quickMenuOnEnter(displayPort_t *pDisp) @@ -67,6 +70,7 @@ static const void *quickMenuOnEnter(displayPort_t *pDisp) memcpy(&batteryProfile, batteryConfigMutable(), sizeof(batteryConfig_t)); cmsx_motorOutputLimit = pidProfile->motor_output_limit; + cmsx_extraLedstripColor = ledStripConfig()->extra_ledstrip_color; return NULL; } @@ -82,11 +86,42 @@ static const void *cmsx_RateProfileWriteback(displayPort_t *pDisp, const OSD_Ent pidProfile_t *pidProfile = pidProfilesMutable(pidProfileIndex); pidProfile->motor_output_limit = cmsx_motorOutputLimit; + ledStripConfigMutable()->extra_ledstrip_color = cmsx_extraLedstripColor; + pidInitConfig(currentPidProfile); return NULL; } +static const void *writeLedColor(displayPort_t *pDisp, const OSD_Entry *self) { + UNUSED(pDisp); + UNUSED(self); + ledStripConfigMutable()->extra_ledstrip_color = cmsx_extraLedstripColor; + return NULL; +} + + +static const char * const osdTableThrottleLimitType[] = { + "OFF", "SCALE", "CLIP" +}; + +static const char * const lookupTableLedstripColors[COLOR_COUNT] = { + "BLACK", + "WHITE", + "RED", + "ORANGE", + "YELLOW", + "LIME_GREEN", + "GREEN", + "MINT_GREEN", + "CYAN", + "LIGHT_BLUE", + "BLUE", + "DARK_VIOLET", + "MAGENTA", + "DEEP_PINK" +}; + static const OSD_Entry menuMainEntries[] = { { "-- QUICK --", OME_Label, NULL, NULL }, @@ -103,7 +138,8 @@ static const OSD_Entry menuMainEntries[] = {"VTX", OME_Funcall, cmsSelectVtx, NULL}, #endif #endif // VTX_CONTROL - { "MAIN", OME_Submenu, NULL, &cmsx_menuMain }, + { "FORCE LED", OME_TAB, NULL, &(OSD_TAB_t) { &cmsx_extraLedstripColor, COLOR_COUNT - 1, lookupTableLedstripColors} }, + { "MAIN", OME_Submenu, NULL, &cmsx_menuMain}, { "EXIT", OME_OSD_Exit, cmsMenuExit, (void *)CMS_EXIT}, { "SAVE&REBOOT", OME_OSD_Exit, cmsMenuExit, (void *)CMS_POPUP_SAVEREBOOT}, {NULL, OME_END, NULL, NULL}, @@ -116,7 +152,7 @@ CMS_Menu cmsx_menuQuick = { #endif .onEnter = quickMenuOnEnter, .onExit = cmsx_RateProfileWriteback, - .onDisplayUpdate = NULL, + .onDisplayUpdate = writeLedColor, .entries = menuMainEntries, }; diff --git a/src/main/io/ledstrip.c b/src/main/io/ledstrip.c index 6c53273b02..07668f311c 100644 --- a/src/main/io/ledstrip.c +++ b/src/main/io/ledstrip.c @@ -150,6 +150,7 @@ void pgResetFn_ledStripConfig(ledStripConfig_t *ledStripConfig) ledStripConfig->ledstrip_rainbow_delta = 0; ledStripConfig->ledstrip_rainbow_freq = 120; ledStripConfig->extra_ledstrip_blinkmask = 0x8005; // 0b1000000000000101; + ledStripConfig->extra_ledstrip_color = COLOR_BLACK; #ifndef UNIT_TEST #ifdef LED_STRIP_PIN ledStripConfig->ioTag = IO_TAG(LED_STRIP_PIN); @@ -507,6 +508,9 @@ static void applyLedFixedLayers(void) switch (fn) { case LED_FUNCTION_COLOR: color = ledStripStatusModeConfig()->colors[ledGetColor(ledConfig)]; + if (COLOR_BLACK != ledStripConfig()->extra_ledstrip_color) { + color = hsv[ledStripConfig()->extra_ledstrip_color]; + } hsvColor_t nextColor = ledStripStatusModeConfig()->colors[(ledGetColor(ledConfig) + 1 + LED_CONFIGURABLE_COLOR_COUNT) % LED_CONFIGURABLE_COLOR_COUNT]; hsvColor_t previousColor = ledStripStatusModeConfig()->colors[(ledGetColor(ledConfig) - 1 + LED_CONFIGURABLE_COLOR_COUNT) % LED_CONFIGURABLE_COLOR_COUNT]; diff --git a/src/main/io/ledstrip.h b/src/main/io/ledstrip.h index 27c0d06465..bb7c63b28a 100644 --- a/src/main/io/ledstrip.h +++ b/src/main/io/ledstrip.h @@ -183,6 +183,7 @@ typedef struct ledStripConfig_s { uint16_t ledstrip_rainbow_delta; uint16_t ledstrip_rainbow_freq; uint16_t extra_ledstrip_blinkmask; + uint8_t extra_ledstrip_color; } ledStripConfig_t; PG_DECLARE(ledStripConfig_t, ledStripConfig); From 329c02ef84d0397a5f2e68f61adb9c0b69c11392 Mon Sep 17 00:00:00 2001 From: Ivan Efimov Date: Wed, 20 Mar 2024 02:33:46 -0500 Subject: [PATCH 08/44] extra_ledstrip_color --- src/main/fc/rc_modes.h | 1 + src/main/io/ledstrip.c | 8 +++++++- src/main/msp/msp_box.c | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/fc/rc_modes.h b/src/main/fc/rc_modes.h index 0b8e2d36b5..5d141631b4 100644 --- a/src/main/fc/rc_modes.h +++ b/src/main/fc/rc_modes.h @@ -79,6 +79,7 @@ typedef enum { BOXBEEPERMUTE, BOXREADY, BOXLAPTIMERRESET, + BOXLEDNOBLINK, CHECKBOX_ITEM_COUNT } boxId_e; diff --git a/src/main/io/ledstrip.c b/src/main/io/ledstrip.c index 07668f311c..7d82ce793e 100644 --- a/src/main/io/ledstrip.c +++ b/src/main/io/ledstrip.c @@ -1019,9 +1019,15 @@ static void applyLarsonScannerLayer(bool updateNow, timeUs_t *timer) // blink twice, then wait ; either always or just when landing static void applyLedBlinkLayer(bool updateNow, timeUs_t *timer) { - const uint16_t blinkPattern = ledStripConfig()->extra_ledstrip_blinkmask; + uint16_t blinkPattern = ledStripConfig()->extra_ledstrip_blinkmask; + if (IS_RC_MODE_ACTIVE(BOXLEDNOBLINK)) { + + blinkPattern = 0xFFFF; + } + static uint16_t blinkMask; + if (updateNow) { blinkMask = blinkMask >> 1; if (blinkMask <= 1) diff --git a/src/main/msp/msp_box.c b/src/main/msp/msp_box.c index 0fe27fd3bc..69def00ece 100644 --- a/src/main/msp/msp_box.c +++ b/src/main/msp/msp_box.c @@ -102,6 +102,7 @@ static const box_t boxes[CHECKBOX_ITEM_COUNT] = { { .boxId = BOXBEEPERMUTE, .boxName = "BEEPER MUTE", .permanentId = 52}, { .boxId = BOXREADY, .boxName = "READY", .permanentId = 53}, { .boxId = BOXLAPTIMERRESET, .boxName = "LAP TIMER RESET", .permanentId = 54}, + { .boxId = BOXLEDNOBLINK, .boxName = "LED NO BLINK", .permanentId = 101}, }; // mask of enabled IDs, calculated on startup based on enabled features. boxId_e is used as bit index @@ -338,6 +339,7 @@ void initActiveBoxIds(void) BME(BOXSTICKCOMMANDDISABLE); BME(BOXREADY); + BME(BOXLEDNOBLINK); #if defined(USE_GPS_LAP_TIMER) BME(BOXLAPTIMERRESET); From 237e916ac1ff34288a77ae4fb000215fb760e588 Mon Sep 17 00:00:00 2001 From: Ivan Efimov Date: Wed, 20 Mar 2024 02:51:29 -0500 Subject: [PATCH 09/44] Removed stick commands for pid/rate profiles and VTX channel switching --- src/main/fc/rc_controls.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/fc/rc_controls.c b/src/main/fc/rc_controls.c index 4383c1cb1e..ffacda914f 100644 --- a/src/main/fc/rc_controls.c +++ b/src/main/fc/rc_controls.c @@ -270,20 +270,20 @@ void processRcStickPositions(void) switch (rcSticks) { case THR_LO + YAW_LO + PIT_CE + ROL_LO: // ROLL left -> PID profile 1 - changePidProfile(0); + //changePidProfile(0); return; case THR_LO + YAW_LO + PIT_HI + ROL_CE: // PITCH up -> PID profile 2 - changePidProfile(1); + //changePidProfile(1); return; case THR_LO + YAW_LO + PIT_CE + ROL_HI: // ROLL right -> PID profile 3 - changePidProfile(2); + //changePidProfile(2); return; } if (rcSticks == THR_LO + YAW_LO + PIT_LO + ROL_HI) { - saveConfigAndNotify(); + //saveConfigAndNotify(); } #ifdef USE_ACC @@ -350,16 +350,16 @@ void processRcStickPositions(void) // in ACRO mode, so use sticks to change RATE profile switch (rcSticks) { case THR_HI + YAW_CE + PIT_HI + ROL_CE: - changeControlRateProfile(0); + //changeControlRateProfile(0); return; case THR_HI + YAW_CE + PIT_LO + ROL_CE: - changeControlRateProfile(1); + //changeControlRateProfile(1); return; case THR_HI + YAW_CE + PIT_CE + ROL_HI: - changeControlRateProfile(2); + //changeControlRateProfile(2); return; case THR_HI + YAW_CE + PIT_CE + ROL_LO: - changeControlRateProfile(3); + //changeControlRateProfile(3); return; } } @@ -376,16 +376,16 @@ void processRcStickPositions(void) #ifdef USE_VTX_CONTROL if (rcSticks == THR_HI + YAW_LO + PIT_CE + ROL_HI) { - vtxIncrementBand(); + //vtxIncrementBand(); } if (rcSticks == THR_HI + YAW_LO + PIT_CE + ROL_LO) { - vtxDecrementBand(); + //vtxDecrementBand(); } if (rcSticks == THR_HI + YAW_HI + PIT_CE + ROL_HI) { - vtxIncrementChannel(); + //vtxIncrementChannel(); } if (rcSticks == THR_HI + YAW_HI + PIT_CE + ROL_LO) { - vtxDecrementChannel(); + //vtxDecrementChannel(); } #endif From 0c9dfe72321f0455b4c0c13d7b2c6dce2b22d355 Mon Sep 17 00:00:00 2001 From: Ivan Efimov Date: Fri, 22 Mar 2024 00:15:31 -0500 Subject: [PATCH 10/44] LED2 color and dimming --- src/main/cli/settings.c | 2 ++ src/main/cms/cms_menu_quick.c | 20 ++++++++++++++------ src/main/io/ledstrip.c | 25 ++++++++++++++++++++----- src/main/io/ledstrip.h | 2 ++ 4 files changed, 38 insertions(+), 11 deletions(-) diff --git a/src/main/cli/settings.c b/src/main/cli/settings.c index 907da31bb8..23954c411a 100644 --- a/src/main/cli/settings.c +++ b/src/main/cli/settings.c @@ -1331,6 +1331,8 @@ const clivalue_t valueTable[] = { { "ledstrip_rainbow_freq", VAR_UINT16 | MASTER_VALUE, .config.minmaxUnsigned = { 1, 2000 }, PG_LED_STRIP_CONFIG, offsetof(ledStripConfig_t, ledstrip_rainbow_freq) }, { "extra_ledstrip_blinkmask", VAR_UINT16 | MASTER_VALUE, .config.minmaxUnsigned = { 1, UINT16_MAX }, PG_LED_STRIP_CONFIG, offsetof(ledStripConfig_t, extra_ledstrip_blinkmask) }, { "extra_ledstrip_color", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_LEDSTRIP_COLOR }, PG_LED_STRIP_CONFIG, offsetof(ledStripConfig_t, extra_ledstrip_color) }, + { "extra_ledstrip_color2", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_LEDSTRIP_COLOR }, PG_LED_STRIP_CONFIG, offsetof(ledStripConfig_t, extra_ledstrip_color2) }, + { "extra_ledstrip_color2_brightness", VAR_UINT8 | MASTER_VALUE, .config.minmaxUnsigned = { 0, 255 }, PG_LED_STRIP_CONFIG, offsetof(ledStripConfig_t, extra_ledstrip_color2_brightness) }, #endif // PG_SDCARD_CONFIG diff --git a/src/main/cms/cms_menu_quick.c b/src/main/cms/cms_menu_quick.c index d193371220..6d7abd9665 100644 --- a/src/main/cms/cms_menu_quick.c +++ b/src/main/cms/cms_menu_quick.c @@ -57,6 +57,8 @@ static batteryConfig_t batteryProfile; static uint8_t cmsx_motorOutputLimit; static uint8_t pidProfileIndex; static uint8_t cmsx_extraLedstripColor; +static uint8_t cmsx_extraLedstripColor2; +static uint8_t cmsx_extraLedstripColor2_brightness; static pidProfile_t *pidProfile; static const void *quickMenuOnEnter(displayPort_t *pDisp) @@ -71,6 +73,8 @@ static const void *quickMenuOnEnter(displayPort_t *pDisp) cmsx_motorOutputLimit = pidProfile->motor_output_limit; cmsx_extraLedstripColor = ledStripConfig()->extra_ledstrip_color; + cmsx_extraLedstripColor2 = ledStripConfig()->extra_ledstrip_color2; + cmsx_extraLedstripColor2_brightness = ledStripConfig()->extra_ledstrip_color2_brightness; return NULL; } @@ -87,6 +91,8 @@ static const void *cmsx_RateProfileWriteback(displayPort_t *pDisp, const OSD_Ent pidProfile->motor_output_limit = cmsx_motorOutputLimit; ledStripConfigMutable()->extra_ledstrip_color = cmsx_extraLedstripColor; + ledStripConfigMutable()->extra_ledstrip_color2 = cmsx_extraLedstripColor2; + ledStripConfigMutable()->extra_ledstrip_color2_brightness = cmsx_extraLedstripColor2_brightness; pidInitConfig(currentPidProfile); @@ -97,6 +103,8 @@ static const void *writeLedColor(displayPort_t *pDisp, const OSD_Entry *self) { UNUSED(pDisp); UNUSED(self); ledStripConfigMutable()->extra_ledstrip_color = cmsx_extraLedstripColor; + ledStripConfigMutable()->extra_ledstrip_color2 = cmsx_extraLedstripColor2; + ledStripConfigMutable()->extra_ledstrip_color2_brightness = cmsx_extraLedstripColor2_brightness; return NULL; } @@ -106,7 +114,7 @@ static const char * const osdTableThrottleLimitType[] = { }; static const char * const lookupTableLedstripColors[COLOR_COUNT] = { - "BLACK", + "DEFAULT", "WHITE", "RED", "ORANGE", @@ -129,16 +137,16 @@ static const OSD_Entry menuMainEntries[] = #if defined(USE_RPM_LIMIT) { "RPM LIM", OME_Submenu, cmsMenuChange, &cmsx_menuRpmLimit }, #endif - { "THR LIM TYPE", OME_TAB, NULL, &(OSD_TAB_t) { &rateProfile.throttle_limit_type, THROTTLE_LIMIT_TYPE_COUNT - 1, lookupTableThrottleLimitType } }, - { "THR LIM %", OME_UINT8, NULL, &(OSD_UINT8_t) { &rateProfile.throttle_limit_percent, 25, 100, 1 } }, - { "MTR OUT LIM %", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_motorOutputLimit, MOTOR_OUTPUT_LIMIT_PERCENT_MIN, MOTOR_OUTPUT_LIMIT_PERCENT_MAX, 1 } }, - { "FORCE CELLS", OME_UINT8, NULL, &(OSD_UINT8_t) { &batteryProfile.forceBatteryCellCount, 0, 24, 1 } }, + { "THR LIM TYPE",OME_TAB, NULL, &(OSD_TAB_t) { &rateProfile.throttle_limit_type, THROTTLE_LIMIT_TYPE_COUNT - 1, osdTableThrottleLimitType} }, + { "FORCE CELLS", OME_UINT8, NULL, &(OSD_UINT8_t) { &batteryProfile.forceBatteryCellCount, 0, 24, 1} }, #if defined(USE_VTX_CONTROL) #if defined(USE_VTX_RTC6705) || defined(USE_VTX_SMARTAUDIO) || defined(USE_VTX_TRAMP) {"VTX", OME_Funcall, cmsSelectVtx, NULL}, #endif #endif // VTX_CONTROL - { "FORCE LED", OME_TAB, NULL, &(OSD_TAB_t) { &cmsx_extraLedstripColor, COLOR_COUNT - 1, lookupTableLedstripColors} }, + { "FORCE LED", OME_TAB, NULL, &(OSD_TAB_t) { &cmsx_extraLedstripColor, COLOR_COUNT - 1, lookupTableLedstripColors} }, + { "FORCE LED2", OME_TAB, NULL, &(OSD_TAB_t) { &cmsx_extraLedstripColor2, COLOR_COUNT - 1, lookupTableLedstripColors} }, + { "LED2 BRIGHT", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_extraLedstripColor2_brightness, 0, 255, 1} }, { "MAIN", OME_Submenu, NULL, &cmsx_menuMain}, { "EXIT", OME_OSD_Exit, cmsMenuExit, (void *)CMS_EXIT}, { "SAVE&REBOOT", OME_OSD_Exit, cmsMenuExit, (void *)CMS_POPUP_SAVEREBOOT}, diff --git a/src/main/io/ledstrip.c b/src/main/io/ledstrip.c index 7d82ce793e..1867cbd7e6 100644 --- a/src/main/io/ledstrip.c +++ b/src/main/io/ledstrip.c @@ -151,6 +151,8 @@ void pgResetFn_ledStripConfig(ledStripConfig_t *ledStripConfig) ledStripConfig->ledstrip_rainbow_freq = 120; ledStripConfig->extra_ledstrip_blinkmask = 0x8005; // 0b1000000000000101; ledStripConfig->extra_ledstrip_color = COLOR_BLACK; + ledStripConfig->extra_ledstrip_color2 = COLOR_BLACK; + ledStripConfig->extra_ledstrip_color2_brightness = 0; #ifndef UNIT_TEST #ifdef LED_STRIP_PIN ledStripConfig->ioTag = IO_TAG(LED_STRIP_PIN); @@ -496,6 +498,17 @@ static const struct { {0, LED_MODE_ORIENTATION}, }; +static hsvColor_t getCurrentLedColor(int ledIndex) +{ + const ledConfig_t *ledConfig = &ledStripStatusModeConfig()->ledConfigs[ledIndex]; + hsvColor_t color = ledStripStatusModeConfig()->colors[ledGetColor(ledConfig)]; + if (COLOR_BLACK != ledStripConfig()->extra_ledstrip_color) { + color = hsv[ledStripConfig()->extra_ledstrip_color]; +} + + return color; +} + static void applyLedFixedLayers(void) { for (int ledIndex = 0; ledIndex < ledCounts.count; ledIndex++) { @@ -507,10 +520,7 @@ static void applyLedFixedLayers(void) switch (fn) { case LED_FUNCTION_COLOR: - color = ledStripStatusModeConfig()->colors[ledGetColor(ledConfig)]; - if (COLOR_BLACK != ledStripConfig()->extra_ledstrip_color) { - color = hsv[ledStripConfig()->extra_ledstrip_color]; - } + color = getCurrentLedColor(ledIndex); hsvColor_t nextColor = ledStripStatusModeConfig()->colors[(ledGetColor(ledConfig) + 1 + LED_CONFIGURABLE_COLOR_COUNT) % LED_CONFIGURABLE_COLOR_COUNT]; hsvColor_t previousColor = ledStripStatusModeConfig()->colors[(ledGetColor(ledConfig) - 1 + LED_CONFIGURABLE_COLOR_COUNT) % LED_CONFIGURABLE_COLOR_COUNT]; @@ -1042,7 +1052,12 @@ static void applyLedBlinkLayer(bool updateNow, timeUs_t *timer) const ledConfig_t *ledConfig = &ledStripStatusModeConfig()->ledConfigs[i]; if (ledGetOverlayBit(ledConfig, LED_OVERLAY_BLINK)) { - setLedHsv(i, getSC(LED_SCOLOR_BLINKBACKGROUND)); + hsvColor_t currentColor = getCurrentLedColor(i); + if (COLOR_BLACK != ledStripConfig()->extra_ledstrip_color2) { + currentColor = hsv[ledStripConfig()->extra_ledstrip_color2]; + } + currentColor.v = ledStripConfig()->extra_ledstrip_color2_brightness; + setLedHsv(i, ¤tColor); //getSC(LED_SCOLOR_BLINKBACKGROUND) } } } diff --git a/src/main/io/ledstrip.h b/src/main/io/ledstrip.h index bb7c63b28a..16afade083 100644 --- a/src/main/io/ledstrip.h +++ b/src/main/io/ledstrip.h @@ -184,6 +184,8 @@ typedef struct ledStripConfig_s { uint16_t ledstrip_rainbow_freq; uint16_t extra_ledstrip_blinkmask; uint8_t extra_ledstrip_color; + uint8_t extra_ledstrip_color2; + uint8_t extra_ledstrip_color2_brightness; } ledStripConfig_t; PG_DECLARE(ledStripConfig_t, ledStripConfig); From e83e796232693a66834c17b9d1a9b6cfa923d12e Mon Sep 17 00:00:00 2001 From: Ivan Efimov Date: Fri, 22 Mar 2024 00:18:14 -0500 Subject: [PATCH 11/44] MGP_V3: changed blinkmast default to 0011 0011 0011 0011 --- src/main/io/ledstrip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/io/ledstrip.c b/src/main/io/ledstrip.c index 1867cbd7e6..558ae295f1 100644 --- a/src/main/io/ledstrip.c +++ b/src/main/io/ledstrip.c @@ -149,7 +149,7 @@ void pgResetFn_ledStripConfig(ledStripConfig_t *ledStripConfig) ledStripConfig->ledstrip_brightness = 100; ledStripConfig->ledstrip_rainbow_delta = 0; ledStripConfig->ledstrip_rainbow_freq = 120; - ledStripConfig->extra_ledstrip_blinkmask = 0x8005; // 0b1000000000000101; + ledStripConfig->extra_ledstrip_blinkmask = 0x3333; // 0b1000000000000101; ledStripConfig->extra_ledstrip_color = COLOR_BLACK; ledStripConfig->extra_ledstrip_color2 = COLOR_BLACK; ledStripConfig->extra_ledstrip_color2_brightness = 0; From 7310dc5a8c945497c7d11f9e168016356e53897b Mon Sep 17 00:00:00 2001 From: Ivan Efimov Date: Fri, 22 Mar 2024 00:21:30 -0500 Subject: [PATCH 12/44] MGP_V4: removed throttle limit type from quick menu --- src/main/cms/cms_menu_quick.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/cms/cms_menu_quick.c b/src/main/cms/cms_menu_quick.c index 6d7abd9665..f1ffb00469 100644 --- a/src/main/cms/cms_menu_quick.c +++ b/src/main/cms/cms_menu_quick.c @@ -137,7 +137,6 @@ static const OSD_Entry menuMainEntries[] = #if defined(USE_RPM_LIMIT) { "RPM LIM", OME_Submenu, cmsMenuChange, &cmsx_menuRpmLimit }, #endif - { "THR LIM TYPE",OME_TAB, NULL, &(OSD_TAB_t) { &rateProfile.throttle_limit_type, THROTTLE_LIMIT_TYPE_COUNT - 1, osdTableThrottleLimitType} }, { "FORCE CELLS", OME_UINT8, NULL, &(OSD_UINT8_t) { &batteryProfile.forceBatteryCellCount, 0, 24, 1} }, #if defined(USE_VTX_CONTROL) #if defined(USE_VTX_RTC6705) || defined(USE_VTX_SMARTAUDIO) || defined(USE_VTX_TRAMP) From fbaf06c38624c2eaedba9bba497d7ad207cf302c Mon Sep 17 00:00:00 2001 From: Ivan Efimov Date: Fri, 22 Mar 2024 10:54:37 -0500 Subject: [PATCH 13/44] MGP_V5: build fix for csm_quick --- src/main/cms/cms_menu_quick.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/cms/cms_menu_quick.c b/src/main/cms/cms_menu_quick.c index f1ffb00469..f9c92ff29e 100644 --- a/src/main/cms/cms_menu_quick.c +++ b/src/main/cms/cms_menu_quick.c @@ -108,10 +108,11 @@ static const void *writeLedColor(displayPort_t *pDisp, const OSD_Entry *self) { return NULL; } - +/* static const char * const osdTableThrottleLimitType[] = { "OFF", "SCALE", "CLIP" }; +*/ static const char * const lookupTableLedstripColors[COLOR_COUNT] = { "DEFAULT", From 2efec461275779b3f6aa9e03c17289d18a606261 Mon Sep 17 00:00:00 2001 From: limonspb Date: Wed, 24 Apr 2024 09:20:57 -0500 Subject: [PATCH 14/44] Removed lookupTableLedstripColors from cms quick menu cuz its not needed now --- src/main/cms/cms_menu_quick.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/main/cms/cms_menu_quick.c b/src/main/cms/cms_menu_quick.c index f9c92ff29e..3be7c8858a 100644 --- a/src/main/cms/cms_menu_quick.c +++ b/src/main/cms/cms_menu_quick.c @@ -114,23 +114,6 @@ static const char * const osdTableThrottleLimitType[] = { }; */ -static const char * const lookupTableLedstripColors[COLOR_COUNT] = { - "DEFAULT", - "WHITE", - "RED", - "ORANGE", - "YELLOW", - "LIME_GREEN", - "GREEN", - "MINT_GREEN", - "CYAN", - "LIGHT_BLUE", - "BLUE", - "DARK_VIOLET", - "MAGENTA", - "DEEP_PINK" -}; - static const OSD_Entry menuMainEntries[] = { { "-- QUICK --", OME_Label, NULL, NULL }, From 00b4531a3ef9c40526ae68c8b41490fbba90f5c5 Mon Sep 17 00:00:00 2001 From: limonspb Date: Wed, 24 Apr 2024 09:22:36 -0500 Subject: [PATCH 15/44] KAACK_4.5_V3 --- src/main/build/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/build/version.h b/src/main/build/version.h index 3dbd84fc78..7e0b82a4fc 100644 --- a/src/main/build/version.h +++ b/src/main/build/version.h @@ -28,7 +28,7 @@ #define FC_VERSION_MINOR 5 // increment when a minor release is made (small new feature, change etc) #define FC_VERSION_PATCH_LEVEL 3 // increment when a bug is fixed -#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".RPM_KAACK_V2" +#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_4.5_V3" extern const char* const targetName; From a7cda11eb51d835ae5f662cec2739f0e4efbc78f Mon Sep 17 00:00:00 2001 From: limonspb Date: Wed, 24 Apr 2024 09:28:52 -0500 Subject: [PATCH 16/44] no beeper warning when armed --- src/main/osd/osd_warnings.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/osd/osd_warnings.c b/src/main/osd/osd_warnings.c index 83c5f4205d..445177e22d 100644 --- a/src/main/osd/osd_warnings.c +++ b/src/main/osd/osd_warnings.c @@ -420,7 +420,7 @@ void renderOsdWarning(char *warningText, bool *blinking, uint8_t *displayAttr) } // Visual beeper - if (osdWarnGetState(OSD_WARNING_VISUAL_BEEPER) && osdGetVisualBeeperState()) { + if (osdWarnGetState(OSD_WARNING_VISUAL_BEEPER) && osdGetVisualBeeperState() && !ARMING_FLAG(ARMED)) { tfp_sprintf(warningText, " * * * *"); *displayAttr = DISPLAYPORT_SEVERITY_INFO; osdSetVisualBeeperState(false); From 1c5d65e50bdb4d03d9e386a37f60d081d3873d64 Mon Sep 17 00:00:00 2001 From: limonspb Date: Sun, 28 Apr 2024 21:39:42 -0500 Subject: [PATCH 17/44] added osdDrawPrearmStrings --- src/main/cli/settings.c | 5 ++++ src/main/config/config.c | 7 ++++++ src/main/config/config.h | 4 +++ src/main/osd/osd_elements.c | 50 ++++++++++++++++++++++++++++++++++++- 4 files changed, 65 insertions(+), 1 deletion(-) diff --git a/src/main/cli/settings.c b/src/main/cli/settings.c index 23954c411a..466de655f3 100644 --- a/src/main/cli/settings.c +++ b/src/main/cli/settings.c @@ -1773,6 +1773,11 @@ const clivalue_t valueTable[] = { { "extra_low_battery_warning", VAR_UINT8 | MASTER_VALUE | MODE_STRING, .config.string = { 1, MAX_NAME_LENGTH, STRING_FLAGS_NONE }, PG_PILOT_CONFIG, offsetof(pilotConfig_t, extraLowBatteryWarning) }, { "extra_armed_warning", VAR_UINT8 | MASTER_VALUE | MODE_STRING, .config.string = { 1, MAX_NAME_LENGTH, STRING_FLAGS_NONE }, PG_PILOT_CONFIG, offsetof(pilotConfig_t, extraArmedWarning) }, { "extra_land_now_warning", VAR_UINT8 | MASTER_VALUE | MODE_STRING, .config.string = { 1, MAX_NAME_LENGTH, STRING_FLAGS_NONE }, PG_PILOT_CONFIG, offsetof(pilotConfig_t, extraLandNowWarning) }, + + + { "extra_prearm_1", VAR_UINT8 | MASTER_VALUE | MODE_STRING, .config.string = { 1, MAX_NAME_LENGTH, STRING_FLAGS_NONE }, PG_PILOT_CONFIG, offsetof(pilotConfig_t, extraPrearm1) }, + { "extra_prearm_2", VAR_UINT8 | MASTER_VALUE | MODE_STRING, .config.string = { 1, MAX_NAME_LENGTH, STRING_FLAGS_NONE }, PG_PILOT_CONFIG, offsetof(pilotConfig_t, extraPrearm2) }, + { "extra_prearm_3", VAR_UINT8 | MASTER_VALUE | MODE_STRING, .config.string = { 1, MAX_NAME_LENGTH, STRING_FLAGS_NONE }, PG_PILOT_CONFIG, offsetof(pilotConfig_t, extraPrearm3) }, #endif // PG_POSITION diff --git a/src/main/config/config.c b/src/main/config/config.c index e1edf0b594..a178b28be0 100644 --- a/src/main/config/config.c +++ b/src/main/config/config.c @@ -120,6 +120,9 @@ PG_RESET_TEMPLATE(pilotConfig_t, pilotConfig, .extraLowBatteryWarning = "AINT LEAVING", .extraArmedWarning = "LETS GO", .extraLandNowWarning = ">> LAND NOW <<", + .extraPrearm1 = "SCULLY", + .extraPrearm2 = "ONE", + .extraPrearm3 = "LOVE", ); PG_REGISTER_WITH_RESET_TEMPLATE(systemConfig_t, systemConfig, PG_SYSTEM_CONFIG, 3); @@ -226,6 +229,10 @@ void makeStringsUpperCase(void) toUpperCase(pilotConfigMutable()->extraTurtleModeWarning, pilotConfig()->extraTurtleModeWarning, MAX_NAME_LENGTH); toUpperCase(pilotConfigMutable()->extraLowBatteryWarning, pilotConfig()->extraLowBatteryWarning, MAX_NAME_LENGTH); toUpperCase(pilotConfigMutable()->extraArmedWarning, pilotConfig()->extraArmedWarning, MAX_NAME_LENGTH); + + toUpperCase(pilotConfigMutable()->extraPrearm1, pilotConfig()->extraPrearm1, MAX_NAME_LENGTH); + toUpperCase(pilotConfigMutable()->extraPrearm2, pilotConfig()->extraPrearm2, MAX_NAME_LENGTH); + toUpperCase(pilotConfigMutable()->extraPrearm3, pilotConfig()->extraPrearm3, MAX_NAME_LENGTH); } static void validateAndFixConfig(void) diff --git a/src/main/config/config.h b/src/main/config/config.h index 0d550e2f3f..1d4af0819e 100644 --- a/src/main/config/config.h +++ b/src/main/config/config.h @@ -41,6 +41,10 @@ typedef struct pilotConfig_s { char extraLowBatteryWarning[MAX_NAME_LENGTH + 1]; char extraArmedWarning[MAX_NAME_LENGTH + 1]; char extraLandNowWarning[MAX_NAME_LENGTH + 1]; + + char extraPrearm1[MAX_NAME_LENGTH + 1]; + char extraPrearm2[MAX_NAME_LENGTH + 1]; + char extraPrearm3[MAX_NAME_LENGTH + 1]; } pilotConfig_t; PG_DECLARE(pilotConfig_t, pilotConfig); diff --git a/src/main/osd/osd_elements.c b/src/main/osd/osd_elements.c index 073b801101..984321daa2 100644 --- a/src/main/osd/osd_elements.c +++ b/src/main/osd/osd_elements.c @@ -2250,7 +2250,8 @@ bool osdDrawNextActiveElement(displayPort_t *osdDisplayPort) } #ifdef USE_SPEC_PREARM_SCREEN -bool osdDrawSpec(displayPort_t *osdDisplayPort) + +bool osdDrawSpecReal(displayPort_t *osdDisplayPort) { static enum {RPM, POLES, MIXER, THR, MOTOR, BAT, VER} specState = RPM; static int currentRow; @@ -2337,6 +2338,53 @@ bool osdDrawSpec(displayPort_t *osdDisplayPort) return false; } + +bool osdDrawPrearmStrings(displayPort_t *osdDisplayPort) +{ + const uint8_t midRow = osdDisplayPort->rows / 2; + const uint8_t midCol = osdDisplayPort->cols / 2; + + char buff[OSD_ELEMENT_BUFFER_LENGTH] = ""; + + int len = 0; + + static int currentRow; + static int state = 0; + + switch (state) { + default: + case 0: + state++; + currentRow = midRow - 2; + len = tfp_sprintf(buff, "%s", pilotConfig()->extraPrearm1); + displayWrite(osdDisplayPort, midCol - (len / 2), currentRow++, DISPLAYPORT_SEVERITY_NORMAL, buff); + break; + case 1: + state++; + len = tfp_sprintf(buff, "%s", pilotConfig()->extraPrearm1); + displayWrite(osdDisplayPort, midCol - (len / 2), currentRow++, DISPLAYPORT_SEVERITY_NORMAL, buff); + break; + case 2: + state = 0; + len = tfp_sprintf(buff, "%s", pilotConfig()->extraPrearm1); + displayWrite(osdDisplayPort, midCol - (len / 2), currentRow++, DISPLAYPORT_SEVERITY_NORMAL, buff); + return true; + } + + return false; +} + +bool osdDrawSpec(displayPort_t *osdDisplayPort) +{ + const uint8_t throttleValue = calculateThrottlePercent(); + if (throttleValue > 80) { + return osdDrawPrearmStrings(osdDisplayPort); + } else { + return osdDrawSpecReal(osdDisplayPort); + } + +} + #endif // USE_SPEC_PREARM_SCREEN void osdDrawActiveElementsBackground(displayPort_t *osdDisplayPort) From 633872e160a4752f5d7af6a35c3a5638ab3f82f2 Mon Sep 17 00:00:00 2001 From: limonspb Date: Sun, 28 Apr 2024 21:43:23 -0500 Subject: [PATCH 18/44] Bring back throttle and motor limits to quick menu --- src/main/cms/cms_menu_quick.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/cms/cms_menu_quick.c b/src/main/cms/cms_menu_quick.c index 3be7c8858a..aa1ae37558 100644 --- a/src/main/cms/cms_menu_quick.c +++ b/src/main/cms/cms_menu_quick.c @@ -108,11 +108,11 @@ static const void *writeLedColor(displayPort_t *pDisp, const OSD_Entry *self) { return NULL; } -/* + static const char * const osdTableThrottleLimitType[] = { "OFF", "SCALE", "CLIP" }; -*/ + static const OSD_Entry menuMainEntries[] = { @@ -121,6 +121,9 @@ static const OSD_Entry menuMainEntries[] = #if defined(USE_RPM_LIMIT) { "RPM LIM", OME_Submenu, cmsMenuChange, &cmsx_menuRpmLimit }, #endif + { "THR LIM TYPE",OME_TAB, NULL, &(OSD_TAB_t) { &rateProfile.throttle_limit_type, THROTTLE_LIMIT_TYPE_COUNT - 1, osdTableThrottleLimitType} }, + { "THR LIM %", OME_UINT8, NULL, &(OSD_UINT8_t) { &rateProfile.throttle_limit_percent, 25, 100, 1} }, + { "MTR OUT LIM %",OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_motorOutputLimit, MOTOR_OUTPUT_LIMIT_PERCENT_MIN, MOTOR_OUTPUT_LIMIT_PERCENT_MAX, 1} }, { "FORCE CELLS", OME_UINT8, NULL, &(OSD_UINT8_t) { &batteryProfile.forceBatteryCellCount, 0, 24, 1} }, #if defined(USE_VTX_CONTROL) #if defined(USE_VTX_RTC6705) || defined(USE_VTX_SMARTAUDIO) || defined(USE_VTX_TRAMP) From 7fee5637266f0f6c55e810ab039040de20800bfc Mon Sep 17 00:00:00 2001 From: limonspb Date: Sun, 28 Apr 2024 22:02:29 -0500 Subject: [PATCH 19/44] Extra led configs into own CMS submenu --- mk/source.mk | 2 + src/main/cms/cms_menu_extra_led.c | 101 ++++++++++++++++++++++++++++++ src/main/cms/cms_menu_extra_led.h | 24 +++++++ src/main/cms/cms_menu_quick.c | 27 +------- 4 files changed, 130 insertions(+), 24 deletions(-) create mode 100644 src/main/cms/cms_menu_extra_led.c create mode 100644 src/main/cms/cms_menu_extra_led.h diff --git a/mk/source.mk b/mk/source.mk index 94e7a163a9..24fbbceea2 100644 --- a/mk/source.mk +++ b/mk/source.mk @@ -137,6 +137,7 @@ COMMON_SRC = \ blackbox/blackbox_io.c \ cms/cms.c \ cms/cms_menu_blackbox.c \ + cms/cms_menu_extra_led.c \ cms/cms_menu_failsafe.c \ cms/cms_menu_firmware.c \ cms/cms_menu_gps_rescue.c \ @@ -401,6 +402,7 @@ SIZE_OPTIMISED_SRC := $(SIZE_OPTIMISED_SRC) \ msp/msp_serial.c \ cms/cms.c \ cms/cms_menu_blackbox.c \ + cms/cms_menu_extra_led.c \ cms/cms_menu_failsafe.c \ cms/cms_menu_firmware.c \ cms/cms_menu_gps_rescue.c \ diff --git a/src/main/cms/cms_menu_extra_led.c b/src/main/cms/cms_menu_extra_led.c new file mode 100644 index 0000000000..d4c3f4a994 --- /dev/null +++ b/src/main/cms/cms_menu_extra_led.c @@ -0,0 +1,101 @@ +/* + * This file is part of Betaflight. + * + * Betaflight is free software. You can redistribute this software + * and/or modify this software under the terms of the GNU General + * Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later + * version. + * + * Betaflight is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this software. + * + * If not, see . + */ + +#include +#include +#include +#include + +#include "platform.h" + +#ifdef USE_CMS + +#include "io/ledstrip.h" +#include "cms/cms.h" +#include "cms/cms_types.h" +#include "config/config.h" +#include "pg/stats.h" +#include "flight/mixer.h" + +#include "cli/settings.h" + +static uint8_t cmsx_extraLedstripColor; +static uint8_t cmsx_extraLedstripColor2; +static uint8_t cmsx_extraLedstripColor2_brightness; + + +static const void *cmsx_ExtraLed_onEnter(displayPort_t *pDisp) +{ + UNUSED(pDisp); + + cmsx_extraLedstripColor = ledStripConfig()->extra_ledstrip_color; + cmsx_extraLedstripColor2 = ledStripConfig()->extra_ledstrip_color2; + cmsx_extraLedstripColor2_brightness = ledStripConfig()->extra_ledstrip_color2_brightness; + + return NULL; +} + +static const void *cmsx_ExtraLed_onExit(displayPort_t *pDisp, const OSD_Entry *self) +{ + UNUSED(pDisp); + UNUSED(self); + + ledStripConfigMutable()->extra_ledstrip_color = cmsx_extraLedstripColor; + ledStripConfigMutable()->extra_ledstrip_color2 = cmsx_extraLedstripColor2; + ledStripConfigMutable()->extra_ledstrip_color2_brightness = cmsx_extraLedstripColor2_brightness; + + return NULL; +} + +static const void *writeLedColor(displayPort_t *pDisp, const OSD_Entry *self) { + UNUSED(pDisp); + UNUSED(self); + ledStripConfigMutable()->extra_ledstrip_color = cmsx_extraLedstripColor; + ledStripConfigMutable()->extra_ledstrip_color2 = cmsx_extraLedstripColor2; + ledStripConfigMutable()->extra_ledstrip_color2_brightness = cmsx_extraLedstripColor2_brightness; + return NULL; +} + +static const OSD_Entry cmsx_menuExtraLedEntries[] = +{ + { "-- LEDS EXTRA --", OME_Label, NULL, NULL }, + + { "FORCE LED", OME_TAB, NULL, &(OSD_TAB_t) { &cmsx_extraLedstripColor, COLOR_COUNT - 1, lookupTableLedstripColors} }, + { "FORCE LED2", OME_TAB, NULL, &(OSD_TAB_t) { &cmsx_extraLedstripColor2, COLOR_COUNT - 1, lookupTableLedstripColors} }, + { "LED2 BRIGHT", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_extraLedstripColor2_brightness, 0, 255, 1} }, + + { "SAVE&REBOOT", OME_OSD_Exit, cmsMenuExit, (void *)CMS_POPUP_SAVEREBOOT }, + { "BACK", OME_Back, NULL, NULL }, + { NULL, OME_END, NULL, NULL} +}; + +CMS_Menu cmsx_menuExtraLed = { +#ifdef CMS_MENU_DEBUG + .GUARD_text = "RPMLIMIT", + .GUARD_type = OME_MENU, +#endif + .onEnter = cmsx_ExtraLed_onEnter, + .onExit = cmsx_ExtraLed_onExit, + .onDisplayUpdate = writeLedColor, + .entries = cmsx_menuExtraLedEntries +}; + +#endif diff --git a/src/main/cms/cms_menu_extra_led.h b/src/main/cms/cms_menu_extra_led.h new file mode 100644 index 0000000000..b86812a5dd --- /dev/null +++ b/src/main/cms/cms_menu_extra_led.h @@ -0,0 +1,24 @@ +/* + * This file is part of Betaflight. + * + * Betaflight is free software. You can redistribute this software + * and/or modify this software under the terms of the GNU General + * Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later + * version. + * + * Betaflight is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this software. + * + * If not, see . + */ + +#pragma once + +extern CMS_Menu cmsx_menuExtraLed; diff --git a/src/main/cms/cms_menu_quick.c b/src/main/cms/cms_menu_quick.c index aa1ae37558..52f7f65d30 100644 --- a/src/main/cms/cms_menu_quick.c +++ b/src/main/cms/cms_menu_quick.c @@ -29,11 +29,11 @@ #include "cms/cms.h" #include "cms/cms_types.h" +#include "cms/cms_menu_extra_led.h" #include "cms/cms_menu_main.h" #include "cms/cms_menu_vtx_common.h" #include "cms/cms_menu_rpm_limit.h" -#include "io/ledstrip.h" #include "common/printf.h" #include "config/config.h" @@ -56,9 +56,6 @@ static uint8_t rateProfileIndex; static batteryConfig_t batteryProfile; static uint8_t cmsx_motorOutputLimit; static uint8_t pidProfileIndex; -static uint8_t cmsx_extraLedstripColor; -static uint8_t cmsx_extraLedstripColor2; -static uint8_t cmsx_extraLedstripColor2_brightness; static pidProfile_t *pidProfile; static const void *quickMenuOnEnter(displayPort_t *pDisp) @@ -72,9 +69,6 @@ static const void *quickMenuOnEnter(displayPort_t *pDisp) memcpy(&batteryProfile, batteryConfigMutable(), sizeof(batteryConfig_t)); cmsx_motorOutputLimit = pidProfile->motor_output_limit; - cmsx_extraLedstripColor = ledStripConfig()->extra_ledstrip_color; - cmsx_extraLedstripColor2 = ledStripConfig()->extra_ledstrip_color2; - cmsx_extraLedstripColor2_brightness = ledStripConfig()->extra_ledstrip_color2_brightness; return NULL; } @@ -90,24 +84,11 @@ static const void *cmsx_RateProfileWriteback(displayPort_t *pDisp, const OSD_Ent pidProfile_t *pidProfile = pidProfilesMutable(pidProfileIndex); pidProfile->motor_output_limit = cmsx_motorOutputLimit; - ledStripConfigMutable()->extra_ledstrip_color = cmsx_extraLedstripColor; - ledStripConfigMutable()->extra_ledstrip_color2 = cmsx_extraLedstripColor2; - ledStripConfigMutable()->extra_ledstrip_color2_brightness = cmsx_extraLedstripColor2_brightness; - pidInitConfig(currentPidProfile); return NULL; } -static const void *writeLedColor(displayPort_t *pDisp, const OSD_Entry *self) { - UNUSED(pDisp); - UNUSED(self); - ledStripConfigMutable()->extra_ledstrip_color = cmsx_extraLedstripColor; - ledStripConfigMutable()->extra_ledstrip_color2 = cmsx_extraLedstripColor2; - ledStripConfigMutable()->extra_ledstrip_color2_brightness = cmsx_extraLedstripColor2_brightness; - return NULL; -} - static const char * const osdTableThrottleLimitType[] = { "OFF", "SCALE", "CLIP" @@ -121,6 +102,7 @@ static const OSD_Entry menuMainEntries[] = #if defined(USE_RPM_LIMIT) { "RPM LIM", OME_Submenu, cmsMenuChange, &cmsx_menuRpmLimit }, #endif + { "LEDS EXTRA", OME_Submenu, cmsMenuChange, &cmsx_menuExtraLed }, { "THR LIM TYPE",OME_TAB, NULL, &(OSD_TAB_t) { &rateProfile.throttle_limit_type, THROTTLE_LIMIT_TYPE_COUNT - 1, osdTableThrottleLimitType} }, { "THR LIM %", OME_UINT8, NULL, &(OSD_UINT8_t) { &rateProfile.throttle_limit_percent, 25, 100, 1} }, { "MTR OUT LIM %",OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_motorOutputLimit, MOTOR_OUTPUT_LIMIT_PERCENT_MIN, MOTOR_OUTPUT_LIMIT_PERCENT_MAX, 1} }, @@ -130,9 +112,6 @@ static const OSD_Entry menuMainEntries[] = {"VTX", OME_Funcall, cmsSelectVtx, NULL}, #endif #endif // VTX_CONTROL - { "FORCE LED", OME_TAB, NULL, &(OSD_TAB_t) { &cmsx_extraLedstripColor, COLOR_COUNT - 1, lookupTableLedstripColors} }, - { "FORCE LED2", OME_TAB, NULL, &(OSD_TAB_t) { &cmsx_extraLedstripColor2, COLOR_COUNT - 1, lookupTableLedstripColors} }, - { "LED2 BRIGHT", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_extraLedstripColor2_brightness, 0, 255, 1} }, { "MAIN", OME_Submenu, NULL, &cmsx_menuMain}, { "EXIT", OME_OSD_Exit, cmsMenuExit, (void *)CMS_EXIT}, { "SAVE&REBOOT", OME_OSD_Exit, cmsMenuExit, (void *)CMS_POPUP_SAVEREBOOT}, @@ -146,7 +125,7 @@ CMS_Menu cmsx_menuQuick = { #endif .onEnter = quickMenuOnEnter, .onExit = cmsx_RateProfileWriteback, - .onDisplayUpdate = writeLedColor, + .onDisplayUpdate = NULL, .entries = menuMainEntries, }; From 462630269b86983a25a0856bff9399fa424a39f0 Mon Sep 17 00:00:00 2001 From: limonspb Date: Sun, 28 Apr 2024 22:03:34 -0500 Subject: [PATCH 20/44] Removed profanity --- src/main/config/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/config/config.c b/src/main/config/config.c index a178b28be0..50aea93ee7 100644 --- a/src/main/config/config.c +++ b/src/main/config/config.c @@ -115,7 +115,7 @@ PG_RESET_TEMPLATE(pilotConfig_t, pilotConfig, .craftName = { 0 }, .pilotName = { 0 }, .extra100Throttle = "KAACK", - .extraFcHotWarning = "B*TCH IS HOT", + .extraFcHotWarning = "THIS IS HOT", .extraTurtleModeWarning = "SORRY BRYAN", .extraLowBatteryWarning = "AINT LEAVING", .extraArmedWarning = "LETS GO", From f50fbfe641cd9d1775dad116b0845721a1f22cdc Mon Sep 17 00:00:00 2001 From: limonspb Date: Sun, 28 Apr 2024 22:08:37 -0500 Subject: [PATCH 21/44] version change KAACK_4.5_V4 --- src/main/build/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/build/version.h b/src/main/build/version.h index 7e0b82a4fc..8c5591281e 100644 --- a/src/main/build/version.h +++ b/src/main/build/version.h @@ -28,7 +28,7 @@ #define FC_VERSION_MINOR 5 // increment when a minor release is made (small new feature, change etc) #define FC_VERSION_PATCH_LEVEL 3 // increment when a bug is fixed -#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_4.5_V3" +#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_4.5_V4" extern const char* const targetName; From c2a17d9e52e75f83d597beed1c7edb35b1331436 Mon Sep 17 00:00:00 2001 From: limonspb Date: Mon, 29 Apr 2024 05:11:38 -0500 Subject: [PATCH 22/44] Fix extraPrearm 1 2 3 --- src/main/osd/osd_elements.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/osd/osd_elements.c b/src/main/osd/osd_elements.c index 984321daa2..7e53198b1c 100644 --- a/src/main/osd/osd_elements.c +++ b/src/main/osd/osd_elements.c @@ -2361,12 +2361,12 @@ bool osdDrawPrearmStrings(displayPort_t *osdDisplayPort) break; case 1: state++; - len = tfp_sprintf(buff, "%s", pilotConfig()->extraPrearm1); + len = tfp_sprintf(buff, "%s", pilotConfig()->extraPrearm2); displayWrite(osdDisplayPort, midCol - (len / 2), currentRow++, DISPLAYPORT_SEVERITY_NORMAL, buff); break; case 2: state = 0; - len = tfp_sprintf(buff, "%s", pilotConfig()->extraPrearm1); + len = tfp_sprintf(buff, "%s", pilotConfig()->extraPrearm3); displayWrite(osdDisplayPort, midCol - (len / 2), currentRow++, DISPLAYPORT_SEVERITY_NORMAL, buff); return true; } From 7dfd6261d553c70d2d3b8f533deb9483fd6711cf Mon Sep 17 00:00:00 2001 From: limonspb Date: Mon, 29 Apr 2024 05:12:12 -0500 Subject: [PATCH 23/44] KAACK_4.5_V5 --- src/main/build/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/build/version.h b/src/main/build/version.h index 8c5591281e..bd8bca6830 100644 --- a/src/main/build/version.h +++ b/src/main/build/version.h @@ -28,7 +28,7 @@ #define FC_VERSION_MINOR 5 // increment when a minor release is made (small new feature, change etc) #define FC_VERSION_PATCH_LEVEL 3 // increment when a bug is fixed -#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_4.5_V4" +#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_4.5_V5" extern const char* const targetName; From 31e119d1d0181f779db20c18279a6c1e4f913015 Mon Sep 17 00:00:00 2001 From: Ivan Efimov Date: Mon, 6 May 2024 03:15:11 -0500 Subject: [PATCH 24/44] No Bryan :/ --- src/main/config/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/config/config.c b/src/main/config/config.c index 50aea93ee7..2f52d1dcad 100644 --- a/src/main/config/config.c +++ b/src/main/config/config.c @@ -116,7 +116,7 @@ PG_RESET_TEMPLATE(pilotConfig_t, pilotConfig, .pilotName = { 0 }, .extra100Throttle = "KAACK", .extraFcHotWarning = "THIS IS HOT", - .extraTurtleModeWarning = "SORRY BRYAN", + .extraTurtleModeWarning = "BRYAN", .extraLowBatteryWarning = "AINT LEAVING", .extraArmedWarning = "LETS GO", .extraLandNowWarning = ">> LAND NOW <<", From 2f4cc39adfbf8f851e5b5bc5ec9888e899c198bb Mon Sep 17 00:00:00 2001 From: Ivan Efimov Date: Mon, 6 May 2024 03:15:38 -0500 Subject: [PATCH 25/44] KAACK_4.5_V6 --- src/main/build/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/build/version.h b/src/main/build/version.h index bd8bca6830..01e7941fca 100644 --- a/src/main/build/version.h +++ b/src/main/build/version.h @@ -28,7 +28,7 @@ #define FC_VERSION_MINOR 5 // increment when a minor release is made (small new feature, change etc) #define FC_VERSION_PATCH_LEVEL 3 // increment when a bug is fixed -#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_4.5_V5" +#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_4.5_V6" extern const char* const targetName; From b426458c00d11b45dd4abdeb0eb63b4bfdef4a86 Mon Sep 17 00:00:00 2001 From: Ivan Efimov Date: Mon, 6 May 2024 03:19:54 -0500 Subject: [PATCH 26/44] KAACK_4.5_V7 --- src/main/build/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/build/version.h b/src/main/build/version.h index 01e7941fca..2786b778a9 100644 --- a/src/main/build/version.h +++ b/src/main/build/version.h @@ -28,7 +28,7 @@ #define FC_VERSION_MINOR 5 // increment when a minor release is made (small new feature, change etc) #define FC_VERSION_PATCH_LEVEL 3 // increment when a bug is fixed -#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_4.5_V6" +#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_4.5_V7" extern const char* const targetName; From 90bd368a3687e58c08e08df4044baf6047d27618 Mon Sep 17 00:00:00 2001 From: limonspb Date: Wed, 8 May 2024 23:20:26 -0500 Subject: [PATCH 27/44] Just sorry for turtle mode --- src/main/config/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/config/config.c b/src/main/config/config.c index 2f52d1dcad..13e1321229 100644 --- a/src/main/config/config.c +++ b/src/main/config/config.c @@ -116,7 +116,7 @@ PG_RESET_TEMPLATE(pilotConfig_t, pilotConfig, .pilotName = { 0 }, .extra100Throttle = "KAACK", .extraFcHotWarning = "THIS IS HOT", - .extraTurtleModeWarning = "BRYAN", + .extraTurtleModeWarning = "SORRY", .extraLowBatteryWarning = "AINT LEAVING", .extraArmedWarning = "LETS GO", .extraLandNowWarning = ">> LAND NOW <<", From 7ff3993ebd2c7a25e7de2321f6af121c7f3445c3 Mon Sep 17 00:00:00 2001 From: limonspb Date: Wed, 8 May 2024 23:21:39 -0500 Subject: [PATCH 28/44] Print version upon compiling --- src/main/build/version.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/build/version.c b/src/main/build/version.c index fbcbe8d61b..b43dd5d4fb 100644 --- a/src/main/build/version.c +++ b/src/main/build/version.c @@ -22,6 +22,13 @@ #include "version.h" +#ifndef FC_VERSION_STRING_PRINTED +#define FC_VERSION_STRING_PRINTED + +#pragma message "FC_VERSION_STRING: " FC_VERSION_STRING + +#endif + const char * const targetName = __TARGET__; const char * const shortGitRevision = __REVISION__; #if defined(__CONFIG_REVISION__) From 13a064baebbd3c6775d56e267b2dcca4bb7861c0 Mon Sep 17 00:00:00 2001 From: limonspb Date: Wed, 8 May 2024 23:23:12 -0500 Subject: [PATCH 29/44] Print OSD version on initialization closer to the middle of the screen --- src/main/osd/osd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/osd/osd.c b/src/main/osd/osd.c index 0609529a28..59f618bff5 100644 --- a/src/main/osd/osd.c +++ b/src/main/osd/osd.c @@ -494,7 +494,7 @@ static void osdCompleteInitialization(void) char string_buffer[30]; tfp_sprintf(string_buffer, "V%s", FC_VERSION_STRING); - displayWrite(osdDisplayPort, midCol + 5, midRow, DISPLAYPORT_SEVERITY_NORMAL, string_buffer); + displayWrite(osdDisplayPort, midCol, midRow, DISPLAYPORT_SEVERITY_NORMAL, string_buffer); #ifdef USE_CMS displayWrite(osdDisplayPort, midCol - 8, midRow + 2, DISPLAYPORT_SEVERITY_NORMAL, CMS_STARTUP_HELP_TEXT1); displayWrite(osdDisplayPort, midCol - 4, midRow + 3, DISPLAYPORT_SEVERITY_NORMAL, CMS_STARTUP_HELP_TEXT2); From a1089c40ad673873acb25befb0dd8e0e0f5f1ed2 Mon Sep 17 00:00:00 2001 From: limonspb Date: Wed, 8 May 2024 23:23:42 -0500 Subject: [PATCH 30/44] KAACK_4.5_V8 --- src/main/build/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/build/version.h b/src/main/build/version.h index 2786b778a9..9e54d517de 100644 --- a/src/main/build/version.h +++ b/src/main/build/version.h @@ -28,7 +28,7 @@ #define FC_VERSION_MINOR 5 // increment when a minor release is made (small new feature, change etc) #define FC_VERSION_PATCH_LEVEL 3 // increment when a bug is fixed -#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_4.5_V7" +#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_4.5_V8" extern const char* const targetName; From 4b74be88ec6861b5c1950385047e1d100b996449 Mon Sep 17 00:00:00 2001 From: Ivan Efimov Date: Sat, 11 May 2024 01:20:22 -0500 Subject: [PATCH 31/44] Spec selection OSD menu --- mk/source.mk | 2 + src/main/cms/cms_menu_quick.c | 3 + src/main/cms/cms_menu_spec.c | 134 +++++++++++++++++++++ src/main/cms/cms_menu_spec.h | 24 ++++ src/main/common/spec.c | 215 ++++++++++++++++++++++++++++++++++ src/main/common/spec.h | 61 ++++++++++ src/main/osd/osd.c | 6 + 7 files changed, 445 insertions(+) create mode 100644 src/main/cms/cms_menu_spec.c create mode 100644 src/main/cms/cms_menu_spec.h create mode 100644 src/main/common/spec.c create mode 100644 src/main/common/spec.h diff --git a/mk/source.mk b/mk/source.mk index 24fbbceea2..a594ec00a6 100644 --- a/mk/source.mk +++ b/mk/source.mk @@ -155,6 +155,7 @@ COMMON_SRC = \ cms/cms_menu_vtx_tramp.c \ cms/cms_menu_persistent_stats.c \ cms/cms_menu_rpm_limit.c \ + cms/cms_menu_spec.c \ cms/cms_menu_quick.c \ drivers/display_ug2864hsweg01.c \ drivers/light_ws2811strip.c \ @@ -420,6 +421,7 @@ SIZE_OPTIMISED_SRC := $(SIZE_OPTIMISED_SRC) \ cms/cms_menu_vtx_tramp.c \ cms/cms_menu_persistent_stats.c \ cms/cms_menu_rpm_limit.c \ + cms/cms_menu_spec.c \ cms/cms_menu_quick.c \ io/vtx.c \ io/vtx_rtc6705.c \ diff --git a/src/main/cms/cms_menu_quick.c b/src/main/cms/cms_menu_quick.c index 52f7f65d30..c00cc551fc 100644 --- a/src/main/cms/cms_menu_quick.c +++ b/src/main/cms/cms_menu_quick.c @@ -51,6 +51,8 @@ #include "cms_menu_quick.h" +#include "cms/cms_menu_spec.h" + static controlRateConfig_t rateProfile; static uint8_t rateProfileIndex; static batteryConfig_t batteryProfile; @@ -112,6 +114,7 @@ static const OSD_Entry menuMainEntries[] = {"VTX", OME_Funcall, cmsSelectVtx, NULL}, #endif #endif // VTX_CONTROL + { "SPECS", OME_Submenu, cmsMenuChange, &cmsx_menuSpec }, { "MAIN", OME_Submenu, NULL, &cmsx_menuMain}, { "EXIT", OME_OSD_Exit, cmsMenuExit, (void *)CMS_EXIT}, { "SAVE&REBOOT", OME_OSD_Exit, cmsMenuExit, (void *)CMS_POPUP_SAVEREBOOT}, diff --git a/src/main/cms/cms_menu_spec.c b/src/main/cms/cms_menu_spec.c new file mode 100644 index 0000000000..c6655fb40d --- /dev/null +++ b/src/main/cms/cms_menu_spec.c @@ -0,0 +1,134 @@ +/* + * This file is part of Betaflight. + * + * Betaflight is free software. You can redistribute this software + * and/or modify this software under the terms of the GNU General + * Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later + * version. + * + * Betaflight is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this software. + * + * If not, see . + */ + +#include +#include +#include +#include + +#include "platform.h" + +#ifdef USE_CMS +#ifdef USE_RPM_LIMIT + +#include "cms/cms.h" +#include "cms/cms_types.h" +#include "config/config.h" +#include "pg/stats.h" +#include "flight/mixer.h" + +#include "common/spec.h" + +#include "cms/cms_menu_spec.h" + +static const void *cmsx_spec_onEnter(displayPort_t *pDisp) +{ + UNUSED(pDisp); + + return NULL; +} + +static const void *cmsx_spec_onExit(displayPort_t *pDisp, const OSD_Entry *self) +{ + UNUSED(pDisp); + UNUSED(self); + +// mixerConfigMutable()->rpm_limit_value = rpm_limit_value; +// motorConfigMutable()->kv = kv; +// mixerConfigMutable()->rpm_limit = rpm_limit; + + return NULL; +} + +static const void *cmsx_SetFreedom(displayPort_t *pDisplay, const void *ptr) +{ + UNUSED(ptr); + setSpec(SPEC_FREEDOM); + saveConfigAndNotify(); + cmsMenuExit(pDisplay, (const void *)(intptr_t)CMS_POPUP_SAVEREBOOT); + return NULL; +} + +static const void *cmsx_Set7(displayPort_t *pDisplay, const void *ptr) +{ + UNUSED(ptr); + setSpec(SPEC_7IN); + saveConfigAndNotify(); + cmsMenuExit(pDisplay, (const void *)(intptr_t)CMS_POPUP_SAVEREBOOT); + return NULL; +} + +static const void *cmsx_SetMayhem(displayPort_t *pDisplay, const void *ptr) +{ + UNUSED(ptr); + setSpec(SPEC_MAYHEM); + saveConfigAndNotify(); + cmsMenuExit(pDisplay, (const void *)(intptr_t)CMS_POPUP_SAVEREBOOT); + return NULL; +} + +static const void *cmsx_SetTt(displayPort_t *pDisplay, const void *ptr) +{ + UNUSED(ptr); + setSpec(SPEC_TT); + saveConfigAndNotify(); + cmsMenuExit(pDisplay, (const void *)(intptr_t)CMS_POPUP_SAVEREBOOT); + return NULL; +} + + +static const void *cmsx_SetLl(displayPort_t *pDisplay, const void *ptr) +{ + UNUSED(ptr); + setSpec(SPEC_LLIGUETA); + saveConfigAndNotify(); + cmsMenuExit(pDisplay, (const void *)(intptr_t)CMS_POPUP_SAVEREBOOT); + return NULL; +} + + +static const OSD_Entry cmsx_menuSpecEntries[] = +{ + { "-- SELECT SPEC --", OME_Label, NULL, NULL }, + + {specArray[SPEC_FREEDOM].name, OME_Funcall, cmsx_SetFreedom, NULL}, + {specArray[SPEC_7IN].name, OME_Funcall, cmsx_Set7, NULL}, + {specArray[SPEC_MAYHEM].name, OME_Funcall, cmsx_SetMayhem, NULL}, + {specArray[SPEC_TT].name, OME_Funcall, cmsx_SetTt, NULL}, + {specArray[SPEC_LLIGUETA].name, OME_Funcall, cmsx_SetLl, NULL}, + + { "BACK", OME_Back, NULL, NULL }, + { NULL, OME_END, NULL, NULL} +}; + +CMS_Menu cmsx_menuSpec = { +#ifdef CMS_MENU_DEBUG + .GUARD_text = "SPECS", + .GUARD_type = OME_MENU, +#endif + .onEnter = cmsx_spec_onEnter, + .onExit = cmsx_spec_onExit, + .onDisplayUpdate = NULL, + .entries = cmsx_menuSpecEntries +}; + +#endif +#endif // USE_RPM_LIMIT diff --git a/src/main/cms/cms_menu_spec.h b/src/main/cms/cms_menu_spec.h new file mode 100644 index 0000000000..f03bbd764a --- /dev/null +++ b/src/main/cms/cms_menu_spec.h @@ -0,0 +1,24 @@ +/* + * This file is part of Betaflight. + * + * Betaflight is free software. You can redistribute this software + * and/or modify this software under the terms of the GNU General + * Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later + * version. + * + * Betaflight is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this software. + * + * If not, see . + */ + +#pragma once + +extern CMS_Menu cmsx_menuSpec; diff --git a/src/main/common/spec.c b/src/main/common/spec.c new file mode 100644 index 0000000000..27b0ad8f23 --- /dev/null +++ b/src/main/common/spec.c @@ -0,0 +1,215 @@ +/* + * This file is part of Betaflight. + * + * Betaflight is free software. You can redistribute this software + * and/or modify this software under the terms of the GNU General + * Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later + * version. + * + * Betaflight is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this software. + * + * If not, see . + */ + +#include +#include +#include +#include + +#include "flight/mixer.h" +#include "pg/motor.h" +#include "drivers/motor.h" + +#include "platform.h" + + + +#include "common/spec.h" + +SpecType getCurrentSpec(void) +{ + SpecType result = SPEC_COUNT; + + for (int spec = 0; spec < SPEC_COUNT; spec++) { + if (checkSpec(spec)) { + return spec; + } + } + + return result; +} + +bool checkSpec(SpecType specType) +{ + return + isMotorProtocolBidirDshot() && + mixerConfig()->rpm_limit == specArray[specType].rpm_limit && + mixerConfig()->rpm_limit_value == specArray[specType].rpm_limit_value && + motorConfig()->motorPoleCount == specArray[specType].motorPoleCount && + mixerConfig()->rpm_limit_p == specArray[specType].rpm_limit_p && + mixerConfig()->rpm_limit_i == specArray[specType].rpm_limit_i && + mixerConfig()->rpm_limit_d == specArray[specType].rpm_limit_d; +} + +void setSpec(SpecType specType) +{ + mixerConfigMutable()->rpm_limit = specArray[specType].rpm_limit; + mixerConfigMutable()->rpm_limit_value = specArray[specType].rpm_limit_value; + motorConfigMutable()->motorPoleCount = specArray[specType].motorPoleCount; + mixerConfigMutable()->rpm_limit_p = specArray[specType].rpm_limit_p; + mixerConfigMutable()->rpm_limit_i = specArray[specType].rpm_limit_i; + mixerConfigMutable()->rpm_limit_d = specArray[specType].rpm_limit_d; +} + +// Definition of specArray, initialized with sample data +specSettings_t specArray[] = { + { + "FREEDOM 18K", // Name + true, // bool rpm_limit; + 25, // uint16_t rpm_limit_p; + 10, // uint16_t rpm_limit_i; + 8, // uint16_t rpm_limit_d; + 18000, // uint16_t rpm_limit_value; + 14, // uint8_t motorPoleCount; + + { // Logo groups + { "FS ", + " ", + " " }, + + { " F ", + " S ", + " " }, + + { " ", + "FS ", + " " }, + + { "F ", + "S ", + " " }, + } + }, + + { + "IO 7IN 13K", // Name + true, // bool rpm_limit; + 25, // uint16_t rpm_limit_p; + 10, // uint16_t rpm_limit_i; + 8, // uint16_t rpm_limit_d; + 13000, // uint16_t rpm_limit_value; + 14, // uint8_t motorPoleCount; + + { // Logo groups + { "7I ", + " ", + " " }, + + { " 7 ", + " I ", + " " }, + + { " ", + "7I ", + " " }, + + { "7 ", + "I ", + " " }, + } + }, + + { + "MAYHEM 24K", // Name + true, // bool rpm_limit; + 25, // uint16_t rpm_limit_p; + 10, // uint16_t rpm_limit_i; + 8, // uint16_t rpm_limit_d; + 24000, // uint16_t rpm_limit_value; + 14, // uint8_t motorPoleCount; + + { // Logo groups + { "M8 ", + " ", + " " }, + + { " M ", + " 8 ", + " " }, + + { " ", + "M8 ", + " " }, + + { "M ", + "8 ", + " " }, + } + }, + + { + "TT 30K", // Name + true, // bool rpm_limit; + 25, // uint16_t rpm_limit_p; + 10, // uint16_t rpm_limit_i; + 8, // uint16_t rpm_limit_d; + 30000, // uint16_t rpm_limit_value; + 12, // uint8_t motorPoleCount; + + { // Logo groups + { "TT ", + " ", + " " }, + + { " T ", + " T ", + " " }, + + { " ", + "TT ", + " " }, + + { "T ", + "T ", + " " }, + } + }, + + + { + "LA LLIGUETA 17K", // Name + true, // bool rpm_limit; + 25, // uint16_t rpm_limit_p; + 10, // uint16_t rpm_limit_i; + 8, // uint16_t rpm_limit_d; + 17000, // uint16_t rpm_limit_value; + 14, // uint8_t motorPoleCount; + + { // Logo groups + { "LL ", + " ", + " " }, + + { " L ", + " L ", + " " }, + + { " ", + "LL ", + " " }, + + { "L ", + "L ", + " " }, + } + }, + +}; diff --git a/src/main/common/spec.h b/src/main/common/spec.h new file mode 100644 index 0000000000..a5c02cbc69 --- /dev/null +++ b/src/main/common/spec.h @@ -0,0 +1,61 @@ +/* + * This file is part of Betaflight. + * + * Betaflight is free software. You can redistribute this software + * and/or modify this software under the terms of the GNU General + * Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later + * version. + * + * Betaflight is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this software. + * + * If not, see . + */ + +#pragma once + +#include +#include +#include +#include + +#define MAX_NAME_SIZE 16 +#define LOGO_WIDTH 4 // 3 + \n +#define LOGO_HEIGHT 3 +#define LOGO_GROUPS 4 + +// Enum representing different types of specs +typedef enum { + SPEC_FREEDOM, + SPEC_7IN, + SPEC_MAYHEM, + SPEC_TT, + SPEC_LLIGUETA, + SPEC_COUNT // must be last +} SpecType; + +// Struct representing the settings for each spec type +typedef struct specSettings_s { + char name[MAX_NAME_SIZE]; // Null-terminated name string + bool rpm_limit; + uint16_t rpm_limit_p; + uint16_t rpm_limit_i; + uint16_t rpm_limit_d; + uint16_t rpm_limit_value; + uint8_t motorPoleCount; + char logo[LOGO_GROUPS][LOGO_HEIGHT][LOGO_WIDTH]; // 4x3 array of strings +} specSettings_t; + +// Declaration of specArray for external access +extern specSettings_t specArray[]; + +bool checkSpec(SpecType specType); +void setSpec(SpecType specType); +SpecType getCurrentSpec(void); \ No newline at end of file diff --git a/src/main/osd/osd.c b/src/main/osd/osd.c index 59f618bff5..6e683cc2a0 100644 --- a/src/main/osd/osd.c +++ b/src/main/osd/osd.c @@ -100,6 +100,8 @@ #include "sensors/battery.h" #include "sensors/sensors.h" +#include "common/spec.h" + #ifdef USE_HARDWARE_REVISION_DETECTION #include "hardware_revision.h" #endif @@ -495,6 +497,10 @@ static void osdCompleteInitialization(void) char string_buffer[30]; tfp_sprintf(string_buffer, "V%s", FC_VERSION_STRING); displayWrite(osdDisplayPort, midCol, midRow, DISPLAYPORT_SEVERITY_NORMAL, string_buffer); + SpecType specType = getCurrentSpec(); + if (specType != SPEC_COUNT) { + displayWrite(osdDisplayPort, midCol - 5, midRow + 1, DISPLAYPORT_SEVERITY_NORMAL, specArray[specType].name); + } #ifdef USE_CMS displayWrite(osdDisplayPort, midCol - 8, midRow + 2, DISPLAYPORT_SEVERITY_NORMAL, CMS_STARTUP_HELP_TEXT1); displayWrite(osdDisplayPort, midCol - 4, midRow + 3, DISPLAYPORT_SEVERITY_NORMAL, CMS_STARTUP_HELP_TEXT2); From bb869a07b4d92858dd661966adfdef4222eb9386 Mon Sep 17 00:00:00 2001 From: Ivan Efimov Date: Sat, 11 May 2024 19:33:50 -0500 Subject: [PATCH 32/44] Spec name in prearm screen --- src/main/osd/osd_elements.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/osd/osd_elements.c b/src/main/osd/osd_elements.c index 7e53198b1c..82f5e2115b 100644 --- a/src/main/osd/osd_elements.c +++ b/src/main/osd/osd_elements.c @@ -128,6 +128,7 @@ #include "common/utils.h" #include "common/unit.h" #include "common/filter.h" +#include "common/spec.h" #include "config/config.h" #include "config/feature.h" @@ -2253,7 +2254,7 @@ bool osdDrawNextActiveElement(displayPort_t *osdDisplayPort) bool osdDrawSpecReal(displayPort_t *osdDisplayPort) { - static enum {RPM, POLES, MIXER, THR, MOTOR, BAT, VER} specState = RPM; + static enum {RPM, POLES, MIXER, THR, MOTOR, BAT, VER, SPEC_NAME} specState = RPM; static int currentRow; const uint8_t midRow = osdDisplayPort->rows / 2; @@ -2331,9 +2332,21 @@ bool osdDrawSpecReal(displayPort_t *osdDisplayPort) len = strlen(FC_VERSION_STRING); displayWrite(osdDisplayPort, midCol - (len / 2), currentRow++, DISPLAYPORT_SEVERITY_NORMAL, FC_VERSION_STRING); + specState = SPEC_NAME; + break; + + case SPEC_NAME: { + SpecType specType = getCurrentSpec(); + + if (specType != SPEC_COUNT) { + len = strlen(specArray[specType].name); + displayWrite(osdDisplayPort, midCol - (len / 2), currentRow++, DISPLAYPORT_SEVERITY_NORMAL, specArray[specType].name); + } + specState = RPM; return true; + } } return false; From 988160494a3324756a2902eb890bca33d50201d7 Mon Sep 17 00:00:00 2001 From: Ivan Efimov Date: Sat, 11 May 2024 22:05:07 -0500 Subject: [PATCH 33/44] Selected spec spinning logo --- src/main/cli/settings.c | 1 + src/main/osd/osd.h | 1 + src/main/osd/osd_elements.c | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) diff --git a/src/main/cli/settings.c b/src/main/cli/settings.c index 466de655f3..f62678cebe 100644 --- a/src/main/cli/settings.c +++ b/src/main/cli/settings.c @@ -1490,6 +1490,7 @@ const clivalue_t valueTable[] = { { "osd_efficiency_pos", VAR_UINT16 | MASTER_VALUE, .config.minmaxUnsigned = { 0, OSD_POSCFG_MAX }, PG_OSD_ELEMENT_CONFIG, offsetof(osdElementConfig_t, item_pos[OSD_EFFICIENCY]) }, { "osd_total_flights_pos", VAR_UINT16 | MASTER_VALUE, .config.minmaxUnsigned = { 0, OSD_POSCFG_MAX }, PG_OSD_ELEMENT_CONFIG, offsetof(osdElementConfig_t, item_pos[OSD_TOTAL_FLIGHTS]) }, { "osd_aux_pos", VAR_UINT16 | MASTER_VALUE, .config.minmaxUnsigned = { 0, OSD_POSCFG_MAX }, PG_OSD_ELEMENT_CONFIG, offsetof(osdElementConfig_t, item_pos[OSD_AUX_VALUE]) }, + { "osd_spec_logo_pos", VAR_UINT16 | MASTER_VALUE, .config.minmaxUnsigned = { 0, OSD_POSCFG_MAX }, PG_OSD_ELEMENT_CONFIG, offsetof(osdElementConfig_t, item_pos[OSD_SPEC_LOGO]) }, #ifdef USE_MSP_DISPLAYPORT { "osd_sys_goggle_voltage_pos", VAR_UINT16 | MASTER_VALUE, .config.minmaxUnsigned = { 0, OSD_POSCFG_MAX }, PG_OSD_ELEMENT_CONFIG, offsetof(osdElementConfig_t, item_pos[OSD_SYS_GOGGLE_VOLTAGE]) }, diff --git a/src/main/osd/osd.h b/src/main/osd/osd.h index de4511905a..a091d2a92c 100644 --- a/src/main/osd/osd.h +++ b/src/main/osd/osd.h @@ -189,6 +189,7 @@ typedef enum { OSD_GPS_LAP_TIME_CURRENT, OSD_GPS_LAP_TIME_PREVIOUS, OSD_GPS_LAP_TIME_BEST3, + OSD_SPEC_LOGO, OSD_ITEM_COUNT // MUST BE LAST } osd_items_e; diff --git a/src/main/osd/osd_elements.c b/src/main/osd/osd_elements.c index 82f5e2115b..077f957af3 100644 --- a/src/main/osd/osd_elements.c +++ b/src/main/osd/osd_elements.c @@ -1721,6 +1721,41 @@ static void osdElementAuxValue(osdElementParms_t *element) tfp_sprintf(element->buff, "%c%d", osdConfig()->aux_symbol, osdAuxValue); } +static void osdElementSpecLogo(osdElementParms_t *element) +{ + static int state = -1; // for rendering logo line by line + static int animationState = 0; // for rendering different logo states + static timeMs_t lastLogoAnimationUpdateMs = 0; + static SpecType specType = SPEC_COUNT; + + switch (state) { + case -1: + specType = getCurrentSpec(); + break; + default: + if (specType != SPEC_COUNT) { + osdDisplayWrite(element, element->elemPosX, element->elemPosY + state, DISPLAYPORT_SEVERITY_NORMAL, specArray[specType].logo[animationState][state]); + } + } + + state ++; + + if (state >= LOGO_HEIGHT) { // rendered the whole logo + if (millis() - lastLogoAnimationUpdateMs > 1000) // update logo animation ever second + { + lastLogoAnimationUpdateMs = millis(); + animationState = (animationState + 1) % LOGO_GROUPS; // increment animation state and make sure its < LOGO_GROUPS + } + + state = -1; + } else { + element->rendered = false; + } + + element->drawElement = false; // element already drawn +} + + static void osdElementWarnings(osdElementParms_t *element) { bool elementBlinking = false; @@ -1873,6 +1908,7 @@ static const uint8_t osdElementDisplayOrder[] = { OSD_SYS_VTX_TEMP, OSD_SYS_FAN_SPEED, #endif + OSD_SPEC_LOGO, }; // Define the mapping between the OSD element id and the function to draw it @@ -2012,6 +2048,7 @@ const osdElementDrawFn osdElementDrawFunction[OSD_ITEM_COUNT] = { [OSD_SYS_VTX_TEMP] = osdElementSys, [OSD_SYS_FAN_SPEED] = osdElementSys, #endif + [OSD_SPEC_LOGO] = osdElementSpecLogo, }; // Define the mapping between the OSD element id and the function to draw its background (static part) From f20f7eefb19023ef6235e7fcfa308f8b655ad833 Mon Sep 17 00:00:00 2001 From: Ivan Efimov Date: Sat, 11 May 2024 22:21:40 -0500 Subject: [PATCH 34/44] Show spec logo if hidden, enable OSD if not enabled --- src/main/config/config.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/config/config.c b/src/main/config/config.c index 13e1321229..bed6872d72 100644 --- a/src/main/config/config.c +++ b/src/main/config/config.c @@ -592,6 +592,16 @@ if (systemConfig()->configurationState == CONFIGURATION_STATE_UNCONFIGURED) { osdConfigMutable()->timers[i] = osdTimerDefault[i]; } } + + featureEnableImmediate(FEATURE_OSD); + + if (!VISIBLE(osdElementConfig()->item_pos[OSD_SPEC_LOGO])) { + uint16_t profileFlags = 0; + for (unsigned i = 1; i <= OSD_PROFILE_COUNT; i++) { + profileFlags |= OSD_PROFILE_FLAG(i); + } + osdElementConfigMutable()->item_pos[OSD_SPEC_LOGO] = OSD_POS(1, 2) | profileFlags; + } #endif #if defined(USE_VTX_COMMON) && defined(USE_VTX_TABLE) From 84358767f294531986527b2fada3b83e9d149416 Mon Sep 17 00:00:00 2001 From: Ivan Efimov Date: Sat, 11 May 2024 22:38:21 -0500 Subject: [PATCH 35/44] Add KV to spec when selecting, but not when checking --- src/main/common/spec.c | 6 ++++++ src/main/common/spec.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/main/common/spec.c b/src/main/common/spec.c index 27b0ad8f23..b9b8e649aa 100644 --- a/src/main/common/spec.c +++ b/src/main/common/spec.c @@ -64,6 +64,7 @@ void setSpec(SpecType specType) mixerConfigMutable()->rpm_limit = specArray[specType].rpm_limit; mixerConfigMutable()->rpm_limit_value = specArray[specType].rpm_limit_value; motorConfigMutable()->motorPoleCount = specArray[specType].motorPoleCount; + motorConfigMutable()->kv = specArray[specType].kv; mixerConfigMutable()->rpm_limit_p = specArray[specType].rpm_limit_p; mixerConfigMutable()->rpm_limit_i = specArray[specType].rpm_limit_i; mixerConfigMutable()->rpm_limit_d = specArray[specType].rpm_limit_d; @@ -79,6 +80,7 @@ specSettings_t specArray[] = { 8, // uint16_t rpm_limit_d; 18000, // uint16_t rpm_limit_value; 14, // uint8_t motorPoleCount; + 1960, // uint16_t kv; { // Logo groups { "FS ", @@ -107,6 +109,7 @@ specSettings_t specArray[] = { 8, // uint16_t rpm_limit_d; 13000, // uint16_t rpm_limit_value; 14, // uint8_t motorPoleCount; + 1300, // uint16_t kv; { // Logo groups { "7I ", @@ -135,6 +138,7 @@ specSettings_t specArray[] = { 8, // uint16_t rpm_limit_d; 24000, // uint16_t rpm_limit_value; 14, // uint8_t motorPoleCount; + 1960, // uint16_t kv; { // Logo groups { "M8 ", @@ -163,6 +167,7 @@ specSettings_t specArray[] = { 8, // uint16_t rpm_limit_d; 30000, // uint16_t rpm_limit_value; 12, // uint8_t motorPoleCount; + 4533, // uint16_t kv; { // Logo groups { "TT ", @@ -192,6 +197,7 @@ specSettings_t specArray[] = { 8, // uint16_t rpm_limit_d; 17000, // uint16_t rpm_limit_value; 14, // uint8_t motorPoleCount; + 1980, // uint16_t kv; { // Logo groups { "LL ", diff --git a/src/main/common/spec.h b/src/main/common/spec.h index a5c02cbc69..10f48c244d 100644 --- a/src/main/common/spec.h +++ b/src/main/common/spec.h @@ -50,6 +50,7 @@ typedef struct specSettings_s { uint16_t rpm_limit_d; uint16_t rpm_limit_value; uint8_t motorPoleCount; + uint16_t kv; char logo[LOGO_GROUPS][LOGO_HEIGHT][LOGO_WIDTH]; // 4x3 array of strings } specSettings_t; From 58cf53de1dc3cdace4b0b7571ccd179db3c75864 Mon Sep 17 00:00:00 2001 From: Ivan Efimov Date: Sat, 11 May 2024 22:38:55 -0500 Subject: [PATCH 36/44] KAACK_4.5_V10 --- src/main/build/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/build/version.h b/src/main/build/version.h index 9e54d517de..640ce307fe 100644 --- a/src/main/build/version.h +++ b/src/main/build/version.h @@ -28,7 +28,7 @@ #define FC_VERSION_MINOR 5 // increment when a minor release is made (small new feature, change etc) #define FC_VERSION_PATCH_LEVEL 3 // increment when a bug is fixed -#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_4.5_V8" +#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_4.5_V10" extern const char* const targetName; From b8b74e8333f494a8935d0adb5be680ca2107d32d Mon Sep 17 00:00:00 2001 From: Ivan Efimov Date: Sat, 11 May 2024 22:41:15 -0500 Subject: [PATCH 37/44] removed quick menu header --- src/main/cms/cms_menu_quick.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/cms/cms_menu_quick.c b/src/main/cms/cms_menu_quick.c index c00cc551fc..2591b76568 100644 --- a/src/main/cms/cms_menu_quick.c +++ b/src/main/cms/cms_menu_quick.c @@ -99,8 +99,6 @@ static const char * const osdTableThrottleLimitType[] = { static const OSD_Entry menuMainEntries[] = { - { "-- QUICK --", OME_Label, NULL, NULL }, - #if defined(USE_RPM_LIMIT) { "RPM LIM", OME_Submenu, cmsMenuChange, &cmsx_menuRpmLimit }, #endif From 0b931f1c172cd5aa99c9a0563b701b00f3ba4f9d Mon Sep 17 00:00:00 2001 From: Ivan Efimov Date: Sat, 11 May 2024 22:41:48 -0500 Subject: [PATCH 38/44] KAACK_4.5_V11 --- src/main/build/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/build/version.h b/src/main/build/version.h index 640ce307fe..2bd1068a82 100644 --- a/src/main/build/version.h +++ b/src/main/build/version.h @@ -28,7 +28,7 @@ #define FC_VERSION_MINOR 5 // increment when a minor release is made (small new feature, change etc) #define FC_VERSION_PATCH_LEVEL 3 // increment when a bug is fixed -#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_4.5_V10" +#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_4.5_V11" extern const char* const targetName; From 86b273166e4c5a99dd5bef737145045360fca917 Mon Sep 17 00:00:00 2001 From: Ivan Efimov Date: Wed, 15 May 2024 23:09:59 -0500 Subject: [PATCH 39/44] KAACK_V12 --- src/main/build/version.h | 2 +- src/main/osd/osd.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/build/version.h b/src/main/build/version.h index 2bd1068a82..f12b5d51f2 100644 --- a/src/main/build/version.h +++ b/src/main/build/version.h @@ -28,7 +28,7 @@ #define FC_VERSION_MINOR 5 // increment when a minor release is made (small new feature, change etc) #define FC_VERSION_PATCH_LEVEL 3 // increment when a bug is fixed -#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_4.5_V11" +#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_V12" extern const char* const targetName; diff --git a/src/main/osd/osd.c b/src/main/osd/osd.c index 6e683cc2a0..c506f2eca7 100644 --- a/src/main/osd/osd.c +++ b/src/main/osd/osd.c @@ -496,7 +496,7 @@ static void osdCompleteInitialization(void) char string_buffer[30]; tfp_sprintf(string_buffer, "V%s", FC_VERSION_STRING); - displayWrite(osdDisplayPort, midCol, midRow, DISPLAYPORT_SEVERITY_NORMAL, string_buffer); + displayWrite(osdDisplayPort, midCol - 5, midRow, DISPLAYPORT_SEVERITY_NORMAL, string_buffer); SpecType specType = getCurrentSpec(); if (specType != SPEC_COUNT) { displayWrite(osdDisplayPort, midCol - 5, midRow + 1, DISPLAYPORT_SEVERITY_NORMAL, specArray[specType].name); From 3122ff36d413177bdd92de30f3b6d0504107603d Mon Sep 17 00:00:00 2001 From: limonspb Date: Wed, 3 Jul 2024 03:42:56 -0500 Subject: [PATCH 40/44] V13 - MGP spec name change to PRO --- src/main/build/version.h | 2 +- src/main/common/spec.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/build/version.h b/src/main/build/version.h index f12b5d51f2..edb1994b00 100644 --- a/src/main/build/version.h +++ b/src/main/build/version.h @@ -28,7 +28,7 @@ #define FC_VERSION_MINOR 5 // increment when a minor release is made (small new feature, change etc) #define FC_VERSION_PATCH_LEVEL 3 // increment when a bug is fixed -#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_V12" +#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_V13" extern const char* const targetName; diff --git a/src/main/common/spec.c b/src/main/common/spec.c index b9b8e649aa..fda404076f 100644 --- a/src/main/common/spec.c +++ b/src/main/common/spec.c @@ -102,7 +102,7 @@ specSettings_t specArray[] = { }, { - "IO 7IN 13K", // Name + "MGP PRO 13K", // Name true, // bool rpm_limit; 25, // uint16_t rpm_limit_p; 10, // uint16_t rpm_limit_i; @@ -112,20 +112,20 @@ specSettings_t specArray[] = { 1300, // uint16_t kv; { // Logo groups - { "7I ", + { "PRO", " ", " " }, - { " 7 ", - " I ", + { " RO", + "P ", " " }, - { " ", - "7I ", + { "P O", + " R ", " " }, - { "7 ", - "I ", + { "PR ", + " O", " " }, } }, From 3b3104d497215d96313bff0567ceddd2330172fd Mon Sep 17 00:00:00 2001 From: limonspb Date: Wed, 3 Jul 2024 03:59:41 -0500 Subject: [PATCH 41/44] V14 - default logo spot for HD - a little to the right --- src/main/build/version.h | 2 +- src/main/config/config.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/build/version.h b/src/main/build/version.h index edb1994b00..7d327ba62f 100644 --- a/src/main/build/version.h +++ b/src/main/build/version.h @@ -28,7 +28,7 @@ #define FC_VERSION_MINOR 5 // increment when a minor release is made (small new feature, change etc) #define FC_VERSION_PATCH_LEVEL 3 // increment when a bug is fixed -#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_V13" +#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_V14" extern const char* const targetName; diff --git a/src/main/config/config.c b/src/main/config/config.c index bed6872d72..320886f9b5 100644 --- a/src/main/config/config.c +++ b/src/main/config/config.c @@ -600,7 +600,12 @@ if (systemConfig()->configurationState == CONFIGURATION_STATE_UNCONFIGURED) { for (unsigned i = 1; i <= OSD_PROFILE_COUNT; i++) { profileFlags |= OSD_PROFILE_FLAG(i); } - osdElementConfigMutable()->item_pos[OSD_SPEC_LOGO] = OSD_POS(1, 2) | profileFlags; + + if (osdConfig()->canvas_cols < 40) { + osdElementConfigMutable()->item_pos[OSD_SPEC_LOGO] = OSD_POS(1, 2) | profileFlags; + } else { + osdElementConfigMutable()->item_pos[OSD_SPEC_LOGO] = OSD_POS(3, 2) | profileFlags; + } } #endif From cadd13a476cf250216062a9056dc356a1278f58c Mon Sep 17 00:00:00 2001 From: limonspb Date: Mon, 28 Oct 2024 17:37:12 -0500 Subject: [PATCH 42/44] V15 - merging 4.5-maintenance --- src/main/build/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/build/version.h b/src/main/build/version.h index 7d327ba62f..9c063602b4 100644 --- a/src/main/build/version.h +++ b/src/main/build/version.h @@ -28,7 +28,7 @@ #define FC_VERSION_MINOR 5 // increment when a minor release is made (small new feature, change etc) #define FC_VERSION_PATCH_LEVEL 3 // increment when a bug is fixed -#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_V14" +#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_V15" extern const char* const targetName; From 1b288467f9453d02944d73d8ebb860d42eec1cf6 Mon Sep 17 00:00:00 2001 From: "limon.spb" <2925027+limonspb@users.noreply.github.com> Date: Wed, 26 Mar 2025 21:33:12 -0500 Subject: [PATCH 43/44] V16 - rebasing to 4.5.2 release (4.5.3 in progress) --- src/main/build/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/build/version.h b/src/main/build/version.h index 9c063602b4..c15fea273d 100644 --- a/src/main/build/version.h +++ b/src/main/build/version.h @@ -28,7 +28,7 @@ #define FC_VERSION_MINOR 5 // increment when a minor release is made (small new feature, change etc) #define FC_VERSION_PATCH_LEVEL 3 // increment when a bug is fixed -#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_V15" +#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_V16" extern const char* const targetName; From efef89735a712d27fda1b83ef0a8ed6302db5b07 Mon Sep 17 00:00:00 2001 From: "limon.spb" <2925027+limonspb@users.noreply.github.com> Date: Wed, 26 Mar 2025 21:38:14 -0500 Subject: [PATCH 44/44] V17 - added ledstrip if not added by cloud to avoid build errors --- src/main/build/version.h | 2 +- src/main/target/common_pre.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/build/version.h b/src/main/build/version.h index c15fea273d..d1a3f6b0e1 100644 --- a/src/main/build/version.h +++ b/src/main/build/version.h @@ -28,7 +28,7 @@ #define FC_VERSION_MINOR 5 // increment when a minor release is made (small new feature, change etc) #define FC_VERSION_PATCH_LEVEL 3 // increment when a bug is fixed -#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_V16" +#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL) ".KAACK_V17" extern const char* const targetName; diff --git a/src/main/target/common_pre.h b/src/main/target/common_pre.h index 11e7e97fd0..076160df6c 100644 --- a/src/main/target/common_pre.h +++ b/src/main/target/common_pre.h @@ -57,6 +57,10 @@ #define USE_RACE_PRO #endif +#if !defined USE_LED_STRIP +#define USE_LED_STRIP +#endif + #ifdef USE_DSHOT #define USE_DSHOT_BITBANG #define USE_DSHOT_TELEMETRY