diff --git a/src/main/fc/config.c b/src/main/fc/config.c index 708ec5510c0..f906b690f91 100755 --- a/src/main/fc/config.c +++ b/src/main/fc/config.c @@ -107,7 +107,7 @@ PG_RESET_TEMPLATE(featureConfig_t, featureConfig, #ifdef USE_AUTO_TRANSITION PG_REGISTER_WITH_RESET_TEMPLATE(systemConfig_t, systemConfig, PG_SYSTEM_CONFIG, 11); #else -PG_REGISTER_WITH_RESET_TEMPLATE(systemConfig_t, systemConfig, PG_SYSTEM_CONFIG, 7); +PG_REGISTER_WITH_RESET_TEMPLATE(systemConfig_t, systemConfig, PG_SYSTEM_CONFIG, 8); #endif PG_RESET_TEMPLATE(systemConfig_t, systemConfig, @@ -134,7 +134,8 @@ PG_RESET_TEMPLATE(systemConfig_t, systemConfig, .vtolMcThrReservePercent = SETTING_VTOL_MC_THR_RESERVE_PERCENT_DEFAULT, #endif .craftName = SETTING_NAME_DEFAULT, - .pilotName = SETTING_NAME_DEFAULT + .pilotName = SETTING_NAME_DEFAULT, + .programmingFrameworkRateHz = 10 ); PG_REGISTER_WITH_RESET_TEMPLATE(beeperConfig_t, beeperConfig, PG_BEEPER_CONFIG, 2); diff --git a/src/main/fc/config.h b/src/main/fc/config.h index 75abebf7f9f..093f5180630 100644 --- a/src/main/fc/config.h +++ b/src/main/fc/config.h @@ -97,6 +97,7 @@ typedef struct systemConfig_s { #endif char craftName[MAX_NAME_LENGTH + 1]; char pilotName[MAX_NAME_LENGTH + 1]; + uint8_t programmingFrameworkRateHz; } systemConfig_t; PG_DECLARE(systemConfig_t, systemConfig); diff --git a/src/main/fc/fc_tasks.c b/src/main/fc/fc_tasks.c index 100f510b7b2..7c3f8ff36b0 100755 --- a/src/main/fc/fc_tasks.c +++ b/src/main/fc/fc_tasks.c @@ -473,6 +473,8 @@ void fcTasksInit(void) #endif #ifdef USE_PROGRAMMING_FRAMEWORK setTaskEnabled(TASK_PROGRAMMING_FRAMEWORK, true); + rescheduleTask(TASK_PROGRAMMING_FRAMEWORK, + TASK_PERIOD_HZ(systemConfig()->programmingFrameworkRateHz)); #endif #ifdef USE_IRLOCK setTaskEnabled(TASK_IRLOCK, irlockHasBeenDetected()); diff --git a/src/main/fc/settings.yaml b/src/main/fc/settings.yaml index 142f5f06c9b..b11ab522df5 100644 --- a/src/main/fc/settings.yaml +++ b/src/main/fc/settings.yaml @@ -4311,6 +4311,14 @@ groups: type: string field: pilotName max: MAX_NAME_LENGTH + - name: programming_framework_rate_hz + description: "Programming Framework / Logic Conditions update rate in Hz (10-100)" + default_value: 10 + min: 10 + max: 100 + field: programmingFrameworkRateHz + type: uint8_t + condition: USE_PROGRAMMING_FRAMEWORK - name: PG_MODE_ACTIVATION_OPERATOR_CONFIG type: modeActivationOperatorConfig_t