Skip to content

Commit 732e118

Browse files
L4kyshellixyz
authored andcommitted
Change VTX power level via RC adjustments (iNavFlight#4717)
1 parent 0eb9378 commit 732e118

File tree

5 files changed

+23
-2
lines changed

5 files changed

+23
-2
lines changed

.github/ISSUE_TEMPLATE/Bug_report.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
---
22
name: "\U0001F41B Bug report"
33
about: Report an issue to help make INAV better
4+
title: ''
5+
labels: ''
6+
assignees: ''
47

58
---
69

.github/ISSUE_TEMPLATE/Feature_request.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
---
22
name: "\U0001F680Feature request"
33
about: Suggest a new feature for INAV
4+
title: ''
5+
labels: ''
6+
assignees: ''
47

58
---
69

.github/ISSUE_TEMPLATE/Question.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
---
2-
name: "\U00002753Question"
2+
name: "❓Question"
33
about: Have a question?
4+
title: ''
5+
labels: ''
6+
assignees: ''
47

58
---
69

@@ -16,3 +19,5 @@ You can also read public documentations or watch video tutorials:
1619
* [Official Wiki](https://github.com/iNavFlight/inav/wiki)
1720
* [Video series by Painless360](https://www.youtube.com/playlist?list=PLYsWjANuAm4qdXEGFSeUhOZ10-H8YTSnH)
1821
* [Video series by Paweł Spychalski](https://www.youtube.com/playlist?list=PLOUQ8o2_nCLloACrA6f1_daCjhqY2x0fB)
22+
* [How to setup INAV on a flying wing](https://www.youtube.com/playlist?list=PLOUQ8o2_nCLn_lCX7UB2OPLzR4w5G4el3)
23+
* [How to setup INAV on a 5" quad](https://www.youtube.com/playlist?list=PLOUQ8o2_nCLl9M6Vm-ZNLMCr6_9yNVHQG)

src/main/fc/rc_adjustments.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "config/parameter_group_ids.h"
3434

3535
#include "drivers/time.h"
36+
#include "drivers/vtx_common.h"
3637

3738
#include "fc/config.h"
3839
#include "fc/controlrate_profile.h"
@@ -45,6 +46,7 @@
4546
#include "flight/pid.h"
4647

4748
#include "io/beeper.h"
49+
#include "io/vtx.h"
4850

4951
#include "sensors/boardalignment.h"
5052

@@ -262,6 +264,10 @@ static const adjustmentConfig_t defaultAdjustmentConfigs[ADJUSTMENT_FUNCTION_COU
262264
.adjustmentFunction = ADJUSTMENT_FW_MIN_THROTTLE_DOWN_PITCH_ANGLE,
263265
.mode = ADJUSTMENT_MODE_STEP,
264266
.data = { .stepConfig = { .step = 5 }}
267+
}, {
268+
.adjustmentFunction = ADJUSTMENT_VTX_POWER_LEVEL,
269+
.mode = ADJUSTMENT_MODE_STEP,
270+
.data = { .stepConfig = { .step = 1 }}
265271
#ifdef USE_INFLIGHT_PROFILE_ADJUSTMENT
266272
}, {
267273
.adjustmentFunction = ADJUSTMENT_PROFILE,
@@ -542,6 +548,9 @@ static void applyStepAdjustment(controlRateConfig_t *controlRateConfig, uint8_t
542548
case ADJUSTMENT_FW_MIN_THROTTLE_DOWN_PITCH_ANGLE:
543549
applyAdjustmentU16(ADJUSTMENT_FW_MIN_THROTTLE_DOWN_PITCH_ANGLE, &mixerConfigMutable()->fwMinThrottleDownPitchAngle, delta, 0, FW_MIN_THROTTLE_DOWN_PITCH_ANGLE_MAX);
544550
break;
551+
case ADJUSTMENT_VTX_POWER_LEVEL:
552+
applyAdjustmentU8(ADJUSTMENT_VTX_POWER_LEVEL, &vtxSettingsConfigMutable()->power, delta, VTX_SETTINGS_MIN_POWER, VTX_SETTINGS_MAX_POWER);
553+
break;
545554
default:
546555
break;
547556
};

src/main/fc/rc_adjustments.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ typedef enum {
7474
ADJUSTMENT_VEL_Z_I = 46,
7575
ADJUSTMENT_VEL_Z_D = 47,
7676
ADJUSTMENT_FW_MIN_THROTTLE_DOWN_PITCH_ANGLE = 48,
77+
ADJUSTMENT_VTX_POWER_LEVEL = 49,
7778
#ifdef USE_INFLIGHT_PROFILE_ADJUSTMENT
78-
ADJUSTMENT_PROFILE = 49,
79+
ADJUSTMENT_PROFILE = 50,
7980
#endif
8081
ADJUSTMENT_FUNCTION_COUNT // must be last
8182
} adjustmentFunction_e;

0 commit comments

Comments
 (0)