Update profile to 6 (#1397)

* Update profile to 6

* Update config_utils.cpp

* Update requirements.txt

* 20250609 profile addition test (#1400)

* Bump node workflow actions (#1399)

* Bump max count of profiles in protobuf

* Update fortinbra picobuild

* Add hotkeys to proto

* Add hotkeys to proto

* Add hotkey options and translation for non-english

---------

Co-authored-by: Pelsin <ian@vidales.se>
Co-authored-by: Luke A <arntsonl@gmail.com>
This commit is contained in:
TheTrain
2025-07-15 17:41:45 -04:00
committed by GitHub
parent 1aae598b5e
commit 314c0b3240
15 changed files with 66 additions and 32 deletions

View File

@@ -1,2 +1,2 @@
protobuf>=3.19
grpcio-tools==1.71.0
grpcio-tools==1.71.0

View File

@@ -225,13 +225,13 @@ message AlternativePinMappings
message ProfileOptions
{
repeated AlternativePinMappings deprecatedAlternativePinMappings = 1 [(nanopb).max_count = 3, deprecated = true];
repeated GpioMappings gpioMappingsSets = 2 [(nanopb).max_count = 3];
repeated GpioMappings gpioMappingsSets = 2 [(nanopb).max_count = 5];
}
message DisplayOptions
{
optional bool enabled = 1;
optional int32 deprecatedI2cBlock = 2 [deprecated = true];
optional int32 deprecatedI2cSDAPin = 3 [deprecated = true];
optional int32 deprecatedI2cSCLPin = 4 [deprecated = true];
@@ -488,7 +488,7 @@ message ReverseOptions
message AnalogADS1219Options
{
optional bool enabled = 1;
optional int32 deprecatedI2cBlock = 2 [deprecated = true];
optional int32 deprecatedI2cSDAPin = 3 [deprecated = true];
optional int32 deprecatedI2cSCLPin = 4 [deprecated = true];

View File

@@ -350,26 +350,28 @@ enum GamepadHotkey
HOTKEY_MENU_NAV_SELECT = 48;
HOTKEY_MENU_NAV_BACK = 49;
HOTKEY_MENU_NAV_TOGGLE = 50;
HOTKEY_LEDS_NONE = 51;
HOTKEY_LEDS_ANIMATION_UP = 52;
HOTKEY_LEDS_ANIMATION_DOWN = 53;
HOTKEY_LEDS_PARAMETER_UP = 54;
HOTKEY_LEDS_PRESS_PARAMETER_UP = 55;
HOTKEY_LEDS_PRESS_PARAMETER_DOWN = 56;
HOTKEY_LEDS_PARAMETER_DOWN = 57;
HOTKEY_LEDS_BRIGHTNESS_UP = 58;
HOTKEY_LEDS_BRIGHTNESS_DOWN = 59;
HOTKEY_LEDS_FADETIME_UP = 60;
HOTKEY_LEDS_FADETIME_DOWN = 61;
HOTKEY_AMBIENT_LIGHT_EFFECTS_CHANGE = 62;
HOTKEY_AMBIENT_LIGHT_EFFECTS_ON_OFF = 63;
HOTKEY_AMBIENT_LIGHT_EFFECTS_BRIGHTNESS_UP = 64;
HOTKEY_AMBIENT_LIGHT_EFFECTS_BRIGHTNESS_DOWN = 65;
HOTKEY_AMBIENT_LIGHT_EFFECTS_PARAMETER_UP = 66;
HOTKEY_AMBIENT_LIGHT_EFFECTS_PARAMETER_DOWN = 67;
HOTKEY_AMBIENT_LIGHT_EFFECTS_FRAME_SPEED_UP = 68;
HOTKEY_AMBIENT_LIGHT_EFFECTS_FRAME_SPEED_DOWN = 69;
HOTKEY_AMBIENT_LIGHT_EFFECTS_CUSTOM_LINKAGE = 70;
HOTKEY_LEDS_NONE = 51;
HOTKEY_LEDS_ANIMATION_UP = 52;
HOTKEY_LEDS_ANIMATION_DOWN = 53;
HOTKEY_LEDS_PARAMETER_UP = 54;
HOTKEY_LEDS_PRESS_PARAMETER_UP = 55;
HOTKEY_LEDS_PRESS_PARAMETER_DOWN = 56;
HOTKEY_LEDS_PARAMETER_DOWN = 57;
HOTKEY_LEDS_BRIGHTNESS_UP = 58;
HOTKEY_LEDS_BRIGHTNESS_DOWN = 59;
HOTKEY_LEDS_FADETIME_UP = 60;
HOTKEY_LEDS_FADETIME_DOWN = 61;
HOTKEY_AMBIENT_LIGHT_EFFECTS_CHANGE = 62;
HOTKEY_AMBIENT_LIGHT_EFFECTS_ON_OFF = 63;
HOTKEY_AMBIENT_LIGHT_EFFECTS_BRIGHTNESS_UP = 64;
HOTKEY_AMBIENT_LIGHT_EFFECTS_BRIGHTNESS_DOWN = 65;
HOTKEY_AMBIENT_LIGHT_EFFECTS_PARAMETER_UP = 66;
HOTKEY_AMBIENT_LIGHT_EFFECTS_PARAMETER_DOWN = 67;
HOTKEY_AMBIENT_LIGHT_EFFECTS_FRAME_SPEED_UP = 68;
HOTKEY_AMBIENT_LIGHT_EFFECTS_FRAME_SPEED_DOWN = 69;
HOTKEY_AMBIENT_LIGHT_EFFECTS_CUSTOM_LINKAGE = 70;
HOTKEY_LOAD_PROFILE_5 = 71;
HOTKEY_LOAD_PROFILE_6 = 72;
}
enum AnimationEffects

View File

@@ -1342,7 +1342,7 @@ void gpioMappingsMigrationProfiles(Config& config)
}
};
for (uint8_t profileNum = 0; profileNum <= 2; profileNum++) {
for (uint8_t profileNum = 0; profileNum <= 4; profileNum++) {
for (Pin_t pin = 0; pin < (Pin_t)NUM_BANK0_GPIOS; pin++) {
config.profileOptions.gpioMappingsSets[profileNum].pins[pin].action = config.gpioMappings.pins[pin].action;
}
@@ -1366,7 +1366,7 @@ void gpioMappingsMigrationProfiles(Config& config)
config.profileOptions.gpioMappingsSets[profileNum].pins_count = NUM_BANK0_GPIOS;
}
// reminder that this must be set or else nanopb won't retain anything
config.profileOptions.gpioMappingsSets_count = 3;
config.profileOptions.gpioMappingsSets_count = 5;
config.migrations.buttonProfilesMigrated = true;
}
@@ -1380,7 +1380,7 @@ void migrateTurboPinToGpio(Config& config) {
Pin_t pin = turboOptions.deprecatedButtonPin;
// previous config had a value we haven't migrated yet, it can/should apply in the new config
config.gpioMappings.pins[pin].action = GpioAction::BUTTON_PRESS_TURBO;
for (uint8_t profileNum = 0; profileNum <= 2; profileNum++) {
for (uint8_t profileNum = 0; profileNum <= 4; profileNum++) {
config.profileOptions.gpioMappingsSets[profileNum].pins[pin].action = GpioAction::BUTTON_PRESS_TURBO;
}
turboOptions.deprecatedButtonPin = -1; // set our turbo options to -1 for subsequent calls
@@ -1462,7 +1462,7 @@ void migrateMacroPinsToGpio(Config& config) {
if (macroOptions.has_deprecatedPin && isValidPin(macroOptions.deprecatedPin) ) {
Pin_t pin = macroOptions.deprecatedPin;
config.gpioMappings.pins[pin].action = GpioAction::BUTTON_PRESS_MACRO;
for (uint8_t profileNum = 0; profileNum <= 2; profileNum++) {
for (uint8_t profileNum = 0; profileNum <= 4; profileNum++) {
config.profileOptions.gpioMappingsSets[profileNum].pins[pin].action = GpioAction::BUTTON_PRESS_MACRO;
}
macroOptions.deprecatedPin = -1; // set our turbo options to -1 for subsequent calls
@@ -1478,7 +1478,7 @@ void migrateMacroPinsToGpio(Config& config) {
isValidPin(macroOptions.macroList[i].deprecatedMacroTriggerPin) ) {
Pin_t pin = macroOptions.macroList[i].deprecatedMacroTriggerPin;
config.gpioMappings.pins[pin].action = actionList[i];
for (uint8_t profileNum = 0; profileNum <= 2; profileNum++) {
for (uint8_t profileNum = 0; profileNum <= 4; profileNum++) {
config.profileOptions.gpioMappingsSets[profileNum].pins[pin].action = actionList[i];
}
macroOptions.macroList[i].deprecatedMacroTriggerPin = -1; // set our turbo options to -1 for subsequent calls

View File

@@ -642,6 +642,22 @@ void Gamepad::processHotkeyAction(GamepadHotkey action) {
}
}
break;
case HOTKEY_LOAD_PROFILE_5:
if (action != lastAction) {
if (Storage::getInstance().setProfile(5)) {
userRequestedReinit = true;
reqSave = true;
}
}
break;
case HOTKEY_LOAD_PROFILE_6:
if (action != lastAction) {
if (Storage::getInstance().setProfile(6)) {
userRequestedReinit = true;
reqSave = true;
}
}
break;
case HOTKEY_NEXT_PROFILE:
if (action != lastAction) {
Storage::getInstance().nextProfile();

View File

@@ -578,7 +578,7 @@ std::string setProfileOptions()
profileOptions.gpioMappingsSets[altsIndex].enabled = alt["enabled"];
profileOptions.gpioMappingsSets_count = ++altsIndex;
if (altsIndex > 2) break;
if (altsIndex > 4) break;
}
EventManager::getInstance().triggerEvent(new GPStorageSaveEvent(true));

View File

@@ -73,6 +73,8 @@ export default {
'load-profile-2': 'Lade Profil #2',
'load-profile-3': 'Lade Profil #3',
'load-profile-4': 'Lade Profil #4',
'load-profile-5': 'Lade Profil #5',
'load-profile-6': 'Lade Profil #6',
'next-profile': 'Nächstes Profil',
'reboot-default': 'GP2040-CE Neustarten',
},

View File

@@ -127,6 +127,8 @@ export default {
'load-profile-2': 'Load Profile #2',
'load-profile-3': 'Load Profile #3',
'load-profile-4': 'Load Profile #4',
'load-profile-5': 'Load Profile #5',
'load-profile-6': 'Load Profile #6',
'reboot-default': 'Reboot GP2040-CE',
'save-config': 'Save Config',
'next-profile': 'Next Profile',

View File

@@ -127,6 +127,8 @@ export default {
'load-profile-2': 'Cargar Perfil #2',
'load-profile-3': 'Cargar Perfil #3',
'load-profile-4': 'Cargar Perfil #4',
'load-profile-5': 'Cargar Perfil #5',
'load-profile-6': 'Cargar Perfil #6',
'reboot-default': 'Reiniciar GP2040-CE',
'save-config': 'Guardar Configuración',
'next-profile': 'Siguiente Perfil',
@@ -165,4 +167,4 @@ export default {
'product-id': 'ID de Producto',
'vendor-id': 'ID de Fabricante',
},
};
};

View File

@@ -120,6 +120,8 @@ export default {
'load-profile-2': 'プロファイル #2をロード',
'load-profile-3': 'プロファイル #3をロード',
'load-profile-4': 'プロファイル #4をロード',
'load-profile-5': 'プロファイル #5をロード',
'load-profile-6': 'プロファイル #6をロード',
'reboot-default': 'GP2040-CEを再起動',
'save-config': '設定を保存',
'next-profile': '次のプロファイル',

View File

@@ -127,6 +127,8 @@ export default {
'load-profile-2': '프로필 불러오기 #2',
'load-profile-3': '프로필 불러오기 #3',
'load-profile-4': '프로필 불러오기 #4',
'load-profile-5': '프로필 불러오기 #5',
'load-profile-6': '프로필 불러오기 #6',
'reboot-default': 'GP2040-CE 재시작',
'save-config': '설정 저장',
'next-profile': '다음 프로필',

View File

@@ -71,6 +71,8 @@ export default {
'load-profile-2': 'Carregar Perfil #2',
'load-profile-3': 'Carregar Perfil #3',
'load-profile-4': 'Carregar Perfil #4',
'load-profile-5': 'Carregar Perfil #5',
'load-profile-6': 'Carregar Perfil #6',
'next-profile': 'Próximo Perfil',
'reboot-default': 'Reiniciar GP2040-CE',
},

View File

@@ -125,6 +125,8 @@ export default {
'load-profile-2': '加载 档案 #2',
'load-profile-3': '加载 档案 #3',
'load-profile-4': '加载 档案 #4',
'load-profile-5': '加载 档案 #5',
'load-profile-6': '加载 档案 #6',
'reboot-default': '重启 GP2040-CE',
'next-profile': '下一个档案',
'previous-profile': '上一个档案',

View File

@@ -262,6 +262,8 @@ const HOTKEY_ACTIONS = [
{ labelKey: 'hotkey-actions.load-profile-2', value: 16 },
{ labelKey: 'hotkey-actions.load-profile-3', value: 17 },
{ labelKey: 'hotkey-actions.load-profile-4', value: 18 },
{ labelKey: 'hotkey-actions.load-profile-5', value: 71 },
{ labelKey: 'hotkey-actions.load-profile-6', value: 72 },
{ labelKey: 'hotkey-actions.next-profile', value: 35 },
{ labelKey: 'hotkey-actions.previous-profile', value: 42 },
{ labelKey: 'hotkey-actions.l3-button', value: 19 },

View File

@@ -3,7 +3,7 @@ import WebApi from '../Services/WebApi';
import { PinActionValues } from '../Data/Pins';
// Max number of profiles that can be created, including the base profile
export const MAX_PROFILES = 4;
export const MAX_PROFILES = 6;
type CustomMasks = {
customButtonMask: number;